mirror of
https://github.com/Skycoder42/QHotkey.git
synced 2026-11-19 12:49:58 +03:00
shutdown fail
This commit is contained in:
@@ -7,8 +7,8 @@ HotTestWidget::HotTestWidget(QWidget *parent) :
|
|||||||
hotkey_1(new QHotkey(this)),
|
hotkey_1(new QHotkey(this)),
|
||||||
hotkey_2(new QHotkey(this)),
|
hotkey_2(new QHotkey(this)),
|
||||||
hotkey_3(new QHotkey(this)),
|
hotkey_3(new QHotkey(this)),
|
||||||
hotkey_4(new QHotkey(NULL)),
|
hotkey_4(new QHotkey(this)),
|
||||||
hotkey_5(new QHotkey(NULL)),
|
hotkey_5(new QHotkey(this)),
|
||||||
thread4(new QThread(this)),
|
thread4(new QThread(this)),
|
||||||
thread5(new QThread(this)),
|
thread5(new QThread(this)),
|
||||||
testHotkeys()
|
testHotkeys()
|
||||||
@@ -198,12 +198,19 @@ void HotTestWidget::on_threadEnableCheckBox_clicked()
|
|||||||
Q_ASSERT(!this->hotkey_4->isRegistered());
|
Q_ASSERT(!this->hotkey_4->isRegistered());
|
||||||
Q_ASSERT(!this->hotkey_5->isRegistered());
|
Q_ASSERT(!this->hotkey_5->isRegistered());
|
||||||
|
|
||||||
|
this->hotkey_4->setParent(NULL);
|
||||||
this->hotkey_4->moveToThread(this->thread4);
|
this->hotkey_4->moveToThread(this->thread4);
|
||||||
|
this->hotkey_5->setParent(NULL);
|
||||||
this->hotkey_5->moveToThread(this->thread5);
|
this->hotkey_5->moveToThread(this->thread5);
|
||||||
|
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
Q_ASSERT(this->hotkey_4->thread() == this->thread4);
|
Q_ASSERT(this->hotkey_4->thread() == this->thread4);
|
||||||
Q_ASSERT(this->hotkey_5->thread() == this->thread5);
|
Q_ASSERT(this->hotkey_5->thread() == this->thread5);
|
||||||
|
|
||||||
|
connect(this->thread4, &QThread::finished,
|
||||||
|
this->hotkey_4, &QHotkey::deleteLater);
|
||||||
|
connect(this->thread5, &QThread::finished,
|
||||||
|
this->hotkey_5, &QHotkey::deleteLater);
|
||||||
|
|
||||||
this->ui->tabWidget->setCurrentIndex(0);
|
this->ui->tabWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user