diff options
| author | 2011-07-25 09:42:47 +0000 | |
|---|---|---|
| committer | 2011-07-25 09:42:47 +0000 | |
| commit | 8018b4370223105f6ef2cffa67979609fcd77a09 (patch) | |
| tree | 6a7b65c00a5248659eb2f315f04244f3002700ff /src/modules/objects/KvsObject_popupMenu.cpp | |
| parent | crypto engines now use the mose secure CBC mode by default; ECB mode is avail... (diff) | |
| download | KVIrc-8018b4370223105f6ef2cffa67979609fcd77a09.tar.gz KVIrc-8018b4370223105f6ef2cffa67979609fcd77a09.tar.bz2 KVIrc-8018b4370223105f6ef2cffa67979609fcd77a09.zip | |
fixed popupmenu's highlightedEvent parameter value
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5915 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/KvsObject_popupMenu.cpp')
| -rw-r--r-- | src/modules/objects/KvsObject_popupMenu.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/objects/KvsObject_popupMenu.cpp b/src/modules/objects/KvsObject_popupMenu.cpp index 39e6ebeea..668caad35 100644 --- a/src/modules/objects/KvsObject_popupMenu.cpp +++ b/src/modules/objects/KvsObject_popupMenu.cpp @@ -76,7 +76,7 @@ This function is called when a menu item and return the the item id.[br] The default implementation emits the [classfnc]$activated[/classfnc]() signal. !fn: $highligthtedEvent(<popup_id:uinteger>) - This function is called when a menu item is highlighted and return the item id.[br] + This function is called when a menu item is highlighted (hovered) and return the item id.[br] The default implementation emits the [classfnc]$highlighted[/classfnc]() signal. @signals: !sg: $activated() @@ -225,7 +225,7 @@ bool KvsObject_popupMenu::init(KviKvsRunTimeContext *,KviKvsVariantList *) SET_OBJECT(QMenu) connect(widget(),SIGNAL(triggered(QAction *)),this,SLOT(slottriggered(QAction *))); connect(widget(),SIGNAL(destroyed(QObject *)),this,SLOT(aboutToDie(QObject *))); - connect(widget(),SIGNAL(highlighted(int)),this,SLOT(slothighlighted(int))); + connect(widget(),SIGNAL(hovered(QAction *)),this,SLOT(slothovered(QAction *))); return true; } @@ -362,9 +362,15 @@ KVSO_CLASS_FUNCTION(popupMenu,insertSeparator) return true; } -void KvsObject_popupMenu::slothighlighted(int i) +void KvsObject_popupMenu::slothovered(QAction *a) { - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)i)); + QHashIterator<int, QAction *> i(actionsDict); + while (i.hasNext()) + { + i.next(); + if (i.value()== a) break; + } + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)i.key())); callFunction(this,"highlightedEvent",¶ms); } void KvsObject_popupMenu::aboutToDie(QObject *pObject) |
