Continued porting signal/slot usage to the new API.

Fri, 06 Aug 2010 12:55:39 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 06 Aug 2010 12:55:39 +0200
changeset 460
6a3899e91d76
parent 459
0021b759c805
child 461
34528aaedf1c

Continued porting signal/slot usage to the new API.

Debugger/BreakPointModel.py file | annotate | diff | comparison | revisions
Debugger/DebugServer.py file | annotate | diff | comparison | revisions
Debugger/WatchPointModel.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
--- a/Debugger/BreakPointModel.py	Fri Aug 06 12:40:21 2010 +0200
+++ b/Debugger/BreakPointModel.py	Fri Aug 06 12:55:39 2010 +0200
@@ -13,6 +13,8 @@
     """
     Class implementing a custom model for breakpoints.
     """
+    dataAboutToBeChanged = pyqtSignal(QModelIndex, QModelIndex)
+    
     def __init__(self, parent = None):
         """
         Constructor
@@ -180,15 +182,12 @@
             index1 = self.createIndex(row, 0, self.breakpoints[row])
             index2 = self.createIndex(row, len(self.breakpoints[row]), 
                      self.breakpoints[row])
-            self.emit(\
-                SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
-                index1, index2)
+            self.dataAboutToBeChanged.emit(index1, index2)
             i = 0
             for value in [fn, line] + list(properties):
                 self.breakpoints[row][i] = value
                 i += 1
-            self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
-                      index1, index2)
+            self.dataChanged.emit(index1, index2)
 
     def setBreakPointEnabledByIndex(self, index, enabled):
         """
@@ -201,12 +200,9 @@
             row = index.row()
             col = 4
             index1 = self.createIndex(row, col, self.breakpoints[row])
-            self.emit(\
-                SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
-                index1, index1)
+            self.dataAboutToBeChanged.emit(index1, index1)
             self.breakpoints[row][col] = enabled
-            self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
-                      index1, index1)
+            self.dataChanged.emit(index1, index1)
     
     def deleteBreakPointByIndex(self, index):
         """
--- a/Debugger/DebugServer.py	Fri Aug 06 12:40:21 2010 +0200
+++ b/Debugger/DebugServer.py	Fri Aug 06 12:55:39 2010 +0200
@@ -131,31 +131,17 @@
         self.connect(self, SIGNAL("clientClearWatch"), self.__clientClearWatchPoint)
         self.connect(self, SIGNAL("newConnection()"), self.__newConnection)
         
-        self.connect(self.breakpointModel, 
-            SIGNAL("rowsAboutToBeRemoved(const QModelIndex &, int, int)"), 
-            self.__deleteBreakPoints)
-        self.connect(self.breakpointModel,
-            SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
+        self.breakpointModel.rowsAboutToBeRemoved.connect(self.__deleteBreakPoints)
+        self.breakpointModel.dataAboutToBeChanged.connect(
             self.__breakPointDataAboutToBeChanged)
-        self.connect(self.breakpointModel,
-            SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
-            self.__changeBreakPoints)
-        self.connect(self.breakpointModel,
-            SIGNAL("rowsInserted(const QModelIndex &, int, int)"),
-            self.__addBreakPoints)
+        self.breakpointModel.dataChanged.connect(self.__changeBreakPoints)
+        self.breakpointModel.rowsInserted.connect(self.__addBreakPoints)
         
-        self.connect(self.watchpointModel, 
-            SIGNAL("rowsAboutToBeRemoved(const QModelIndex &, int, int)"), 
-            self.__deleteWatchPoints)
-        self.connect(self.watchpointModel,
-            SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
+        self.watchpointModel.rowsAboutToBeRemoved.connect(self.__deleteWatchPoints)
+        self.watchpointModel.dataAboutToBeChanged.connect(
             self.__watchPointDataAboutToBeChanged)
-        self.connect(self.watchpointModel, 
-            SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
-            self.__changeWatchPoints)
-        self.connect(self.watchpointModel,
-            SIGNAL("rowsInserted(const QModelIndex &, int, int)"),
-            self.__addWatchPoints)
+        self.watchpointModel.dataChanged.connect(self.__changeWatchPoints)
+        self.watchpointModel.rowsInserted.connect(self.__addWatchPoints)
         
         self.__registerDebuggerInterfaces()
         
--- a/Debugger/WatchPointModel.py	Fri Aug 06 12:40:21 2010 +0200
+++ b/Debugger/WatchPointModel.py	Fri Aug 06 12:55:39 2010 +0200
@@ -13,6 +13,8 @@
     """
     Class implementing a custom model for watch expressions.
     """
+    dataAboutToBeChanged = pyqtSignal(QModelIndex, QModelIndex)
+    
     def __init__(self, parent = None):
         """
         Constructor
@@ -175,15 +177,12 @@
             index1 = self.createIndex(row, 0, self.watchpoints[row])
             index2 = self.createIndex(row, len(self.watchpoints[row]), 
                      self.watchpoints[row])
-            self.emit(\
-                SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
-                index1, index2)
+            self.dataAboutToBeChanged.emit(index1, index2)
             i = 0
             for value in [cond, special] + list(properties):
                 self.watchpoints[row][i] = value
                 i += 1
-            self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
-                      index1, index2)
+            self.dataChanged.emit(index1, index2)
 
     def setWatchPointEnabledByIndex(self, index, enabled):
         """
@@ -196,12 +195,9 @@
             row = index.row()
             col = 3
             index1 = self.createIndex(row, col, self.watchpoints[row])
-            self.emit(\
-                SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
-                index1, index1)
+            self.dataAboutToBeChanged.emit(index1, index1)
             self.watchpoints[row][col] = enabled
-            self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
-                      index1, index1)
+            self.dataChanged.emit(index1, index1)
     
     def deleteWatchPointByIndex(self, index):
         """
--- a/QScintilla/Editor.py	Fri Aug 06 12:40:21 2010 +0200
+++ b/QScintilla/Editor.py	Fri Aug 06 12:55:39 2010 +0200
@@ -366,17 +366,13 @@
         # breakpoint handling
         self.breakpointModel = self.dbs.getBreakPointModel()
         self.__restoreBreakpoints()
-        self.connect(self.breakpointModel, 
-            SIGNAL("rowsAboutToBeRemoved(const QModelIndex &, int, int)"), 
+        self.breakpointModel.rowsAboutToBeRemoved.connect(
             self.__deleteBreakPoints)
-        self.connect(self.breakpointModel,
-            SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
+        self.breakpointModel.dataAboutToBeChanged.connect(
             self.__breakPointDataAboutToBeChanged)
-        self.connect(self.breakpointModel,
-            SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
+        self.breakpointModel.dataChanged.connect(
             self.__changeBreakPoints)
-        self.connect(self.breakpointModel,
-            SIGNAL("rowsInserted(const QModelIndex &, int, int)"),
+        self.breakpointModel.rowsInserted.connect(
             self.__addBreakPoints)
         self.connect(self, SIGNAL("linesChanged()"), self.__linesChanged)
         
@@ -4723,17 +4719,13 @@
             self.removeClone(clone)
             clone.removeClone(self)
         
-        self.disconnect(self.breakpointModel, 
-            SIGNAL("rowsAboutToBeRemoved(const QModelIndex &, int, int)"), 
+        self.breakpointModel.rowsAboutToBeRemoved.disconnect(
             self.__deleteBreakPoints)
-        self.disconnect(self.breakpointModel,
-            SIGNAL("dataAboutToBeChanged(const QModelIndex &, const QModelIndex &)"),
+        self.breakpointModel.dataAboutToBeChanged.disconnect(
             self.__breakPointDataAboutToBeChanged)
-        self.disconnect(self.breakpointModel,
-            SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"),
+        self.breakpointModel.dataChanged.disconnect(
             self.__changeBreakPoints)
-        self.disconnect(self.breakpointModel,
-            SIGNAL("rowsInserted(const QModelIndex &, int, int)"),
+        self.breakpointModel.rowsInserted.disconnect(
             self.__addBreakPoints)
         
         self.disconnect(self.project, SIGNAL("projectPropertiesChanged"), 

eric ide

mercurial