E5Gui/E5ModelMenu.py

changeset 482
4650a72c307a
parent 461
34528aaedf1c
child 791
9ec2ac20e54e
--- a/E5Gui/E5ModelMenu.py	Tue Aug 10 13:15:03 2010 +0200
+++ b/E5Gui/E5ModelMenu.py	Tue Aug 10 14:17:54 2010 +0200
@@ -16,8 +16,10 @@
     """
     Class implementing a menu populated from a QAbstractItemModel.
     
-    @signal activated(const QModelIndex&) emitted when an action has been triggered
+    @signal activated(QModelIndex) emitted when an action has been triggered
     """
+    activated = pyqtSignal(QModelIndex)
+    
     def __init__(self, parent = None):
         """
         Constructor
@@ -43,7 +45,7 @@
         self.__dropIndex = None
         
         self.aboutToShow.connect(self.__aboutToShow)
-        self.connect(self, SIGNAL("triggered(QAction*)"), self.__actionTriggered)
+        self.triggered.connect(self.__actionTriggered)
     
     def prePopulated(self):
         """
@@ -192,8 +194,7 @@
             title = parent.data()
             modelMenu = self.createBaseMenu()
             # triggered goes all the way up the menu structure
-            self.disconnect(modelMenu, SIGNAL("triggered(QAction*)"), 
-                            modelMenu.__actionTriggered)
+            modelMenu.triggered.disconnect(modelMenu.__actionTriggered)
             modelMenu.setTitle(title)
             
             icon = parent.data(Qt.DecorationRole)
@@ -268,7 +269,7 @@
         """
         idx = self.index(action)
         if idx.isValid():
-            self.emit(SIGNAL("activated(const QModelIndex&)"), idx)
+            self.activated[QModelIndex].emit(idx)
     
     def index(self, action):
         """

eric ide

mercurial