From 0eb4c01643c2cbfc59a7cd031ff7771592bbddf2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 29 Jun 2016 13:27:15 +0200 Subject: gui/options-dialog: no need for non-RAII Qt destructors deregister one component from another. --- gui/options-dialog.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gui') 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() -- cgit v1.2.3