using Qt::UniqueConnection

This commit is contained in:
Uwe Rathmann 2018-02-15 09:48:14 +01:00
parent 217c722e71
commit d58732d5ac

View File

@ -136,8 +136,8 @@ int QskShortcutHandler::insert(
{ {
if ( receiver ) if ( receiver )
{ {
receiver->disconnect( this ); connect( receiver, &QObject::destroyed,
connect( receiver, &QObject::destroyed, this, &QskShortcutHandler::cleanUp ); this, &QskShortcutHandler::cleanUp, Qt::UniqueConnection );
} }
int id = 0; int id = 0;
@ -148,8 +148,8 @@ int QskShortcutHandler::insert(
{ {
if ( item != receiver ) if ( item != receiver )
{ {
item->disconnect( this ); connect( item, &QObject::destroyed,
connect( item, &QObject::destroyed, this, &QskShortcutHandler::cleanUp ); this, &QskShortcutHandler::cleanUp, Qt::UniqueConnection );
} }
id = map->addShortcut( item, sequence, Qt::WindowShortcut, qskContextMatcher ); id = map->addShortcut( item, sequence, Qt::WindowShortcut, qskContextMatcher );