mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Make closeApp work with no event
And exit using QApplication.exit so we don't mess with window events to exit the app
This commit is contained in:
parent
7ac331ed41
commit
ef8216b338
@ -2314,11 +2314,12 @@ extern Startup *s;
|
||||
void LibraryWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (!trayIconController->handleCloseToTrayIcon(event)) {
|
||||
closeApp(event);
|
||||
event->accept();
|
||||
closeApp();
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::closeApp(QCloseEvent *event)
|
||||
void LibraryWindow::prepareToCloseApp()
|
||||
{
|
||||
s->stop();
|
||||
settings->setValue(MAIN_WINDOW_GEOMETRY, saveGeometry());
|
||||
@ -2327,8 +2328,13 @@ void LibraryWindow::closeApp(QCloseEvent *event)
|
||||
sideBar->close();
|
||||
|
||||
QApplication::instance()->processEvents();
|
||||
event->accept();
|
||||
QMainWindow::closeEvent(event);
|
||||
}
|
||||
|
||||
void LibraryWindow::closeApp()
|
||||
{
|
||||
prepareToCloseApp();
|
||||
|
||||
qApp->exit(0);
|
||||
}
|
||||
|
||||
void LibraryWindow::showNoLibrariesWidget()
|
||||
|
@ -388,7 +388,8 @@ public slots:
|
||||
void checkMaxNumLibraries();
|
||||
void showErrorUpgradingLibrary(const QString &path);
|
||||
|
||||
void closeApp(QCloseEvent *event);
|
||||
void prepareToCloseApp();
|
||||
void closeApp();
|
||||
|
||||
private:
|
||||
//fullscreen mode in Windows for preventing this bug: QTBUG-41309 https://bugreports.qt.io/browse/QTBUG-41309
|
||||
|
Loading…
Reference in New Issue
Block a user