diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-11-02 12:19:56 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-11-02 12:19:56 +0100 |
commit | 95524b76e28471b44b52148837cb5bdb7fdf207b (patch) | |
tree | fa75c5346cb2b3e27d81668a3c45b695ed0d038b | |
parent | 1e658e9b594486c1fa04e438dc7ce88a2ed87222 (diff) |
tracker/test: fix "abort" not crashing the app
-rw-r--r-- | tracker-test/test.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tracker-test/test.cpp b/tracker-test/test.cpp index 86ad4495..c662051e 100644 --- a/tracker-test/test.cpp +++ b/tracker-test/test.cpp @@ -77,7 +77,10 @@ test_dialog::test_dialog() { ui.setupUi(this); - connect(ui.buttonBox->button(QDialogButtonBox::Abort), &QPushButton::clicked, []() { *(volatile int*)0 = 0; }); + connect(ui.buttonBox, &QDialogButtonBox::clicked, [this](QAbstractButton* btn) { + if (btn == ui.buttonBox->button(QDialogButtonBox::Abort)) + *(volatile int*)0 = 0; + }); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); |