--- a/eric6/Preferences/ConfigurationPages/EditorHighlightersPage.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Preferences/ConfigurationPages/EditorHighlightersPage.py Tue Mar 02 17:17:09 2021 +0100 @@ -37,8 +37,8 @@ self.editorLexerList.headerItem().setText( self.editorLexerList.columnCount(), "") header = self.editorLexerList.header() - header.setSectionResizeMode(QHeaderView.ResizeToContents) - header.setSortIndicator(0, Qt.AscendingOrder) + header.setSectionResizeMode(QHeaderView.ResizeMode.ResizeToContents) + header.setSortIndicator(0, Qt.SortOrder.AscendingOrder) try: self.extsep = os.extsep @@ -60,7 +60,7 @@ lexerAssocs = Preferences.getEditorLexerAssocs() for ext in lexerAssocs: QTreeWidgetItem(self.editorLexerList, [ext, lexerAssocs[ext]]) - self.editorLexerList.sortByColumn(0, Qt.AscendingOrder) + self.editorLexerList.sortByColumn(0, Qt.SortOrder.AscendingOrder) def save(self): """ @@ -90,7 +90,7 @@ lexer = "Pygments|{0}".format(pygmentsLexer) if ext and lexer: itmList = self.editorLexerList.findItems( - ext, Qt.MatchFlags(Qt.MatchExactly), 0) + ext, Qt.MatchFlags(Qt.MatchFlag.MatchExactly), 0) if itmList: index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) itm = self.editorLexerList.takeTopLevelItem(index) @@ -158,13 +158,15 @@ """ self.on_editorLexerList_itemClicked(itm, column) - @pyqtSlot(str) - def on_editorLexerCombo_currentIndexChanged(self, text): + @pyqtSlot(int) + def on_editorLexerCombo_currentIndexChanged(self, index): """ Private slot to handle the selection of a lexer. - @param text text of the lexer combo (string) + @param index index of the current item + @type int """ + text = self.editorLexerCombo.itemText(index) if text in self.extras: self.pygmentsLexerCombo.setEnabled(True) self.pygmentsLabel.setEnabled(True)