PrintRemover/ConfigurationPage/PrintRemoverPage.py

branch
eric7
changeset 57
8e12947695cb
parent 54
d061dda35cef
child 59
79247c15c319
diff -r c14026de3d4c -r 8e12947695cb PrintRemover/ConfigurationPage/PrintRemoverPage.py
--- a/PrintRemover/ConfigurationPage/PrintRemoverPage.py	Mon May 31 17:36:21 2021 +0200
+++ b/PrintRemover/ConfigurationPage/PrintRemoverPage.py	Mon May 31 17:43:54 2021 +0200
@@ -9,10 +9,10 @@
 
 import os
 
-from PyQt5.QtCore import pyqtSlot
-from PyQt5.QtWidgets import QListWidgetItem, QInputDialog, QLineEdit
+from PyQt6.QtCore import pyqtSlot
+from PyQt6.QtWidgets import QListWidgetItem, QInputDialog, QLineEdit
 
-from E5Gui.E5Application import e5App
+from EricWidgets.EricApplication import ericApp
 
 from Preferences.ConfigurationPages.ConfigurationPageBase import (
     ConfigurationPageBase
@@ -31,19 +31,13 @@
         Constructor
         
         @param plugin reference to the plugin object
+        @type PrintRemoverPlugin
         """
         super().__init__()
         self.setupUi(self)
         self.setObjectName("PrintRemoverPage")
         
-        try:
-            usesDarkPalette = e5App().usesDarkPalette()
-        except AttributeError:
-            # for eric6 < 20.4
-            from PyQt5.QtGui import QPalette
-            palette = e5App().palette()
-            lightness = palette.color(QPalette.Window).lightness()
-            usesDarkPalette = lightness <= 128
+        usesDarkPalette = ericApp().usesDarkPalette()
         iconSuffix = "dark" if usesDarkPalette else "light"
         
         self.editButton.setIcon(UI.PixmapCache.getIcon(
@@ -111,7 +105,7 @@
             self,
             self.tr("Line Start Pattern"),
             self.tr("Enter a line start pattern:"),
-            QLineEdit.Normal,
+            QLineEdit.EchoMode.Normal,
             itm.text())
         if ok and pattern:
             itm.setText(pattern)
@@ -125,7 +119,7 @@
             self,
             self.tr("Line Start Pattern"),
             self.tr("Enter a line start pattern:"),
-            QLineEdit.Normal)
+            QLineEdit.EchoMode.Normal)
         if ok and pattern:
             itm = QListWidgetItem(pattern)
             if len(self.patternList.selectedItems()):
@@ -181,7 +175,8 @@
         """
         Private method to move the selected entry up or down.
         
-        @param moveUp flag indicating to move the entry up (boolean)
+        @param moveUp flag indicating to move the entry up
+        @type bool
         """
         itm = self.patternList.selectedItems()[0]
         row = self.patternList.row(itm)

eric ide

mercurial