Changed code to use QSignalMapper.mappedInt signal if that is available.

Thu, 04 Mar 2021 17:44:41 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 04 Mar 2021 17:44:41 +0100
changeset 8150
fc1ae39af8c9
parent 8149
3fefc0c430f2
child 8151
8c1445825e7b

Changed code to use QSignalMapper.mappedInt signal if that is available.

eric6/Graphics/UMLGraphicsView.py file | annotate | diff | comparison | revisions
eric6/IconEditor/IconEditorWindow.py file | annotate | diff | comparison | revisions
eric6/QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
eric6/QScintilla/ShellWindow.py file | annotate | diff | comparison | revisions
eric6/ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
--- a/eric6/Graphics/UMLGraphicsView.py	Thu Mar 04 17:43:11 2021 +0100
+++ b/eric6/Graphics/UMLGraphicsView.py	Thu Mar 04 17:44:41 2021 +0100
@@ -74,7 +74,11 @@
         Private method to initialize the view actions.
         """
         self.alignMapper = QSignalMapper(self)
-        self.alignMapper.mapped[int].connect(self.__alignShapes)
+        try:
+            self.alignMapper.mappedInt.connect(self.__alignShapes)
+        except AttributeError:
+            # pre Qt 5.15
+            self.alignMapper.mapped[int].connect(self.__alignShapes)
         
         self.deleteShapeAct = QAction(
             UI.PixmapCache.getIcon("deleteShape"),
--- a/eric6/IconEditor/IconEditorWindow.py	Thu Mar 04 17:43:11 2021 +0100
+++ b/eric6/IconEditor/IconEditorWindow.py	Thu Mar 04 17:44:41 2021 +0100
@@ -558,7 +558,11 @@
         Private method to create the View actions.
         """
         self.esm = QSignalMapper(self)
-        self.esm.mapped[int].connect(self.__editor.setTool)
+        try:
+            self.esm.mappedInt.connect(self.__editor.setTool)
+        except AttributeError:
+            # pre Qt 5.15
+            self.esm.mapped[int].connect(self.__editor.setTool)
         
         self.drawingActGrp = createActionGroup(self)
         self.drawingActGrp.setExclusive(True)
--- a/eric6/QScintilla/MiniEditor.py	Thu Mar 04 17:43:11 2021 +0100
+++ b/eric6/QScintilla/MiniEditor.py	Thu Mar 04 17:44:41 2021 +0100
@@ -765,7 +765,11 @@
         ####################################################################
         
         self.esm = QSignalMapper(self)
-        self.esm.mapped[int].connect(self.__textEdit.editorCommand)
+        try:
+            self.esm.mappedInt.connect(self.__textEdit.editorCommand)
+        except AttributeError:
+            # pre Qt 5.15
+            self.esm.mapped[int].connect(self.__textEdit.editorCommand)
         
         self.editorActGrp = createActionGroup(self)
         
--- a/eric6/QScintilla/ShellWindow.py	Thu Mar 04 17:43:11 2021 +0100
+++ b/eric6/QScintilla/ShellWindow.py	Thu Mar 04 17:44:41 2021 +0100
@@ -351,7 +351,11 @@
         ####################################################################
         
         self.esm = QSignalMapper(self)
-        self.esm.mapped[int].connect(self.__shell.editorCommand)
+        try:
+            self.esm.mappedInt.connect(self.__shell.editorCommand)
+        except AttributeError:
+            # pre Qt 5.15
+            self.esm.mapped[int].connect(self.__shell.editorCommand)
         
         self.editorActGrp = createActionGroup(self)
         
--- a/eric6/ViewManager/ViewManager.py	Thu Mar 04 17:43:11 2021 +0100
+++ b/eric6/ViewManager/ViewManager.py	Thu Mar 04 17:44:41 2021 +0100
@@ -1446,7 +1446,11 @@
         ####################################################################
         
         self.esm = QSignalMapper(self)
-        self.esm.mapped[int].connect(self.__editorCommand)
+        try:
+            self.alignMapper.mappedInt.connect(self.__editorCommand)
+        except AttributeError:
+            # pre Qt 5.15
+            self.esm.mapped[int].connect(self.__editorCommand)
         
         self.editorActGrp = createActionGroup(self.editActGrp)
         

eric ide

mercurial