Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().

Sun, 03 Jan 2021 15:33:39 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 03 Jan 2021 15:33:39 +0100
changeset 7945
76daafe10009
parent 7941
cf988a30ba47
child 7946
6901746220fc

Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().

eric6/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.Debugger.DebugUI.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.Project.ProjectTranslationsBrowser.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.WebBrowser.WebBrowserView.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.WebBrowser.WebInspector.html file | annotate | diff | comparison | revisions
eric6/E5Gui/E5PassivePopup.py file | annotate | diff | comparison | revisions
eric6/E5Network/E5SslInfoWidget.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/NotificationsPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/WebBrowserAppearancePage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/WebBrowserPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/WebBrowserPage.ui file | annotate | diff | comparison | revisions
eric6/Preferences/__init__.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapWidget.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotDefaultGrabber.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotFreehandGrabber.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotRegionGrabber.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotTimer.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotWaylandGrabber.py file | annotate | diff | comparison | revisions
eric6/UI/FindFileDialog.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/QtHelp/HelpDocsInstaller.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/StatusBar/JavaScriptSettingsDialog.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/WebBrowserView.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/WebInspector.py file | annotate | diff | comparison | revisions
eric6/eric6_browser.py file | annotate | diff | comparison | revisions
--- a/eric6/Debugger/DebugUI.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Debugger/DebugUI.py	Sun Jan 03 15:33:39 2021 +0100
@@ -163,7 +163,7 @@
         """
         Public method to show some notification message.
         
-        @param notification meessage to be shown
+        @param notification message to be shown
         @type str
         """
         if self.ui.notificationsEnabled():
Binary file eric6/Documentation/Help/source.qch has changed
--- a/eric6/Documentation/Help/source.qhp	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Documentation/Help/source.qhp	Sun Jan 03 15:33:39 2021 +0100
@@ -16919,7 +16919,6 @@
       <keyword name="WebInspector" id="WebInspector" ref="eric6.WebBrowser.WebInspector.html#WebInspector" />
       <keyword name="WebInspector (Constructor)" id="WebInspector (Constructor)" ref="eric6.WebBrowser.WebInspector.html#WebInspector.__init__" />
       <keyword name="WebInspector (Module)" id="WebInspector (Module)" ref="eric6.WebBrowser.WebInspector.html" />
-      <keyword name="WebInspector.__inspectorReplyFinished" id="WebInspector.__inspectorReplyFinished" ref="eric6.WebBrowser.WebInspector.html#WebInspector.__inspectorReplyFinished" />
       <keyword name="WebInspector.__loadFinished" id="WebInspector.__loadFinished" ref="eric6.WebBrowser.WebInspector.html#WebInspector.__loadFinished" />
       <keyword name="WebInspector.__reloadGeometry" id="WebInspector.__reloadGeometry" ref="eric6.WebBrowser.WebInspector.html#WebInspector.__reloadGeometry" />
       <keyword name="WebInspector.closeEvent" id="WebInspector.closeEvent" ref="eric6.WebBrowser.WebInspector.html#WebInspector.closeEvent" />
--- a/eric6/Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html	Sun Jan 03 15:33:39 2021 +0100
@@ -424,7 +424,7 @@
 </p>
 <dl>
 
-<dt><i>var</i> (list of strings)</dt>
+<dt><i>var</i> (list of str)</dt>
 <dd>
 list encoded name of the requested variable
 </dd>
--- a/eric6/Documentation/Source/eric6.Debugger.DebugUI.html	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Documentation/Source/eric6.Debugger.DebugUI.html	Sun Jan 03 15:33:39 2021 +0100
@@ -1563,7 +1563,7 @@
 
 <dt><i>notification</i> (str)</dt>
 <dd>
-meessage to be shown
+message to be shown
 </dd>
 </dl>
 <a NAME="DebugUI.shutdown" ID="DebugUI.shutdown"></a>
--- a/eric6/Documentation/Source/eric6.Project.ProjectTranslationsBrowser.html	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Documentation/Source/eric6.Project.ProjectTranslationsBrowser.html	Sun Jan 03 15:33:39 2021 +0100
@@ -353,13 +353,17 @@
 </dl>
 <a NAME="ProjectTranslationsBrowser.__generateTSFileDone" ID="ProjectTranslationsBrowser.__generateTSFileDone"></a>
 <h4>ProjectTranslationsBrowser.__generateTSFileDone</h4>
-<b>__generateTSFileDone</b>(<i>exitCode, exitStatus, proc</i>)
+<b>__generateTSFileDone</b>(<i>proc, exitCode, exitStatus</i>)
 
 <p>
         Private slot to handle the finished signal of the pylupdate process.
 </p>
 <dl>
 
+<dt><i>proc</i> (QProcess)</dt>
+<dd>
+reference to the process
+</dd>
 <dt><i>exitCode</i> (int)</dt>
 <dd>
 exit code of the process
@@ -368,10 +372,6 @@
 <dd>
 exit status of the process
 </dd>
-<dt><i>proc</i> (QProcess)</dt>
-<dd>
-reference to the process
-</dd>
 </dl>
 <a NAME="ProjectTranslationsBrowser.__openFileInEditor" ID="ProjectTranslationsBrowser.__openFileInEditor"></a>
 <h4>ProjectTranslationsBrowser.__openFileInEditor</h4>
@@ -507,13 +507,17 @@
 </dl>
 <a NAME="ProjectTranslationsBrowser.__releaseTSFileDone" ID="ProjectTranslationsBrowser.__releaseTSFileDone"></a>
 <h4>ProjectTranslationsBrowser.__releaseTSFileDone</h4>
-<b>__releaseTSFileDone</b>(<i>exitCode, exitStatus, proc</i>)
+<b>__releaseTSFileDone</b>(<i>proc, exitCode, exitStatus</i>)
 
 <p>
         Private slot to handle the finished signal of the lrelease process.
 </p>
 <dl>
 
+<dt><i>proc</i> (QProcess)</dt>
+<dd>
+reference to the process
+</dd>
 <dt><i>exitCode</i> (int)</dt>
 <dd>
 exit code of the process
@@ -522,10 +526,6 @@
 <dd>
 exit status of the process
 </dd>
-<dt><i>proc</i> (QProcess)</dt>
-<dd>
-reference to the process
-</dd>
 </dl>
 <a NAME="ProjectTranslationsBrowser.__removeLanguageFile" ID="ProjectTranslationsBrowser.__removeLanguageFile"></a>
 <h4>ProjectTranslationsBrowser.__removeLanguageFile</h4>
--- a/eric6/Documentation/Source/eric6.WebBrowser.WebBrowserView.html	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Documentation/Source/eric6.WebBrowser.WebBrowserView.html	Sun Jan 03 15:33:39 2021 +0100
@@ -1129,7 +1129,7 @@
 <b>__quotaRequested</b>(<i>quotaRequest</i>)
 
 <p>
-            Private slot to handle quota requests of the web page.
+        Private slot to handle quota requests of the web page.
 </p>
 <dl>
 
@@ -1231,14 +1231,14 @@
 <b>__selectClientCertificate</b>(<i>clientCertificateSelection</i>)
 
 <p>
-            Private slot to handle the client certificate selection request.
+        Private slot to handle the client certificate selection request.
 </p>
 <dl>
 
 <dt><i>clientCertificateSelection</i> (QWebEngineClientCertificateSelection)</dt>
 <dd>
 list of client SSL certificates
-                found in system's client certificate store
+            found in system's client certificate store
 </dd>
 </dl>
 <a NAME="WebBrowserView.__sendLink" ID="WebBrowserView.__sendLink"></a>
--- a/eric6/Documentation/Source/eric6.WebBrowser.WebInspector.html	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Documentation/Source/eric6.WebBrowser.WebInspector.html	Sun Jan 03 15:33:39 2021 +0100
@@ -98,10 +98,6 @@
 <td>Constructor</td>
 </tr>
 <tr>
-<td><a href="#WebInspector.__inspectorReplyFinished">__inspectorReplyFinished</a></td>
-<td>Private slot handling the reply.</td>
-</tr>
-<tr>
 <td><a href="#WebInspector.__loadFinished">__loadFinished</a></td>
 <td>Private slot handling the finished signal.</td>
 </tr>
@@ -161,13 +157,6 @@
 reference to the parent widget
 </dd>
 </dl>
-<a NAME="WebInspector.__inspectorReplyFinished" ID="WebInspector.__inspectorReplyFinished"></a>
-<h4>WebInspector.__inspectorReplyFinished</h4>
-<b>__inspectorReplyFinished</b>(<i></i>)
-
-<p>
-        Private slot handling the reply.
-</p>
 <a NAME="WebInspector.__loadFinished" ID="WebInspector.__loadFinished"></a>
 <h4>WebInspector.__loadFinished</h4>
 <b>__loadFinished</b>(<i></i>)
--- a/eric6/E5Gui/E5PassivePopup.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/E5Gui/E5PassivePopup.py	Sun Jan 03 15:33:39 2021 +0100
@@ -11,8 +11,6 @@
 from PyQt5.QtCore import pyqtSignal, Qt, QTimer, QPoint, QRect
 from PyQt5.QtWidgets import QFrame, QVBoxLayout, QApplication
 
-from Globals import qVersionTuple
-
 
 class E5PassivePopup(QFrame):
     """
@@ -189,12 +187,7 @@
         w = self.minimumSizeHint().width()
         h = self.minimumSizeHint().height()
         
-        if qVersionTuple() >= (5, 10, 0):
-            r = (QApplication.screenAt(QPoint(x + w // 2, y + h // 2))
-                 .geometry())
-        else:
-            r = QApplication.desktop().screenGeometry(
-                QPoint(x + w // 2, y + h // 2))
+        r = QApplication.screenAt(QPoint(x + w // 2, y + h // 2)).geometry()
         
         if x < r.center().x():
             x += target.width()
--- a/eric6/E5Network/E5SslInfoWidget.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/E5Network/E5SslInfoWidget.py	Sun Jan 03 15:33:39 2021 +0100
@@ -155,14 +155,10 @@
                 sslVersion = "TLS 1.2"
                 imageLabel.setPixmap(
                     UI.PixmapCache.getPixmap("securityHigh32"))
-            try:
-                # Qt 5.12 and newer
-                if proto == QSsl.TlsV1_2:
-                    sslVersion = "TLS 1.2"
-                    imageLabel.setPixmap(
-                        UI.PixmapCache.getPixmap("securityHigh32"))
-            except AttributeError:
-                pass
+            elif proto == QSsl.TlsV1_3:
+                sslVersion = "TLS 1.3"
+                imageLabel.setPixmap(
+                    UI.PixmapCache.getPixmap("securityHigh32"))
             rows += 1
             
             label = QLabel(self)
--- a/eric6/Preferences/ConfigurationPages/NotificationsPage.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/NotificationsPage.py	Sun Jan 03 15:33:39 2021 +0100
@@ -16,8 +16,6 @@
 import Preferences
 import UI.PixmapCache
 
-from Globals import qVersionTuple
-
 
 class NotificationsPage(ConfigurationPageBase, Ui_NotificationsPage):
     """
@@ -33,27 +31,19 @@
         
         minX, maxX = self.xSpinBox.maximum(), self.xSpinBox.minimum()
         minY, maxY = self.ySpinBox.maximum(), self.ySpinBox.minimum()
-        if qVersionTuple() >= (5, 10, 0):
-            for screen in QApplication.screens():
-                geom = screen.availableGeometry()
-                minX = min(minX, geom.x())
-                maxX = max(maxX, geom.x() + geom.width())
-                minY = min(minY, geom.y())
-                maxY = max(maxY, geom.y() + geom.height())
-        else:
-            desk = QApplication.desktop()
-            for screen in range(desk.screenCount()):
-                geom = desk.availableGeometry(screen)
-                minX = min(minX, geom.x())
-                maxX = max(maxX, geom.x() + geom.width())
-                minY = min(minY, geom.y())
-                maxY = max(maxY, geom.y() + geom.height())
+        for screen in QApplication.screens():
+            geom = screen.availableGeometry()
+            minX = min(minX, geom.x())
+            maxX = max(maxX, geom.x() + geom.width())
+            minY = min(minY, geom.y())
+            maxY = max(maxY, geom.y() + geom.height())
         self.xSpinBox.setMinimum(minX)
         self.xSpinBox.setMaximum(maxX)
         self.ySpinBox.setMinimum(minY)
         self.ySpinBox.setMaximum(maxY)
         
         self.__notification = None
+        self.__firstTime = True
         
         # set initial values
         self.enableCheckBox.setChecked(
@@ -93,6 +83,13 @@
             self.__notification.move(
                 QPoint(self.xSpinBox.value(), self.ySpinBox.value()))
             self.__notification.show()
+            if self.__firstTime:
+                # adjust the maximum values to the width of the notification
+                self.xSpinBox.setMaximum(
+                    self.xSpinBox.maximum() - self.__notification.width())
+                self.ySpinBox.setMaximum(
+                    self.ySpinBox.maximum() - self.__notification.height())
+                self.__firstTime = False
         else:
             # retrieve the position
             point = self.__notification.frameGeometry().topLeft()
--- a/eric6/Preferences/ConfigurationPages/WebBrowserAppearancePage.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/WebBrowserAppearancePage.py	Sun Jan 03 15:33:39 2021 +0100
@@ -70,14 +70,9 @@
         self.fantasyFontCombo.setCurrentFont(
             QFont(Preferences.getWebBrowser("FantasyFontFamily"),
                   defaultFontSize, QFont.Normal, False))
-        try:
-            # Qt 5.7+
-            self.pictographFontCombo.setCurrentFont(
-                QFont(Preferences.getWebBrowser("PictographFontFamily"),
-                      defaultFontSize, QFont.Normal, False))
-        except KeyError:
-            self.pictographFontLabel.setEnabled(False)
-            self.pictographFontCombo.setEnabled(False)
+        self.pictographFontCombo.setCurrentFont(
+            QFont(Preferences.getWebBrowser("PictographFontFamily"),
+                  defaultFontSize, QFont.Normal, False))
         
         self.initColour("SecureUrlColor",
                         self.secureURLsColourButton,
@@ -101,12 +96,8 @@
         self.warnOnMultipleCloseCheckBox.setChecked(
             Preferences.getWebBrowser("WarnOnMultipleClose"))
         
-        try:
-            # Qt 5.10
-            self.scrollbarsCheckBox.setChecked(
-                Preferences.getWebBrowser("ShowScrollBars"))
-        except KeyError:
-            self.scrollbarsCheckBox.setEnabled(False)
+        self.scrollbarsCheckBox.setChecked(
+            Preferences.getWebBrowser("ShowScrollBars"))
         self.toolbarsCheckBox.setChecked(
             Preferences.getWebBrowser("ShowToolbars"))
     
--- a/eric6/Preferences/ConfigurationPages/WebBrowserPage.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/WebBrowserPage.py	Sun Jan 03 15:33:39 2021 +0100
@@ -12,8 +12,6 @@
 from .ConfigurationPageBase import ConfigurationPageBase
 from .Ui_WebBrowserPage import Ui_WebBrowserPage
 
-from Globals import qVersionTuple
-
 import UI.PixmapCache
 import Preferences
 
@@ -64,50 +62,27 @@
             Preferences.getWebBrowser("ScrollAnimatorEnabled"))
         self.fullscreenCheckBox.setChecked(
             Preferences.getWebBrowser("FullScreenSupportEnabled"))
-        try:
-            # Qt 5.7+
-            self.screenCaptureCheckBox.setChecked(
-                Preferences.getWebBrowser("ScreenCaptureEnabled"))
-            self.webGLCheckBox.setChecked(
-                Preferences.getWebBrowser("WebGLEnabled"))
-        except KeyError:
-            self.screenCaptureCheckBox.setEnabled(False)
-            self.webGLCheckBox.setEnabled(False)
-        try:
-            # Qt 5.11
-            self.autoplayMediaCheckBox.setChecked(
-                Preferences.getWebBrowser("PlaybackRequiresUserGesture"))
-            self.webRtcPublicOnlyCheckBox.setChecked(
-                Preferences.getWebBrowser("WebRTCPublicInterfacesOnly"))
-        except KeyError:
-            self.autoplayMediaCheckBox.setEnabled(False)
-            self.webRtcPublicOnlyCheckBox.setEnabled(False)
-        try:
-            # Qt 5.12
-            self.dnsPrefetchCheckBox.setChecked(
-                Preferences.getWebBrowser("DnsPrefetchEnabled"))
-        except KeyError:
-            self.dnsPrefetchCheckBox.setEnabled(False)
+        self.screenCaptureCheckBox.setChecked(
+            Preferences.getWebBrowser("ScreenCaptureEnabled"))
+        self.webGLCheckBox.setChecked(
+            Preferences.getWebBrowser("WebGLEnabled"))
+        self.autoplayMediaCheckBox.setChecked(
+            Preferences.getWebBrowser("PlaybackRequiresUserGesture"))
+        self.webRtcPublicOnlyCheckBox.setChecked(
+            Preferences.getWebBrowser("WebRTCPublicInterfacesOnly"))
+        self.dnsPrefetchCheckBox.setChecked(
+            Preferences.getWebBrowser("DnsPrefetchEnabled"))
         
         self.javaScriptGroup.setChecked(
             Preferences.getWebBrowser("JavaScriptEnabled"))
         self.jsOpenWindowsCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
-        try:
-            # Qt 5.10
-            self.jsActivateWindowsCheckBox.setChecked(
-                Preferences.getWebBrowser(
-                    "AllowWindowActivationFromJavaScript"))
-        except KeyError:
-            self.jsActivateWindowsCheckBox.setEnabled(False)
+        self.jsActivateWindowsCheckBox.setChecked(
+            Preferences.getWebBrowser("AllowWindowActivationFromJavaScript"))
         self.jsClipboardCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
-        try:
-            # Qt 5.11
-            self.jsPasteCheckBox.setChecked(
-                Preferences.getWebBrowser("JavaScriptCanPaste"))
-        except KeyError:
-            self.jsPasteCheckBox.setEnabled(False)
+        self.jsPasteCheckBox.setChecked(
+            Preferences.getWebBrowser("JavaScriptCanPaste"))
         self.doNotTrackCheckBox.setChecked(
             Preferences.getWebBrowser("DoNotTrack"))
         self.refererSendComboBox.setCurrentIndex(
@@ -200,56 +175,28 @@
             Preferences.getWebBrowser("SpatialNavigationEnabled"))
         self.linksInFocusChainCheckBox.setChecked(
             Preferences.getWebBrowser("LinksIncludedInFocusChain"))
-        try:
-            # Qt 5.8
-            self.focusOnNavigationCheckBox.setChecked(
-                Preferences.getWebBrowser("FocusOnNavigationEnabled"))
-        except KeyError:
-            self.focusOnNavigationCheckBox.setEnabled(False)
+        self.focusOnNavigationCheckBox.setChecked(
+            Preferences.getWebBrowser("FocusOnNavigationEnabled"))
         
         self.xssAuditingCheckBox.setChecked(
             Preferences.getWebBrowser("XSSAuditingEnabled"))
-        try:
-            # Qt 5.8
-            self.insecureContentsCheckBox.setChecked(
-                Preferences.getWebBrowser("AllowRunningInsecureContent"))
-        except KeyError:
-            self.insecureContentsCheckBox.setEnabled(False)
-        try:
-            # Qt 5.9
-            self.insecureGeolocationCheckBox.setChecked(
-                Preferences.getWebBrowser("AllowGeolocationOnInsecureOrigins"))
-        except KeyError:
-            self.insecureGeolocationCheckBox.setEnabled(False)
+        self.insecureContentsCheckBox.setChecked(
+            Preferences.getWebBrowser("AllowRunningInsecureContent"))
+        self.insecureGeolocationCheckBox.setChecked(
+            Preferences.getWebBrowser("AllowGeolocationOnInsecureOrigins"))
         
-        try:
-            # Qt 5.8
-            self.printBackgroundCheckBox.setChecked(
-                Preferences.getWebBrowser("PrintElementBackgrounds"))
-        except KeyError:
-            self.printBackgroundCheckBox.setEnabled(False)
+        self.printBackgroundCheckBox.setChecked(
+            Preferences.getWebBrowser("PrintElementBackgrounds"))
         
         self.autoScrollGroupBox.setChecked(
             Preferences.getWebBrowser("AutoScrollEnabled"))
         self.autoScrollDividerSpinBox.setValue(
             Preferences.getWebBrowser("AutoScrollDivider"))
         
-        if qVersionTuple() < (5, 11, 0):
-            self.webInspectorGroup.setChecked(
-                Preferences.getWebBrowser("WebInspectorEnabled"))
-            self.webInspectorPortSpinBox.setValue(
-                Preferences.getWebBrowser("WebInspectorPort"))
-        else:
-            self.webInspectorGroup.hide()
-        
-        if qVersionTuple() >= (5, 11, 0):
-            self.protocolHandlerComboBox.setCurrentIndex(
-                Preferences.getWebBrowser("AcceptProtocolHandlerRequest"))
-            self.requestQuotaComboBox.setCurrentIndex(
-                Preferences.getWebBrowser("AcceptQuotaRequest"))
-        else:
-            self.protocolHandlerComboBox.setEnabled(False)
-            self.requestQuotaComboBox.setEnabled(False)
+        self.protocolHandlerComboBox.setCurrentIndex(
+            Preferences.getWebBrowser("AcceptProtocolHandlerRequest"))
+        self.requestQuotaComboBox.setCurrentIndex(
+            Preferences.getWebBrowser("AcceptQuotaRequest"))
     
     def save(self):
         """
@@ -277,26 +224,23 @@
             "FullScreenSupportEnabled",
             self.fullscreenCheckBox.isChecked())
         
-        if self.screenCaptureCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "ScreenCaptureEnabled",
-                self.screenCaptureCheckBox.isChecked())
-            Preferences.setWebBrowser(
-                "WebGLEnabled",
-                self.webGLCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "ScreenCaptureEnabled",
+            self.screenCaptureCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "WebGLEnabled",
+            self.webGLCheckBox.isChecked())
         
-        if self.autoplayMediaCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "PlaybackRequiresUserGesture",
-                self.autoplayMediaCheckBox.isChecked())
-            Preferences.setWebBrowser(
-                "WebRTCPublicInterfacesOnly",
-                self.webRtcPublicOnlyCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "PlaybackRequiresUserGesture",
+            self.autoplayMediaCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "WebRTCPublicInterfacesOnly",
+            self.webRtcPublicOnlyCheckBox.isChecked())
         
-        if self.dnsPrefetchCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "DnsPrefetchEnabled",
-                self.dnsPrefetchCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "DnsPrefetchEnabled",
+            self.dnsPrefetchCheckBox.isChecked())
         
         Preferences.setWebBrowser(
             "JavaScriptEnabled",
@@ -304,17 +248,15 @@
         Preferences.setWebBrowser(
             "JavaScriptCanOpenWindows",
             self.jsOpenWindowsCheckBox.isChecked())
-        if self.jsActivateWindowsCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "AllowWindowActivationFromJavaScript",
-                self.jsActivateWindowsCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "AllowWindowActivationFromJavaScript",
+            self.jsActivateWindowsCheckBox.isChecked())
         Preferences.setWebBrowser(
             "JavaScriptCanAccessClipboard",
             self.jsClipboardCheckBox.isChecked())
-        if self.jsPasteCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "JavaScriptCanPaste",
-                self.jsPasteCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "JavaScriptCanPaste",
+            self.jsPasteCheckBox.isChecked())
         
         Preferences.setWebBrowser(
             "PluginsEnabled",
@@ -403,27 +345,23 @@
         Preferences.setWebBrowser(
             "LinksIncludedInFocusChain",
             self.linksInFocusChainCheckBox.isChecked())
-        if self.focusOnNavigationCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "FocusOnNavigationEnabled",
-                self.focusOnNavigationCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "FocusOnNavigationEnabled",
+            self.focusOnNavigationCheckBox.isChecked())
         
         Preferences.setWebBrowser(
             "XSSAuditingEnabled",
             self.xssAuditingCheckBox.isChecked())
-        if self.insecureContentsCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "AllowRunningInsecureContent",
-                self.insecureContentsCheckBox.isChecked())
-        if self.insecureGeolocationCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "AllowGeolocationOnInsecureOrigins",
-                self.insecureGeolocationCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "AllowRunningInsecureContent",
+            self.insecureContentsCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "AllowGeolocationOnInsecureOrigins",
+            self.insecureGeolocationCheckBox.isChecked())
         
-        if self.printBackgroundCheckBox.isEnabled():
-            Preferences.setWebBrowser(
-                "PrintElementBackgrounds",
-                self.printBackgroundCheckBox.isChecked())
+        Preferences.setWebBrowser(
+            "PrintElementBackgrounds",
+            self.printBackgroundCheckBox.isChecked())
         
         Preferences.setWebBrowser(
             "AutoScrollEnabled",
@@ -432,21 +370,12 @@
             "AutoScrollDivider",
             self.autoScrollDividerSpinBox.value())
         
-        if qVersionTuple() < (5, 11, 0):
-            Preferences.setWebBrowser(
-                "WebInspectorEnabled",
-                self.webInspectorGroup.isChecked())
-            Preferences.setWebBrowser(
-                "WebInspectorPort",
-                self.webInspectorPortSpinBox.value())
-        
-        if self.protocolHandlerComboBox.isEnabled():
-            Preferences.setWebBrowser(
-                "AcceptProtocolHandlerRequest",
-                self.protocolHandlerComboBox.currentIndex())
-            Preferences.setWebBrowser(
-                "AcceptQuotaRequest",
-                self.requestQuotaComboBox.currentIndex())
+        Preferences.setWebBrowser(
+            "AcceptProtocolHandlerRequest",
+            self.protocolHandlerComboBox.currentIndex())
+        Preferences.setWebBrowser(
+            "AcceptQuotaRequest",
+            self.requestQuotaComboBox.currentIndex())
     
     @pyqtSlot()
     def on_setCurrentPageButton_clicked(self):
--- a/eric6/Preferences/ConfigurationPages/WebBrowserPage.ui	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/WebBrowserPage.ui	Sun Jan 03 15:33:39 2021 +0100
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>650</width>
-    <height>2204</height>
+    <height>2084</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_6">
@@ -1161,67 +1161,6 @@
      </layout>
     </widget>
    </item>
-   <item>
-    <widget class="QGroupBox" name="webInspectorGroup">
-     <property name="toolTip">
-      <string>Select to enable the Web Inspector tool</string>
-     </property>
-     <property name="title">
-      <string>Enable Web Development (Web Inspector)</string>
-     </property>
-     <property name="checkable">
-      <bool>true</bool>
-     </property>
-     <property name="checked">
-      <bool>false</bool>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_8">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>Web Inspector Port:</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="QSpinBox" name="webInspectorPortSpinBox">
-        <property name="toolTip">
-         <string>Enter the port to be used by the web inspector</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-        </property>
-        <property name="minimum">
-         <number>1025</number>
-        </property>
-        <property name="maximum">
-         <number>65535</number>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2">
-       <spacer name="horizontalSpacer_4">
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>372</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item row="1" column="0" colspan="3">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string>&lt;font color=&quot;red&quot;&gt;&lt;b&gt;Note:&lt;/b&gt; Web Inspector settings are activated after a restart of the application.&lt;/font&gt;</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
   </layout>
  </widget>
  <tabstops>
@@ -1275,8 +1214,6 @@
   <tabstop>focusOnNavigationCheckBox</tabstop>
   <tabstop>autoScrollGroupBox</tabstop>
   <tabstop>autoScrollDividerSpinBox</tabstop>
-  <tabstop>webInspectorGroup</tabstop>
-  <tabstop>webInspectorPortSpinBox</tabstop>
  </tabstops>
  <resources/>
  <connections/>
--- a/eric6/Preferences/__init__.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Preferences/__init__.py	Sun Jan 03 15:33:39 2021 +0100
@@ -944,8 +944,6 @@
         "ImageSearchEngine": "Google",
         "RssFeeds": [],
         "ShowPreview": True,
-        "WebInspectorPort": 42024,
-        "WebInspectorEnabled": False,
         "DiskCacheEnabled": True,
         "DiskCacheSize": 50,        # 50 MB
         "SslExceptionsDB": "{}",    # empty JSON dictionary
@@ -1085,7 +1083,6 @@
                 QWebEngineSettings.MinimumFontSize),
             "MinimumLogicalFontSize": webEngineSettings.fontSize(
                 QWebEngineSettings.MinimumLogicalFontSize),
-            
             "AutoLoadImages": webEngineSettings.testAttribute(
                 QWebEngineSettings.AutoLoadImages),
             "JavaScriptEnabled": webEngineSettings.testAttribute(
@@ -1115,78 +1112,41 @@
                 QWebEngineSettings.ErrorPageEnabled),
             "FullScreenSupportEnabled": webEngineSettings.testAttribute(
                 QWebEngineSettings.FullScreenSupportEnabled),
+            "PictographFontFamily": webEngineSettings.fontFamily(
+                QWebEngineSettings.PictographFont),
+            "ScreenCaptureEnabled": webEngineSettings.testAttribute(
+                QWebEngineSettings.ScreenCaptureEnabled),
+            "WebGLEnabled": webEngineSettings.testAttribute(
+                QWebEngineSettings.WebGLEnabled),
+            "FocusOnNavigationEnabled": webEngineSettings.testAttribute(
+                QWebEngineSettings.FocusOnNavigationEnabled),
+            "PrintElementBackgrounds": webEngineSettings.testAttribute(
+                QWebEngineSettings.PrintElementBackgrounds),
+            "AllowRunningInsecureContent": webEngineSettings.testAttribute(
+                QWebEngineSettings.AllowRunningInsecureContent),
+            "AllowGeolocationOnInsecureOrigins":
+                webEngineSettings.testAttribute(
+                    QWebEngineSettings.AllowGeolocationOnInsecureOrigins),
+            "AllowWindowActivationFromJavaScript":
+                webEngineSettings.testAttribute(
+                    QWebEngineSettings.AllowWindowActivationFromJavaScript
+                ),
+            "ShowScrollBars": webEngineSettings.testAttribute(
+                QWebEngineSettings.ShowScrollBars),
+            "PlaybackRequiresUserGesture":
+                webEngineSettings.testAttribute(
+                    QWebEngineSettings.PlaybackRequiresUserGesture),
+            "JavaScriptCanPaste":
+                webEngineSettings.testAttribute(
+                    QWebEngineSettings.JavascriptCanPaste),
+            "WebRTCPublicInterfacesOnly":
+                webEngineSettings.testAttribute(
+                    QWebEngineSettings.WebRTCPublicInterfacesOnly),
+            "DnsPrefetchEnabled":
+                webEngineSettings.testAttribute(
+                    QWebEngineSettings.DnsPrefetchEnabled),
         })
         try:
-            # Qt 5.7+
-            cls.webBrowserDefaults.update({
-                "PictographFontFamily": webEngineSettings.fontFamily(
-                    QWebEngineSettings.PictographFont),
-                
-                "ScreenCaptureEnabled": webEngineSettings.testAttribute(
-                    QWebEngineSettings.ScreenCaptureEnabled),
-                "WebGLEnabled": webEngineSettings.testAttribute(
-                    QWebEngineSettings.WebGLEnabled),
-            })
-        except AttributeError:
-            pass
-        try:
-            # Qt 5.8+
-            cls.webBrowserDefaults.update({
-                "FocusOnNavigationEnabled": webEngineSettings.testAttribute(
-                    QWebEngineSettings.FocusOnNavigationEnabled),
-                "PrintElementBackgrounds": webEngineSettings.testAttribute(
-                    QWebEngineSettings.PrintElementBackgrounds),
-                "AllowRunningInsecureContent": webEngineSettings.testAttribute(
-                    QWebEngineSettings.AllowRunningInsecureContent),
-            })
-        except AttributeError:
-            pass
-        try:
-            # Qt 5.9+
-            cls.webBrowserDefaults.update({
-                "AllowGeolocationOnInsecureOrigins":
-                    webEngineSettings.testAttribute(
-                        QWebEngineSettings.AllowGeolocationOnInsecureOrigins),
-            })
-        except AttributeError:
-            pass
-        try:
-            # Qt 5.10+
-            cls.webBrowserDefaults.update({
-                "AllowWindowActivationFromJavaScript":
-                    webEngineSettings.testAttribute(
-                        QWebEngineSettings.AllowWindowActivationFromJavaScript
-                    ),
-                "ShowScrollBars": webEngineSettings.testAttribute(
-                    QWebEngineSettings.ShowScrollBars),
-            })
-        except AttributeError:
-            pass
-        try:
-            # Qt 5.11+
-            cls.webBrowserDefaults.update({
-                "PlaybackRequiresUserGesture":
-                    webEngineSettings.testAttribute(
-                        QWebEngineSettings.PlaybackRequiresUserGesture),
-                "JavaScriptCanPaste":
-                    webEngineSettings.testAttribute(
-                        QWebEngineSettings.JavascriptCanPaste),
-                "WebRTCPublicInterfacesOnly":
-                    webEngineSettings.testAttribute(
-                        QWebEngineSettings.WebRTCPublicInterfacesOnly),
-            })
-        except AttributeError:
-            pass
-        try:
-            # Qt 5.12+
-            cls.webBrowserDefaults.update({
-                "DnsPrefetchEnabled":
-                    webEngineSettings.testAttribute(
-                        QWebEngineSettings.DnsPrefetchEnabled),
-            })
-        except AttributeError:
-            pass
-        try:
             # Qt 5.13
             cls.webBrowserDefaults.update({
                 "PdfViewerEnabled":
@@ -2746,15 +2706,6 @@
     @param prefClass preferences class used as the storage area
     @return the requested help setting
     """
-    # Web inspector stuff must come before initializing web engine settings
-    # because that starts the chromium web process
-    if key == "WebInspectorPort":
-        return int(prefClass.settings.value(
-            "WebBrowser/" + key, prefClass.webBrowserDefaults[key]))
-    elif key == "WebInspectorEnabled":
-        return toBool(prefClass.settings.value(
-            "WebBrowser/" + key, prefClass.webBrowserDefaults[key]))
-    
     if not prefClass.webEngineSettingsIntitialized:
         prefClass.initWebEngineSettingsDefaults()
     
@@ -2833,8 +2784,7 @@
     elif key in ["StartupBehavior", "HistoryLimit",
                  "DownloadManagerRemovePolicy", "SyncType", "SyncFtpPort",
                  "SyncFtpIdleTimeout", "SyncEncryptionKeyLength",
-                 "SearchLanguage", "WebInspectorPort",
-                 "DefaultFontSize", "DefaultFixedFontSize",
+                 "SearchLanguage", "DefaultFontSize", "DefaultFixedFontSize",
                  "MinimumFontSize", "MinimumLogicalFontSize",
                  "DiskCacheSize", "AcceptCookies", "KeepCookiesUntil",
                  "AdBlockUpdatePeriod", "TabManagerGroupByType",
@@ -2857,7 +2807,7 @@
                  "SyncEnabled", "SyncBookmarks", "SyncHistory",
                  "SyncPasswords", "SyncUserAgents", "SyncSpeedDial",
                  "SyncEncryptData", "SyncEncryptPasswordsOnly",
-                 "ShowPreview", "WebInspectorEnabled", "DiskCacheEnabled",
+                 "ShowPreview", "DiskCacheEnabled",
                  "DoNotTrack", "FilterTrackingCookies",
                  "AdBlockEnabled", "AdBlockUseLimitedEasyList",
                  "PluginsEnabled", "FullScreenSupportEnabled",
--- a/eric6/Snapshot/SnapWidget.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Snapshot/SnapWidget.py	Sun Jan 03 15:33:39 2021 +0100
@@ -66,14 +66,9 @@
             self.modeCombo.addItem(self.tr("Fullscreen"),
                                    SnapshotModes.Fullscreen)
         if SnapshotModes.SelectedScreen in supportedModes:
-            if Globals.qVersionTuple() >= (5, 10, 0):
-                if len(QApplication.screens()) > 1:
-                    self.modeCombo.addItem(self.tr("Select Screen"),
-                                           SnapshotModes.SelectedScreen)
-            else:
-                if QApplication.desktop().screenCount() > 1:
-                    self.modeCombo.addItem(self.tr("Select Screen"),
-                                           SnapshotModes.SelectedScreen)
+            if len(QApplication.screens()) > 1:
+                self.modeCombo.addItem(self.tr("Select Screen"),
+                                       SnapshotModes.SelectedScreen)
         if SnapshotModes.SelectedWindow in supportedModes:
             self.modeCombo.addItem(self.tr("Select Window"),
                                    SnapshotModes.SelectedWindow)
--- a/eric6/Snapshot/SnapshotDefaultGrabber.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Snapshot/SnapshotDefaultGrabber.py	Sun Jan 03 15:33:39 2021 +0100
@@ -147,22 +147,10 @@
         self.__grabTimer.stop()
         
         if mode == SnapshotModes.Fullscreen:
-            desktop = QApplication.desktop()
-            snapshot = QApplication.screens()[0].grabWindow(
-                desktop.winId(), desktop.x(), desktop.y(),
-                desktop.width(), desktop.height())
+            snapshot = QApplication.screens()[0].grabWindow(0)
         elif mode == SnapshotModes.SelectedScreen:
-            desktop = QApplication.desktop()
-            if Globals.qVersionTuple() >= (5, 10, 0):
-                screen = QApplication.screenAt(QCursor.pos())
-                geom = screen.geometry()
-            else:
-                screenId = desktop.screenNumber(QCursor.pos())
-                geom = desktop.screenGeometry(screenId)
-            x = geom.x()
-            y = geom.y()
-            snapshot = QApplication.screens()[0].grabWindow(
-                desktop.winId(), x, y, geom.width(), geom.height())
+            screen = QApplication.screenAt(QCursor.pos())
+            snapshot = screen.grabWindow(0)
         else:
             snapshot = QPixmap()
         
--- a/eric6/Snapshot/SnapshotFreehandGrabber.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Snapshot/SnapshotFreehandGrabber.py	Sun Jan 03 15:33:39 2021 +0100
@@ -82,14 +82,9 @@
         """
         Private slot to initialize the rest of the widget.
         """
-        self.__desktop = QApplication.desktop()
-        x = self.__desktop.x()
-        y = self.__desktop.y()
-        self.__pixmap = QApplication.screens()[0].grabWindow(
-            self.__desktop.winId(), x, y,
-            self.__desktop.width(), self.__desktop.height())
+        self.__pixmap = QApplication.screens()[0].grabWindow(0)
         self.resize(self.__pixmap.size())
-        self.move(x, y)
+        self.move(0, 0)
         self.setCursor(Qt.CrossCursor)
         self.show()
 
@@ -143,8 +138,7 @@
             painter.setBrush(textBackgroundColor)
             self.__helpTextRect = painter.boundingRect(
                 self.rect().adjusted(2, 2, -2, -2),
-                Qt.TextWordWrap, self.__helpText).translated(
-                -self.__desktop.x(), -self.__desktop.y())
+                Qt.TextWordWrap, self.__helpText).translated(0, 0)
             self.__helpTextRect.adjust(-2, -2, 4, 2)
             drawPolygon(painter, self.__helpTextRect, textColor,
                         textBackgroundColor)
--- a/eric6/Snapshot/SnapshotRegionGrabber.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Snapshot/SnapshotRegionGrabber.py	Sun Jan 03 15:33:39 2021 +0100
@@ -112,14 +112,9 @@
         """
         Private slot to initialize the rest of the widget.
         """
-        self.__desktop = QApplication.desktop()
-        x = self.__desktop.x()
-        y = self.__desktop.y()
-        self.__pixmap = QApplication.screens()[0].grabWindow(
-            self.__desktop.winId(), x, y,
-            self.__desktop.width(), self.__desktop.height())
+        self.__pixmap = QApplication.screens()[0].grabWindow(0)
         self.resize(self.__pixmap.size())
-        self.move(x, y)
+        self.move(0, 0)
         self.setCursor(Qt.CrossCursor)
         self.show()
 
@@ -168,8 +163,7 @@
             painter.setBrush(textBackgroundColor)
             self.__helpTextRect = painter.boundingRect(
                 self.rect().adjusted(2, 2, -2, -2),
-                Qt.TextWordWrap, self.__helpText).translated(
-                -self.__desktop.x(), -self.__desktop.y())
+                Qt.TextWordWrap, self.__helpText).translated(0, 0)
             self.__helpTextRect.adjust(-2, -2, 4, 2)
             drawRect(painter, self.__helpTextRect, textColor,
                      textBackgroundColor)
--- a/eric6/Snapshot/SnapshotTimer.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Snapshot/SnapshotTimer.py	Sun Jan 03 15:33:39 2021 +0100
@@ -11,8 +11,6 @@
 from PyQt5.QtGui import QPainter, QPalette
 from PyQt5.QtWidgets import QWidget, QApplication, QToolTip
 
-from Globals import qVersionTuple
-
 
 class SnapshotTimer(QWidget):
     """
@@ -54,10 +52,7 @@
         
         @param seconds timeout value (integer)
         """
-        if qVersionTuple() >= (5, 10, 0):
-            screenGeom = QApplication.screens()[0].geometry()
-        else:
-            screenGeom = QApplication.desktop().screenGeometry()
+        screenGeom = QApplication.screens()[0].geometry()
         self.move(screenGeom.width() // 2 - self.size().width() // 2,
                   screenGeom.top())
         self.__toggle = True
@@ -120,10 +115,7 @@
         
         @param evt enter event (QEvent)
         """
-        if qVersionTuple() >= (5, 10, 0):
-            screenGeom = QApplication.screens()[0].geometry()
-        else:
-            screenGeom = QApplication.desktop().screenGeometry()
+        screenGeom = QApplication.screens()[0].geometry()
         if self.x() == screenGeom.left():
             self.move(
                 screenGeom.x() +
--- a/eric6/Snapshot/SnapshotWaylandGrabber.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Snapshot/SnapshotWaylandGrabber.py	Sun Jan 03 15:33:39 2021 +0100
@@ -175,17 +175,12 @@
         snapshot = QPixmap()
         
         if Globals.isKdeDesktop():
-            # Step 1: get the screen number of screen containing the cursor
-            if Globals.qVersionTuple() >= (5, 10, 0):
-                screen = QApplication.screenAt(QCursor.pos())
-                try:
-                    screenId = QApplication.screens().index(screen)
-                except ValueError:
-                    # default to screen 0
-                    screenId = 0
-            else:
-                desktop = QApplication.desktop()
-                screenId = desktop.screenNumber(QCursor.pos())
+            screen = QApplication.screenAt(QCursor.pos())
+            try:
+                screenId = QApplication.screens().index(screen)
+            except ValueError:
+                # default to screen 0
+                screenId = 0
             
             # Step 2: grab the screen
             interface = QDBusInterface(
@@ -235,13 +230,8 @@
                     # Step 2: extract the area of the screen containing
                     #         the cursor
                     if not snapshot.isNull():
-                        if Globals.qVersionTuple() >= (5, 10, 0):
-                            screen = QApplication.screenAt(QCursor.pos())
-                            geom = screen.geometry()
-                        else:
-                            desktop = QApplication.desktop()
-                            screenId = desktop.screenNumber(QCursor.pos())
-                            geom = desktop.screenGeometry(screenId)
+                        screen = QApplication.screenAt(QCursor.pos())
+                        geom = screen.geometry()
                         snapshot = snapshot.copy(geom)
         
         self.grabbed.emit(snapshot)
--- a/eric6/UI/FindFileDialog.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/UI/FindFileDialog.py	Sun Jan 03 15:33:39 2021 +0100
@@ -155,9 +155,6 @@
                 self.__lastFileItem.setFlags(
                     self.__lastFileItem.flags() |
                     Qt.ItemFlags(Qt.ItemIsUserCheckable | Qt.ItemIsTristate))
-                # Qt bug:
-                # item is not user checkable if setFirstColumnSpanned
-                # is True (< 4.5.0)
             self.__lastFileItem.setData(0, self.md5Role, md5)
         
         itm = QTreeWidgetItem(self.__lastFileItem)
--- a/eric6/WebBrowser/QtHelp/HelpDocsInstaller.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/WebBrowser/QtHelp/HelpDocsInstaller.py	Sun Jan 03 15:33:39 2021 +0100
@@ -135,7 +135,6 @@
                 not os.path.isdir(docsPath) or
                 len(QDir(docsPath).entryList(["*.qch"])) == 0
             ):
-                # Qt installer is a bit buggy; it's missing a symbolic link
                 docsPathList = QDir.fromNativeSeparators(docsPath).split("/")
                 docsPath = os.sep.join(
                     docsPathList[:-3] +
--- a/eric6/WebBrowser/StatusBar/JavaScriptSettingsDialog.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/WebBrowser/StatusBar/JavaScriptSettingsDialog.py	Sun Jan 03 15:33:39 2021 +0100
@@ -36,21 +36,13 @@
             Preferences.getWebBrowser("JavaScriptEnabled"))
         self.jsOpenWindowsCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
-        try:
-            # Qt 5.10
-            self.jsActivateWindowsCheckBox.setChecked(
-                Preferences.getWebBrowser(
-                    "AllowWindowActivationFromJavaScript"))
-        except KeyError:
-            self.jsActivateWindowsCheckBox.setEnabled(False)
+        self.jsActivateWindowsCheckBox.setChecked(
+            Preferences.getWebBrowser(
+                "AllowWindowActivationFromJavaScript"))
         self.jsClipboardCheckBox.setChecked(
             Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
-        try:
-            # Qt 5.11
-            self.jsPasteCheckBox.setChecked(
-                Preferences.getWebBrowser("JavaScriptCanPaste"))
-        except KeyError:
-            self.jsPasteCheckBox.setEnabled(False)
+        self.jsPasteCheckBox.setChecked(
+            Preferences.getWebBrowser("JavaScriptCanPaste"))
         
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
--- a/eric6/WebBrowser/WebBrowserView.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/WebBrowser/WebBrowserView.py	Sun Jan 03 15:33:39 2021 +0100
@@ -38,7 +38,6 @@
 import Preferences
 import UI.PixmapCache
 import Utilities
-from Globals import qVersionTuple
 
 
 class WebBrowserView(QWebEngineView):
@@ -138,12 +137,6 @@
         if self.parentWidget() is not None:
             self.parentWidget().installEventFilter(self)
         
-        if qVersionTuple() < (5, 11, 0):
-            lay = self.layout()
-            lay.currentChanged.connect(
-                lambda: QTimer.singleShot(0, self.__setRwhvqt))
-            self.__setRwhvqt()
-        
         self.grabGesture(Qt.PinchGesture)
     
     def __createNewPage(self):
@@ -583,14 +576,10 @@
             self.__menu.addSeparator()
             self.__menu.addAction(self.__mw.adBlockIcon().menuAction())
         
-        if (
-            qVersionTuple() >= (5, 11, 0) or
-            Preferences.getWebBrowser("WebInspectorEnabled")
-        ):
-            self.__menu.addSeparator()
-            self.__menu.addAction(
-                UI.PixmapCache.getIcon("webInspector"),
-                self.tr("Inspect Element..."), self.__webInspector)
+        self.__menu.addSeparator()
+        self.__menu.addAction(
+            UI.PixmapCache.getIcon("webInspector"),
+            self.tr("Inspect Element..."), self.__webInspector)
         
         if not self.__menu.isEmpty():
             pos = evt.globalPos()
@@ -1571,8 +1560,7 @@
         
         # find the render widget receiving events for the web page
         if obj is self and evt.type() == QEvent.ChildAdded:
-            if qVersionTuple() >= (5, 11, 0):
-                QTimer.singleShot(0, self.__setRwhvqt)
+            QTimer.singleShot(0, self.__setRwhvqt)
         
         # forward events to WebBrowserView
         if (
@@ -2277,70 +2265,68 @@
     ## Methods below implement slots for Qt 5.11+
     ###########################################################################
     
-    if qVersionTuple() >= (5, 11, 0):
-        @pyqtSlot("QWebEngineQuotaRequest")
-        def __quotaRequested(self, quotaRequest):
-            """
-            Private slot to handle quota requests of the web page.
+    @pyqtSlot("QWebEngineQuotaRequest")
+    def __quotaRequested(self, quotaRequest):
+        """
+        Private slot to handle quota requests of the web page.
+        
+        @param quotaRequest reference to the quota request object
+        @type QWebEngineQuotaRequest
+        """
+        acceptRequest = Preferences.getWebBrowser("AcceptQuotaRequest")
+        # map yes/no/ask from (0, 1, 2)
+        if acceptRequest == 0:
+            # always yes
+            ok = True
+        elif acceptRequest == 1:
+            # always no
+            ok = False
+        else:
+            # ask user
+            from .Download.DownloadUtilities import dataString
+            sizeStr = dataString(quotaRequest.requestedSize())
             
-            @param quotaRequest reference to the quota request object
-            @type QWebEngineQuotaRequest
-            """
-            acceptRequest = Preferences.getWebBrowser("AcceptQuotaRequest")
-            # map yes/no/ask from (0, 1, 2)
-            if acceptRequest == 0:
-                # always yes
-                ok = True
-            elif acceptRequest == 1:
-                # always no
-                ok = False
-            else:
-                # ask user
-                from .Download.DownloadUtilities import dataString
-                sizeStr = dataString(quotaRequest.requestedSize())
-                
-                ok = E5MessageBox.yesNo(
-                    self,
-                    self.tr("Quota Request"),
-                    self.tr("""<p> Allow the website at <b>{0}</b> to use"""
-                            """ <b>{1}</b> of persistent storage?</p>""")
-                    .format(quotaRequest.origin().host(), sizeStr)
-                )
-            
-            if ok:
-                quotaRequest.accept()
-            else:
-                quotaRequest.reject()
+            ok = E5MessageBox.yesNo(
+                self,
+                self.tr("Quota Request"),
+                self.tr("""<p> Allow the website at <b>{0}</b> to use"""
+                        """ <b>{1}</b> of persistent storage?</p>""")
+                .format(quotaRequest.origin().host(), sizeStr)
+            )
+        
+        if ok:
+            quotaRequest.accept()
+        else:
+            quotaRequest.reject()
     
     ###########################################################################
     ## Methods below implement slots for Qt 5.12+
     ###########################################################################
     
-    if qVersionTuple() >= (5, 12, 0):
-        @pyqtSlot("QWebEngineClientCertificateSelection")
-        def __selectClientCertificate(self, clientCertificateSelection):
-            """
-            Private slot to handle the client certificate selection request.
+    @pyqtSlot("QWebEngineClientCertificateSelection")
+    def __selectClientCertificate(self, clientCertificateSelection):
+        """
+        Private slot to handle the client certificate selection request.
+        
+        @param clientCertificateSelection list of client SSL certificates
+            found in system's client certificate store
+        @type QWebEngineClientCertificateSelection
+        """
+        certificates = clientCertificateSelection.certificates()
+        if len(certificates) == 0:
+            clientCertificateSelection.selectNone()
+        elif len(certificates) == 1:
+            clientCertificateSelection.select(certificates[0])
+        else:
+            certificate = None
+            from E5Network.E5SslCertificateSelectionDialog import (
+                E5SslCertificateSelectionDialog
+            )
+            dlg = E5SslCertificateSelectionDialog(certificates, self)
+            if dlg.exec() == QDialog.Accepted:
+                certificate = dlg.getSelectedCertificate()
             
-            @param clientCertificateSelection list of client SSL certificates
-                found in system's client certificate store
-            @type QWebEngineClientCertificateSelection
-            """
-            certificates = clientCertificateSelection.certificates()
-            if len(certificates) == 0:
+            if certificate is None:
                 clientCertificateSelection.selectNone()
-            elif len(certificates) == 1:
-                clientCertificateSelection.select(certificates[0])
             else:
-                certificate = None
-                from E5Network.E5SslCertificateSelectionDialog import (
-                    E5SslCertificateSelectionDialog
-                )
-                dlg = E5SslCertificateSelectionDialog(certificates, self)
-                if dlg.exec() == QDialog.Accepted:
-                    certificate = dlg.getSelectedCertificate()
-                
-                if certificate is None:
-                    clientCertificateSelection.selectNone()
-                else:
-                    clientCertificateSelection.select(certificate)
+                clientCertificateSelection.select(certificate)
--- a/eric6/WebBrowser/WebBrowserWindow.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/WebBrowser/WebBrowserWindow.py	Sun Jan 03 15:33:39 2021 +0100
@@ -45,7 +45,6 @@
 
 import Utilities
 import Globals
-from Globals import qVersionTuple
 
 import UI.PixmapCache
 import UI.Config
@@ -163,13 +162,6 @@
         self.__eventMouseButtons = Qt.NoButton
         self.__eventKeyboardModifiers = Qt.NoModifier
         
-        if (
-            qVersionTuple() < (5, 11, 0) and
-            Preferences.getWebBrowser("WebInspectorEnabled")
-        ):
-            os.environ["QTWEBENGINE_REMOTE_DEBUGGING"] = str(
-                Preferences.getWebBrowser("WebInspectorPort"))
-        
         WebBrowserWindow.setUseQtHelp(qthelp or bool(searchWord))
         
         self.webProfile(private)
@@ -614,77 +606,47 @@
         settings.setAttribute(
             QWebEngineSettings.FullScreenSupportEnabled,
             Preferences.getWebBrowser("FullScreenSupportEnabled"))
-        
-        try:
-            # Qt 5.7
-            settings.setAttribute(
-                QWebEngineSettings.ScreenCaptureEnabled,
-                Preferences.getWebBrowser("ScreenCaptureEnabled"))
-            settings.setAttribute(
-                QWebEngineSettings.WebGLEnabled,
-                Preferences.getWebBrowser("WebGLEnabled"))
-        except (AttributeError, KeyError):
-            pass
-        
-        try:
-            # Qt 5.8
-            settings.setAttribute(
-                QWebEngineSettings.FocusOnNavigationEnabled,
-                Preferences.getWebBrowser("FocusOnNavigationEnabled"))
-            settings.setAttribute(
-                QWebEngineSettings.PrintElementBackgrounds,
-                Preferences.getWebBrowser("PrintElementBackgrounds"))
-            settings.setAttribute(
-                QWebEngineSettings.AllowRunningInsecureContent,
-                Preferences.getWebBrowser("AllowRunningInsecureContent"))
-        except (AttributeError, KeyError):
-            pass
-        
-        try:
-            # Qt 5.9
-            settings.setAttribute(
-                QWebEngineSettings.AllowGeolocationOnInsecureOrigins,
-                Preferences.getWebBrowser("AllowGeolocationOnInsecureOrigins"))
-        except (AttributeError, KeyError):
-            pass
-        
-        try:
-            # Qt 5.10
-            settings.setAttribute(
-                QWebEngineSettings.AllowWindowActivationFromJavaScript,
-                Preferences.getWebBrowser(
-                    "AllowWindowActivationFromJavaScript"))
-            settings.setAttribute(
-                QWebEngineSettings.ShowScrollBars,
-                Preferences.getWebBrowser("ShowScrollBars"))
-        except (AttributeError, KeyError):
-            pass
-        
-        try:
-            # Qt 5.11
-            settings.setAttribute(
-                QWebEngineSettings.PlaybackRequiresUserGesture,
-                Preferences.getWebBrowser(
-                    "PlaybackRequiresUserGesture"))
-            settings.setAttribute(
-                QWebEngineSettings.JavascriptCanPaste,
-                Preferences.getWebBrowser(
-                    "JavaScriptCanPaste"))
-            settings.setAttribute(
-                QWebEngineSettings.WebRTCPublicInterfacesOnly,
-                Preferences.getWebBrowser(
-                    "WebRTCPublicInterfacesOnly"))
-        except (AttributeError, KeyError):
-            pass
-        
-        try:
-            # Qt 5.12
-            settings.setAttribute(
-                QWebEngineSettings.DnsPrefetchEnabled,
-                Preferences.getWebBrowser(
-                    "DnsPrefetchEnabled"))
-        except (AttributeError, KeyError):
-            pass
+        settings.setAttribute(
+            QWebEngineSettings.ScreenCaptureEnabled,
+            Preferences.getWebBrowser("ScreenCaptureEnabled"))
+        settings.setAttribute(
+            QWebEngineSettings.WebGLEnabled,
+            Preferences.getWebBrowser("WebGLEnabled"))
+        settings.setAttribute(
+            QWebEngineSettings.FocusOnNavigationEnabled,
+            Preferences.getWebBrowser("FocusOnNavigationEnabled"))
+        settings.setAttribute(
+            QWebEngineSettings.PrintElementBackgrounds,
+            Preferences.getWebBrowser("PrintElementBackgrounds"))
+        settings.setAttribute(
+            QWebEngineSettings.AllowRunningInsecureContent,
+            Preferences.getWebBrowser("AllowRunningInsecureContent"))
+        settings.setAttribute(
+            QWebEngineSettings.AllowGeolocationOnInsecureOrigins,
+            Preferences.getWebBrowser("AllowGeolocationOnInsecureOrigins"))
+        settings.setAttribute(
+            QWebEngineSettings.AllowWindowActivationFromJavaScript,
+            Preferences.getWebBrowser(
+                "AllowWindowActivationFromJavaScript"))
+        settings.setAttribute(
+            QWebEngineSettings.ShowScrollBars,
+            Preferences.getWebBrowser("ShowScrollBars"))
+        settings.setAttribute(
+            QWebEngineSettings.PlaybackRequiresUserGesture,
+            Preferences.getWebBrowser(
+                "PlaybackRequiresUserGesture"))
+        settings.setAttribute(
+            QWebEngineSettings.JavascriptCanPaste,
+            Preferences.getWebBrowser(
+                "JavaScriptCanPaste"))
+        settings.setAttribute(
+            QWebEngineSettings.WebRTCPublicInterfacesOnly,
+            Preferences.getWebBrowser(
+                "WebRTCPublicInterfacesOnly"))
+        settings.setAttribute(
+            QWebEngineSettings.DnsPrefetchEnabled,
+            Preferences.getWebBrowser(
+                "DnsPrefetchEnabled"))
         
         try:
             # Qt 5.13
--- a/eric6/WebBrowser/WebInspector.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/WebBrowser/WebInspector.py	Sun Jan 03 15:33:39 2021 +0100
@@ -7,17 +7,11 @@
 Module implementing a QWebEngineView to load the web inspector in.
 """
 
-import json
-import os
-
-from PyQt5.QtCore import pyqtSignal, QSize, QUrl
-from PyQt5.QtNetwork import QNetworkRequest
+from PyQt5.QtCore import pyqtSignal, QSize
 from PyQt5.QtWebEngineWidgets import (
     QWebEngineView, QWebEnginePage, QWebEngineSettings
 )
 
-from Globals import qVersionTuple
-
 import Preferences
 
 _VIEWS = []
@@ -90,48 +84,7 @@
         
         self.__inspectElement = inspectElement
         
-        try:
-            self.page().setInspectedPage(self.__view.page())
-        except AttributeError:
-            # pre Qt 5.11
-            port = Preferences.getWebBrowser("WebInspectorPort")
-            inspectorUrl = QUrl("http://localhost:{0}".format(port))
-            
-            from WebBrowser.WebBrowserWindow import WebBrowserWindow
-            self.__reply = WebBrowserWindow.networkManager().get(
-                QNetworkRequest(inspectorUrl.resolved(QUrl("json/list"))))
-            self.__reply.finished.connect(self.__inspectorReplyFinished)
-    
-    def __inspectorReplyFinished(self):
-        """
-        Private slot handling the reply.
-        """
-        # used for pre Qt 5.11
-        result = str(self.__reply.readAll(), encoding="utf8")
-        
-        self.__reply.deleteLater()
-        self.__reply = None
-        
-        pageUrl = QUrl()
-        try:
-            index = _VIEWS.index(self.__view)
-        except ValueError:
-            index = -1
-        try:
-            clients = json.loads(result)
-            if len(clients) > index:
-                port = Preferences.getWebBrowser("WebInspectorPort")
-                inspectorUrl = QUrl("http://localhost:{0}".format(port))
-                
-                client = clients[index]
-                pageUrl = inspectorUrl.resolved(
-                    QUrl(client["devtoolsFrontendUrl"]))
-            self.load(pageUrl)
-            pushView(self)
-            self.show()
-        except json.JSONDecodeError:
-            # ignore silently
-            pass
+        self.page().setInspectedPage(self.__view.page())
     
     def inspectElement(self):
         """
@@ -147,19 +100,12 @@
         @return flag indicating the enabled state
         @rtype bool
         """
-        if qVersionTuple() < (5, 11, 0):
-            if not os.getenv("QTWEBENGINE_REMOTE_DEBUGGING"):
-                return False
-        
         from WebBrowser.WebBrowserWindow import WebBrowserWindow
         if not WebBrowserWindow.webSettings().testAttribute(
                 QWebEngineSettings.JavascriptEnabled):
             return False
         
-        if qVersionTuple() < (5, 11, 0):
-            return Preferences.getWebBrowser("WebInspectorEnabled")
-        else:
-            return True
+        return True
     
     def __loadFinished(self):
         """
--- a/eric6/eric6_browser.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/eric6_browser.py	Sun Jan 03 15:33:39 2021 +0100
@@ -66,8 +66,10 @@
         app.exec()
     sys.exit(100)
 
+from PyQt5.QtWebEngineCore import QWebEngineUrlScheme
+
 import Globals
-from Globals import AppInfo, qVersionTuple
+from Globals import AppInfo
 
 from E5Gui.E5Application import E5Application
 
@@ -161,15 +163,12 @@
     # set the library paths for plugins
     Startup.setLibraryPaths()
     
-    if qVersionTuple() >= (5, 12, 0):
-        from PyQt5.QtWebEngineCore import QWebEngineUrlScheme
-        scheme = QWebEngineUrlScheme(b"eric")
-        scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
-        scheme.setFlags(QWebEngineUrlScheme.SecureScheme |
-                        QWebEngineUrlScheme.ContentSecurityPolicyIgnored)
-        QWebEngineUrlScheme.registerScheme(scheme)
-    if "--qthelp" in sys.argv and qVersionTuple() >= (5, 12, 0):
-        from PyQt5.QtWebEngineCore import QWebEngineUrlScheme
+    scheme = QWebEngineUrlScheme(b"eric")
+    scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
+    scheme.setFlags(QWebEngineUrlScheme.SecureScheme |
+                    QWebEngineUrlScheme.ContentSecurityPolicyIgnored)
+    QWebEngineUrlScheme.registerScheme(scheme)
+    if "--qthelp" in sys.argv:
         scheme = QWebEngineUrlScheme(b"qthelp")
         scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
         scheme.setFlags(QWebEngineUrlScheme.SecureScheme)

eric ide

mercurial