diff --git a/libk3b/tools/k3bmultichoicedialog.cpp b/libk3b/tools/k3bmultichoicedialog.cpp --- a/libk3b/tools/k3bmultichoicedialog.cpp +++ b/libk3b/tools/k3bmultichoicedialog.cpp @@ -17,7 +17,6 @@ #include -#include #include #include #include @@ -31,11 +30,9 @@ { public: Private() - : mapper(0), - buttonLayout(0) { + : buttonLayout(0) { } - QSignalMapper* mapper; QList buttons; QHBoxLayout* buttonLayout; @@ -82,8 +79,6 @@ : QDialog( parent ) { d = new Private(); - d->mapper = new QSignalMapper( this ); - connect( d->mapper, SIGNAL(mapped(int)), this, SLOT(done(int)) ); setWindowTitle( caption ); @@ -127,9 +122,9 @@ KGuiItem::assign( button, b ); d->buttonLayout->addWidget( button ); d->buttons.append(button); - d->mapper->setMapping( button, d->buttons.count() ); - connect( button, SIGNAL(clicked()), d->mapper, SLOT(map()) ); - return d->buttons.count(); + const auto buttonId = d->buttons.count(); + connect( button, &QAbstractButton::clicked, this, [this, buttonId]() { done(buttonId); } ); + return buttonId; }