Continued porting eric5 to PyQt5.

Thu, 03 Jul 2014 19:41:23 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 03 Jul 2014 19:41:23 +0200
changeset 3664
78e522719af3
parent 3663
83e22cb3b312
child 3667
c9694cc027be

Continued porting eric5 to PyQt5.

Debugger/VariablesFilterDialog.py file | annotate | diff | comparison | revisions
Debugger/VariablesViewer.py file | annotate | diff | comparison | revisions
Helpviewer/Download/DownloadItem.py file | annotate | diff | comparison | revisions
Preferences/ProgramsDialog.py file | annotate | diff | comparison | revisions
Snapshot/SnapWidget.py file | annotate | diff | comparison | revisions
--- a/Debugger/VariablesFilterDialog.py	Thu Jul 03 19:02:29 2014 +0200
+++ b/Debugger/VariablesFilterDialog.py	Thu Jul 03 19:41:23 2014 +0200
@@ -50,10 +50,10 @@
                 
         for filterIndex in lDefaultFilter:
             itm = self.localsList.item(filterIndex)
-            self.localsList.setItemSelected(itm, True)
+            itm.setSelected(True)
         for filterIndex in gDefaultFilter:
             itm = self.globalsList.item(filterIndex)
-            self.globalsList.setItemSelected(itm, True)
+            itm.setSelected(True)
 
     def getSelection(self):
         """
@@ -83,10 +83,10 @@
         """
         for filterIndex in lList:
             itm = self.localsList.item(filterIndex)
-            self.localsList.setItemSelected(itm, True)
+            itm.setSelected(True)
         for filterIndex in gList:
             itm = self.globalsList.item(filterIndex)
-            self.globalsList.setItemSelected(itm, True)
+            itm.setSelected(True)
 
     def on_buttonBox_clicked(self, button):
         """
--- a/Debugger/VariablesViewer.py	Thu Jul 03 19:02:29 2014 +0200
+++ b/Debugger/VariablesViewer.py	Thu Jul 03 19:41:23 2014 +0200
@@ -451,7 +451,7 @@
                 citm = self.__findItem(self.curpathlist, 0)
                 if citm:
                     self.setCurrentItem(citm)
-                    self.setItemSelected(citm, True)
+                    citm.setSelected(True)
                     self.scrollToItem(citm, QAbstractItemView.PositionAtTop)
                     self.current = None
             
@@ -502,7 +502,7 @@
             citm = self.__findItem(self.curpathlist, 0)
             if citm:
                 self.setCurrentItem(citm)
-                self.setItemSelected(citm, True)
+                citm.setSelected(True)
                 if self.__scrollToItem:
                     self.scrollToItem(self.__scrollToItem,
                                       QAbstractItemView.PositionAtTop)
--- a/Helpviewer/Download/DownloadItem.py	Thu Jul 03 19:02:29 2014 +0200
+++ b/Helpviewer/Download/DownloadItem.py	Thu Jul 03 19:41:23 2014 +0200
@@ -14,7 +14,7 @@
     pass
 
 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QTime, QFile, QFileInfo, \
-    QUrl, QIODevice, QCryptographicHash
+    QUrl, QIODevice, QCryptographicHash, QStandardPaths
 from PyQt5.QtGui import QPalette, QDesktopServices
 from PyQt5.QtWidgets import QWidget, QStyle, QDialog
 from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply
@@ -210,8 +210,8 @@
                 return
             
             self.__autoOpen = dlg.getAction() == "open"
-            fileName = QDesktopServices.storageLocation(
-                QDesktopServices.TempLocation) + \
+            fileName = QStandardPaths.storageLocation(
+                QStandardPaths.TempLocation) + \
                 '/' + QFileInfo(fileName).completeBaseName()
         
         if ask and not self.__autoOpen and self.__requestFilename:
--- a/Preferences/ProgramsDialog.py	Thu Jul 03 19:02:29 2014 +0200
+++ b/Preferences/ProgramsDialog.py	Thu Jul 03 19:41:23 2014 +0200
@@ -133,19 +133,19 @@
             self.tr("Qt Assistant"), exe, version=version)
         
         # 2. do the PyQt programs
-        # 2a. Translation Extractor PyQt5
+        # 2a. Translation Extractor PyQt4
         self.__createProgramEntry(
-            self.tr("Translation Extractor (Python, PyQt5)"),
+            self.tr("Translation Extractor (Python, PyQt4)"),
             Utilities.isWindowsPlatform() and "pylupdate4.exe" or "pylupdate4",
             '-version', 'pylupdate', -1)
-        # 2b. Forms Compiler PyQt5
+        # 2b. Forms Compiler PyQt4
         self.__createProgramEntry(
-            self.tr("Forms Compiler (Python, PyQt5)"),
+            self.tr("Forms Compiler (Python, PyQt4)"),
             Utilities.isWindowsPlatform() and "pyuic4.bat" or "pyuic4",
             '--version', 'Python User', 4)
-        # 2c. Resource Compiler PyQt5
+        # 2c. Resource Compiler PyQt4
         self.__createProgramEntry(
-            self.tr("Resource Compiler (Python, PyQt5)"),
+            self.tr("Resource Compiler (Python, PyQt4)"),
             Utilities.isWindowsPlatform() and "pyrcc4.exe" or "pyrcc4",
             '-version', 'Resource Compiler', -1)
         # 2d. Translation Extractor PyQt5
--- a/Snapshot/SnapWidget.py	Thu Jul 03 19:02:29 2014 +0200
+++ b/Snapshot/SnapWidget.py	Thu Jul 03 19:41:23 2014 +0200
@@ -16,9 +16,8 @@
 import os
 
 from PyQt5.QtCore import pyqtSlot, QFile, QFileInfo, QTimer, QPoint, \
-    QMimeData, Qt, QEvent, QRegExp, qVersion
-from PyQt5.QtGui import QImageWriter, QPixmap, QCursor, QDrag, QKeySequence, \
-    QDesktopServices
+    QMimeData, Qt, QEvent, QRegExp, qVersion, QStandardPaths
+from PyQt5.QtGui import QImageWriter, QPixmap, QCursor, QDrag, QKeySequence
 from PyQt5.QtWidgets import QWidget, QApplication, QShortcut
 
 from E5Gui import E5FileDialog, E5MessageBox
@@ -63,7 +62,7 @@
                                SnapWidget.ModeEllipse)
         self.modeCombo.addItem(self.tr("Freehand Selection"),
                                SnapWidget.ModeFreehand)
-        if QApplication.desktop().numScreens() > 1:
+        if QApplication.desktop().screenCount() > 1:
             self.modeCombo.addItem(self.tr("Current Screen"),
                                    SnapWidget.ModeScreen)
         self.__mode = int(Preferences.Prefs.settings.value("Snapshot/Mode", 0))
@@ -79,8 +78,8 @@
         self.__filename = Preferences.Prefs.settings.value(
             "Snapshot/Filename",
             os.path.join(
-                QDesktopServices.storageLocation(
-                    QDesktopServices.PicturesLocation),
+                QStandardPaths.writableLocation(
+                    QStandardPaths.PicturesLocation),
                 self.tr("snapshot") + "1.png"))
         
         self.__grabber = None

eric ide

mercurial