--- a/src/eric7/UI/SymbolsWidget.py Thu Dec 21 15:46:22 2023 +0100 +++ b/src/eric7/UI/SymbolsWidget.py Thu Dec 21 19:50:01 2023 +0100 @@ -39,7 +39,8 @@ """ Constructor - @param parent reference to the parent object (QObject) + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -296,7 +297,8 @@ """ Public method to get a list of table names. - @return list of table names (list of strings) + @return list of table names + @rtype list of str """ return [table[2] for table in self.__tables] @@ -305,8 +307,10 @@ Public method to get the first and last character position of the given table. - @param index index of the character table (integer) - @return first and last character position (integer, integer) + @param index index of the character table + @type int + @return first and last character position + @rtype tuple of (int, int) """ return self.__tables[index][0], self.__tables[index][1] @@ -314,7 +318,8 @@ """ Public method to get the current table index. - @return current table index (integer) + @return current table index + @rtype int """ return self.__currentTableIndex @@ -322,7 +327,8 @@ """ Public method to select the shown character table. - @param index index of the character table (integer) + @param index index of the character table + @type int """ self.beginResetModel() self.__currentTableIndex = index @@ -332,10 +338,14 @@ """ Public method to get header data from the model. - @param section section number (integer) - @param orientation orientation (Qt.Orientation) - @param role role of the data to retrieve (Qt.ItemDataRole) + @param section section number + @type int + @param orientation orientation + @type Qt.Orientation + @param role role of the data to retrieve + @type Qt.ItemDataRole @return requested data + @rtype Any """ if ( orientation == Qt.Orientation.Horizontal @@ -349,9 +359,12 @@ """ Public method to get data from the model. - @param index index to get data for (QModelIndex) - @param role role of the data to retrieve (integer) + @param index index to get data for + @type QModelIndex + @param role role of the data to retrieve + @type int @return requested data + @rtype Any """ symbolId = self.__tables[self.__currentTableIndex][0] + index.row() @@ -413,8 +426,10 @@ """ Public method to get the number of columns of the model. - @param parent parent index (QModelIndex) - @return number of columns (integer) + @param parent parent index + @type QModelIndex + @return number of columns + @rtype int """ if parent.column() > 0: return 0 @@ -425,8 +440,10 @@ """ Public method to get the number of rows of the model. - @param parent parent index (QModelIndex) - @return number of columns (integer) + @param parent parent index + @type QModelIndex + @return number of columns + @rtype int """ if parent.isValid(): return 0 @@ -438,8 +455,10 @@ """ Private method to check, if a character is a digit. - @param char character to test (one character string) - @return flag indicating a digit (boolean) + @param char character to test + @type str + @return flag indicating a digit + @rtype bool """ return unicodedata.category(str(char)) in ("Nd", "Nl", "No") @@ -447,8 +466,10 @@ """ Private method to check, if a character is a letter. - @param char character to test (one character string) - @return flag indicating a letter (boolean) + @param char character to test + @type str + @return flag indicating a letter + @rtype bool """ return unicodedata.category(str(char)) in ("Lu", "Ll", "Lt", "Lm", "Lo") @@ -456,8 +477,10 @@ """ Private method to check, if a character is a mark character. - @param char character to test (one character string) - @return flag indicating a mark character (boolean) + @param char character to test + @type str + @return flag indicating a mark character + @rtype bool """ return unicodedata.category(str(char)) in ("Mn", "Mc", "Me") @@ -465,8 +488,10 @@ """ Private method to check, if a character is a punctuation character. - @param char character to test (one character string) - @return flag indicating a punctuation character (boolean) + @param char character to test + @type str + @return flag indicating a punctuation character + @rtype boolean) """ return unicodedata.category(str(char)) in ( "Pc", @@ -482,8 +507,10 @@ """ Private method to check, if a character is a symbol. - @param char character to test (one character string) - @return flag indicating a symbol (boolean) + @param char character to test + @type str + @return flag indicating a symbol + @rtype bool """ return unicodedata.category(str(char)) in ("Sm", "Sc", "Sk", "So") @@ -510,7 +537,8 @@ """ Constructor - @param parent reference to the parent widget (QWidget) + @param parent reference to the parent widget + @type QWidget """ super().__init__(parent) self.setupUi(self) @@ -554,7 +582,8 @@ """ Private slot to signal the selection of a symbol. - @param index index of the selected symbol (QModelIndex) + @param index index of the selected symbol + @type QModelIndex """ txt = self.__model.data(index) if txt: @@ -578,7 +607,8 @@ """ Private slot to select the current character table. - @param index index of the character table (integer) + @param index index of the character table + @type int """ self.symbolsTable.setUpdatesEnabled(False) self.__model.selectTable(index) @@ -596,8 +626,10 @@ """ Private slot recording the currently selected row. - @param current current index (QModelIndex) - @param previous previous current index (QModelIndex) + @param current current index + @type QModelIndex + @param previous previous current index + @type QModelIndex """ Preferences.getSettings().setValue("Symbols/Top", current.row()) self.symbolSpinBox.setValue(