From 95524b76e28471b44b52148837cb5bdb7fdf207b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 2 Nov 2017 12:19:56 +0100 Subject: tracker/test: fix "abort" not crashing the app --- tracker-test/test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tracker-test/test.cpp') 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())); -- cgit v1.2.3