RefactoringRope/HelpDialog.py

branch
eric7
changeset 365
f740b50380df
parent 347
b5048b5ff454
child 374
958f34e97952
diff -r a92b3272f4c1 -r f740b50380df RefactoringRope/HelpDialog.py
--- a/RefactoringRope/HelpDialog.py	Wed May 26 17:53:08 2021 +0200
+++ b/RefactoringRope/HelpDialog.py	Wed May 26 19:07:42 2021 +0200
@@ -7,15 +7,16 @@
 Module implementing a dialog to show help about rope.
 """
 
-from PyQt5.QtCore import Qt
-from PyQt5.QtGui import QTextDocument, QTextCursor
-from PyQt5.QtWidgets import QDialog, QDialogButtonBox
+from PyQt6.QtCore import Qt
+from PyQt6.QtGui import QTextDocument, QTextCursor
+from PyQt6.QtWidgets import QDialog, QDialogButtonBox
 
 from .Ui_HelpDialog import Ui_HelpDialog
 
 import Globals
 
 
+# TODO: modify help dialog to use the eric7 EricTextEditSearchWidget
 class HelpDialog(QDialog, Ui_HelpDialog):
     """
     Class implementing a dialog to show help about rope.
@@ -33,10 +34,10 @@
         """
         QDialog.__init__(self, parent)
         self.setupUi(self)
-        self.setWindowFlags(Qt.Window)
+        self.setWindowFlags(Qt.WindowType.Window)
         
         self.searchButton = self.buttonBox.addButton(
-            self.tr("Search..."), QDialogButtonBox.ActionRole)
+            self.tr("Search..."), QDialogButtonBox.ButtonRole.ActionRole)
         self.__searchDlg = None
         
         if Globals.isWindowsPlatform():
@@ -84,7 +85,7 @@
         doc = self.helpEdit.document()
         cur = self.helpEdit.textCursor()
         
-        findFlags = QTextDocument.FindFlags()
+        findFlags = QTextDocument.FindFlag(0)
         if case:
             findFlags |= QTextDocument.FindCaseSensitively
         if word:
@@ -94,7 +95,7 @@
         
         if cur.hasSelection():
             cur.setPosition(backwards and cur.anchor() or cur.position(),
-                            QTextCursor.MoveAnchor)
+                            QTextCursor.MoveMode.MoveAnchor)
         newCur = doc.find(txt, cur, findFlags)
         if newCur.isNull():
             return False

eric ide

mercurial