eric6/Project/LexerAssociationDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/Project/LexerAssociationDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Project/LexerAssociationDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -32,8 +32,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
@@ -61,7 +61,7 @@
         self.project = project
         for ext, lexer in list(self.project.pdata["LEXERASSOCS"].items()):
             QTreeWidgetItem(self.editorLexerList, [ext, lexer])
-        self.editorLexerList.sortByColumn(0, Qt.AscendingOrder)
+        self.editorLexerList.sortByColumn(0, Qt.SortOrder.AscendingOrder)
     
     @pyqtSlot()
     def on_addLexerButton_clicked(self):
@@ -80,7 +80,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)
@@ -148,13 +148,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 line edit (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)

eric ide

mercurial