diff -r 27f636beebad -r 2c730d5fd177 eric6/UI/Browser.py --- a/eric6/UI/Browser.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/UI/Browser.py Tue Mar 02 17:17:09 2021 +0100 @@ -104,7 +104,7 @@ self._activating = False - self.setContextMenuPolicy(Qt.CustomContextMenu) + self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.customContextMenuRequested.connect(self._contextMenuRequested) self.activated.connect(self._openItem) self.expanded.connect(self._resizeColumns) @@ -167,14 +167,16 @@ self.setAlternatingRowColors(True) header = self.header() - header.setSortIndicator(0, Qt.AscendingOrder) + header.setSortIndicator(0, Qt.SortOrder.AscendingOrder) header.setSortIndicatorShown(True) header.setSectionsClickable(True) self.setSortingEnabled(True) - self.setSelectionMode(QAbstractItemView.ExtendedSelection) - self.setSelectionBehavior(QAbstractItemView.SelectRows) + self.setSelectionMode( + QAbstractItemView.SelectionMode.ExtendedSelection) + self.setSelectionBehavior( + QAbstractItemView.SelectionBehavior.SelectRows) self.header().setStretchLastSection(True) self.headerSize0 = 0 @@ -382,8 +384,8 @@ if index.isValid(): self.setCurrentIndex(index) flags = QItemSelectionModel.SelectionFlags( - QItemSelectionModel.ClearAndSelect | - QItemSelectionModel.Rows) + QItemSelectionModel.SelectionFlag.ClearAndSelect | + QItemSelectionModel.SelectionFlag.Rows) self.selectionModel().select(index, flags) itm = self.model().item(index) @@ -862,7 +864,7 @@ self, self.tr("New Directory"), self.tr("Name for new directory:"), - QLineEdit.Normal) + QLineEdit.EchoMode.Normal) if ok and bool(newName): dirpath = os.path.join(dname, newName) if os.path.exists(dirpath): @@ -895,7 +897,7 @@ self, self.tr("New File"), self.tr("Name for new file:"), - QLineEdit.Normal) + QLineEdit.EchoMode.Normal) if ok and bool(fname): filepath = os.path.join(dname, fname) if os.path.exists(filepath): @@ -953,7 +955,7 @@ self.tr("Delete File"), trashMsg, [fn]) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: try: s2t(fn) except OSError as err: @@ -990,7 +992,7 @@ self.tr("Delete Directory"), trashMsg, [dn]) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: try: if s2tAvailable: send2trash(dn) @@ -1035,7 +1037,7 @@ trashMsg, sorted(fileNames) ) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: for fn in fileNames: try: s2t(fn)