--- a/eric6/WebBrowser/QtHelp/QtHelpDocumentationDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/WebBrowser/QtHelp/QtHelpDocumentationDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -130,7 +130,7 @@ self.__pluginHelpDocuments, QtHelpDocumentationSelectionDialog.AddMode, self) - if dlg.exec() == QDialog.Accepted: + if dlg.exec() == QDialog.DialogCode.Accepted: documents = dlg.getData() if not documents: return @@ -170,7 +170,9 @@ ) continue - if len(self.documentsList.findItems(ns, Qt.MatchFixedString)): + if len(self.documentsList.findItems( + ns, Qt.MatchFlag.MatchFixedString + )): E5MessageBox.warning( self, self.tr("Add Documentation"), @@ -230,7 +232,7 @@ if self.documentsList.count(): self.documentsList.setCurrentRow( - 0, QItemSelectionModel.ClearAndSelect) + 0, QItemSelectionModel.SelectionFlag.ClearAndSelect) def hasDocumentationChanges(self): """ @@ -297,24 +299,26 @@ self.filtersList.addItems(sorted(self.__filterMap.keys())) for attr in helpEngineCore.filterAttributes(): QTreeWidgetItem(self.attributesList, [attr]) - self.attributesList.sortItems(0, Qt.AscendingOrder) + self.attributesList.sortItems(0, Qt.SortOrder.AscendingOrder) if selectedFiltersText or currentFilterText or selectedAttributesText: # restore the selected filters for txt in selectedFiltersText: - items = self.filtersList.findItems(txt, Qt.MatchExactly) + items = self.filtersList.findItems( + txt, Qt.MatchFlag.MatchExactly) for itm in items: itm.setSelected(True) # restore the current filter if currentFilterText: items = self.filtersList.findItems(currentFilterText, - Qt.MatchExactly) + Qt.MatchFlag.MatchExactly) if items: self.filtersList.setCurrentItem( - items[0], QItemSelectionModel.NoUpdate) + items[0], QItemSelectionModel.SelectionFlag.NoUpdate) # restore the selected attributes for txt in selectedAttributesText: - items = self.attributesList.findItems(txt, Qt.MatchExactly, 0) + items = self.attributesList.findItems( + txt, Qt.MatchFlag.MatchExactly, 0) for itm in items: itm.setSelected(True) elif self.__filterMap: @@ -335,9 +339,9 @@ for index in range(0, self.attributesList.topLevelItemCount()): itm = self.attributesList.topLevelItem(index) if itm.text(0) in checkedList: - itm.setCheckState(0, Qt.Checked) + itm.setCheckState(0, Qt.CheckState.Checked) else: - itm.setCheckState(0, Qt.Unchecked) + itm.setCheckState(0, Qt.CheckState.Unchecked) @pyqtSlot() def on_filtersList_itemSelectionChanged(self): @@ -365,7 +369,7 @@ newAtts = [] for index in range(0, self.attributesList.topLevelItemCount()): itm = self.attributesList.topLevelItem(index) - if itm.checkState(0) == Qt.Checked: + if itm.checkState(0) == Qt.CheckState.Checked: newAtts.append(itm.text(0)) self.__filterMap[customFilter] = newAtts @@ -386,7 +390,7 @@ None, self.tr("Add Filter"), self.tr("Filter name:"), - QLineEdit.Normal) + QLineEdit.EchoMode.Normal) if not customFilter: return @@ -395,7 +399,7 @@ self.filtersList.addItem(customFilter) itm = self.filtersList.findItems( - customFilter, Qt.MatchCaseSensitive)[0] + customFilter, Qt.MatchFlag.MatchCaseSensitive)[0] self.filtersList.setCurrentItem(itm) @pyqtSlot() @@ -424,7 +428,7 @@ if self.filtersList.count(): self.filtersList.setCurrentRow( - 0, QItemSelectionModel.ClearAndSelect) + 0, QItemSelectionModel.SelectionFlag.ClearAndSelect) @pyqtSlot() def on_removeAttributesButton_clicked(self):