added detection for signal aboutToQuit when system shutdown
This commit is contained in:
parent
a4130ba373
commit
1f9948b4c2
2 changed files with 15 additions and 0 deletions
|
|
@ -509,6 +509,11 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op
|
|||
AddConsolePage();
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Connect aboutToQuit signal to handleAboutToQuit |
|
||||
\*-----------------------------------------------------*/
|
||||
connect(qApp, &QCoreApplication::aboutToQuit, this, &OpenRGBDialog2::handleAboutToQuit);
|
||||
|
||||
}
|
||||
|
||||
OpenRGBDialog2::~OpenRGBDialog2()
|
||||
|
|
@ -544,6 +549,15 @@ OpenRGBDialog2::~OpenRGBDialog2()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void OpenRGBDialog2::handleAboutToQuit()
|
||||
{
|
||||
QCloseEvent* closeEvent = new QCloseEvent;
|
||||
this->closeEvent(closeEvent);
|
||||
delete closeEvent;
|
||||
}
|
||||
|
||||
|
||||
void OpenRGBDialog2::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ signals:
|
|||
public slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void SetTrayIcon(bool tray_icon);
|
||||
void handleAboutToQuit();
|
||||
|
||||
private:
|
||||
const char* context = "Ui::OpenRGBDialog2";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue