Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardCharactersDialog.py

changeset 6116
f3d3c996c193
parent 6048
82ad8ec9548c
child 6645
ad476851d7e0
diff -r ac3a98f3ebc2 -r f3d3c996c193 Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardCharactersDialog.py
--- a/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardCharactersDialog.py	Mon Feb 05 19:15:47 2018 +0100
+++ b/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardCharactersDialog.py	Mon Feb 05 19:59:18 2018 +0100
@@ -158,8 +158,10 @@
         hboxLayout.addWidget(le2)
         self.singlesItemsBoxLayout.addWidget(hbox)
         
-        cb1.activated[int].connect(self.__singlesCharTypeSelected)
-        cb2.activated[int].connect(self.__singlesCharTypeSelected)
+        cb1.activated[int].connect(
+            lambda i: self.__singlesCharTypeSelected(i, cb1))
+        cb2.activated[int].connect(
+            lambda i: self.__singlesCharTypeSelected(i, cb2))
         hbox.show()
         
         self.singlesItemsBox.adjustSize()
@@ -192,7 +194,8 @@
         hboxLayout.addWidget(le2)
         self.rangesItemsBoxLayout.addWidget(hbox)
         
-        cb1.activated[int].connect(self.__rangesCharTypeSelected)
+        cb1.activated[int].connect(
+            lambda i: self.__rangesCharTypeSelected(i, cb1))
         
         hbox.show()
         
@@ -219,27 +222,31 @@
             lineedit.setEnabled(False)
         lineedit.clear()
         
-    def __singlesCharTypeSelected(self, index):
+    def __singlesCharTypeSelected(self, index, combo):
         """
         Private slot to handle the activated(int) signal of the single chars
         combo boxes.
         
-        @param index selected list index (integer)
+        @param index selected list index
+        @type int
+        @param combo reference to the combo box
+        @type QComboBox
         """
-        combo = self.sender()
         for entriesList in self.singlesEntries:
             if combo == entriesList[0]:
                 self.__performSelectedAction(index, entriesList[1])
                 break
         
-    def __rangesCharTypeSelected(self, index):
+    def __rangesCharTypeSelected(self, index, combo):
         """
         Private slot to handle the activated(int) signal of the char ranges
         combo boxes.
         
-        @param index selected list index (integer)
+        @param index selected list index
+        @type int
+        @param combo reference to the combo box
+        @type QComboBox
         """
-        combo = self.sender()
         for entriesList in self.rangesEntries:
             if combo == entriesList[0]:
                 self.__performSelectedAction(index, entriesList[1])

eric ide

mercurial