diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-12-06 06:15:19 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-12-06 06:15:19 +0100 |
commit | 2de0b6427d8d768771cf22686c1c3b65f15e2f40 (patch) | |
tree | 4dadc42b870932b225e3a6b151c7933c31196492 /gui | |
parent | aa593e0840783d1b38b0c812fd2f8120491ee296 (diff) |
gui/settings: don't forget to show a modal dialog before executing
Diffstat (limited to 'gui')
-rw-r--r-- | gui/options-dialog.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index 65407184..a7efdb75 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -99,18 +99,18 @@ void OptionsDialog::bind_key(key_opts& kopts, QLabel* label) QDialog d; auto l = new QHBoxLayout; l->setMargin(0); - auto k = new KeyboardListener; - l->addWidget(k); + KeyboardListener k; + l->addWidget(&k); d.setLayout(l); d.setFixedSize(QSize(500, 300)); d.setWindowFlags(Qt::Dialog); - connect(k, &KeyboardListener::key_pressed, [&] (QKeySequence s) -> void { + connect(&k, &KeyboardListener::key_pressed, [&] (QKeySequence s) -> void { kopts.keycode = s.toString(QKeySequence::PortableText); kopts.guid = ""; kopts.button = -1; d.close(); }); - connect(k, &KeyboardListener::joystick_button_pressed, [&](QString guid, int idx, bool held) -> void { + connect(&k, &KeyboardListener::joystick_button_pressed, [&](QString guid, int idx, bool held) -> void { if (!held) { kopts.guid = guid; @@ -120,11 +120,11 @@ void OptionsDialog::bind_key(key_opts& kopts, QLabel* label) } }); pause_keybindings(true); + d.show(); d.exec(); pause_keybindings(false); register_global_keys(); label->setText(kopts_to_string(kopts)); - delete k; delete l; } |