diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-29 13:27:15 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-29 13:27:15 +0200 |
commit | 0eb4c01643c2cbfc59a7cd031ff7771592bbddf2 (patch) | |
tree | 7e5f61468c4ba6d4cec06394c0143649ec9189a7 /gui | |
parent | 948bd443b7dd42133df7ea90cbf5d7f22cafa3d4 (diff) |
gui/options-dialog: no need for non-RAII
Qt destructors deregister one component from another.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/options-dialog.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index ec304b20..188ebc0c 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -109,11 +109,11 @@ void OptionsDialog::bind_key(key_opts& kopts, QLabel* label) kopts.guid = ""; kopts.keycode = ""; QDialog d; - auto l = new QHBoxLayout; - l->setMargin(0); + QHBoxLayout l; + l.setMargin(0); KeyboardListener k; - l->addWidget(&k); - d.setLayout(l); + l.addWidget(&k); + d.setLayout(&l); d.setFixedSize(QSize(500, 300)); d.setWindowFlags(Qt::Dialog); d.setWindowModality(Qt::ApplicationModal); @@ -145,7 +145,6 @@ void OptionsDialog::bind_key(key_opts& kopts, QLabel* label) d.exec(); pause_keybindings(false); label->setText(kopts_to_string(kopts)); - delete l; } void OptionsDialog::doOK() |