eric6/UI/FindFileNameDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
diff -r 27f636beebad -r 2c730d5fd177 eric6/UI/FindFileNameDialog.py
--- a/eric6/UI/FindFileNameDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/UI/FindFileNameDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -52,12 +52,14 @@
         self.fileList.headerItem().setText(self.fileList.columnCount(), "")
         
         self.stopButton = self.buttonBox.addButton(
-            self.tr("Stop"), QDialogButtonBox.ActionRole)
+            self.tr("Stop"), QDialogButtonBox.ButtonRole.ActionRole)
         self.stopButton.setToolTip(self.tr("Press to stop the search"))
         self.stopButton.setEnabled(False)
-        self.buttonBox.button(QDialogButtonBox.Open).setToolTip(
-            self.tr("Opens the selected file"))
-        self.buttonBox.button(QDialogButtonBox.Open).setEnabled(False)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Open).setToolTip(
+                self.tr("Opens the selected file"))
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Open).setEnabled(False)
         
         self.project = project
         self.extsepLabel.setText(os.extsep)
@@ -72,7 +74,9 @@
         """
         if button == self.stopButton:
             self.shouldStop = True
-        elif button == self.buttonBox.button(QDialogButtonBox.Open):
+        elif button == self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Open
+        ):
             self.__openFile()
     
     def __openFile(self, itm=None):
@@ -150,7 +154,8 @@
             
         del locations
         self.stopButton.setEnabled(False)
-        self.fileList.header().resizeSections(QHeaderView.ResizeToContents)
+        self.fileList.header().resizeSections(
+            QHeaderView.ResizeMode.ResizeToContents)
         self.fileList.header().setStretchLastSection(True)
         
         if found:
@@ -239,7 +244,7 @@
         @param current current item (QTreeWidgetItem)
         @param previous prevoius current item (QTreeWidgetItem)
         """
-        self.buttonBox.button(QDialogButtonBox.Open).setEnabled(
+        self.buttonBox.button(QDialogButtonBox.StandardButton.Open).setEnabled(
             current is not None)
         
     def show(self):

eric ide

mercurial