--- a/eric6/VirtualEnv/VirtualenvManagerDialog.py Sat Mar 06 10:00:52 2021 +0100 +++ b/eric6/VirtualEnv/VirtualenvManagerDialog.py Sun Mar 28 15:00:11 2021 +0200 @@ -23,10 +23,10 @@ Class implementing a dialog to manage the list of defined virtual environments. """ - IsGlobalRole = Qt.UserRole + 1 - IsCondaRole = Qt.UserRole + 2 - IsRemoteRole = Qt.UserRole + 3 - ExecPathRole = Qt.UserRole + 4 + IsGlobalRole = Qt.ItemDataRole.UserRole + 1 + IsCondaRole = Qt.ItemDataRole.UserRole + 2 + IsRemoteRole = Qt.ItemDataRole.UserRole + 3 + ExecPathRole = Qt.ItemDataRole.UserRole + 4 def __init__(self, manager, parent=None): """ @@ -54,7 +54,7 @@ self.__populateVenvList() self.__updateButtons() - self.venvList.header().setSortIndicator(0, Qt.AscendingOrder) + self.venvList.header().setSortIndicator(0, Qt.SortOrder.AscendingOrder) def __updateButtons(self): """ @@ -111,7 +111,7 @@ self.__manager, baseDir=self.envBaseDirectoryPicker.text() ) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: (venvName, venvDirectory, venvInterpreter, isGlobal, isConda, isRemote, execPath) = dlg.getData() @@ -145,7 +145,7 @@ selectedItem.data(0, VirtualenvManagerDialog.ExecPathRole), baseDir=self.envBaseDirectoryPicker.text() ) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: (venvName, venvDirectory, venvInterpreter, isGlobal, isConda, isRemote, execPath) = dlg.getData() if venvName != oldVenvName: @@ -234,7 +234,8 @@ # 4. re-establish selection for venvName in selectedVenvs: - itms = self.venvList.findItems(venvName, Qt.MatchExactly, 0) + itms = self.venvList.findItems( + venvName, Qt.MatchFlag.MatchExactly, 0) if itms: itms[0].setSelected(True) @@ -289,7 +290,7 @@ contents. """ self.venvList.header().resizeSections( - QHeaderView.ResizeToContents) + QHeaderView.ResizeMode.ResizeToContents) self.venvList.header().setStretchLastSection(True) def closeEvent(self, evt):