# eric6.UI.SymbolsWidget

Module implementing a widget to select a symbol in various formats.

### Global Attributes

None

### Classes

SymbolsModel | Class implementing the model for the symbols widget.
SymbolsWidget | Class implementing a widget to select a symbol in various formats.

### Functions

None

## SymbolsModel

Class implementing the model for the symbols widget.

### Derived from

QAbstractTableModel

### Class Attributes

None

### Class Methods

None

### Methods

SymbolsModel | Constructor
__isDigit | Private method to check, if a character is a digit.
__isLetter | Private method to check, if a character is a letter.
__isMark | Private method to check, if a character is a mark character.
__isPunct | Private method to check, if a character is a punctuation character.
__isSymbol | Private method to check, if a character is a symbol.
columnCount | Public method to get the number of columns of the model.
data | Public method to get data from the model.
getLocale | Public method to get the used locale.
getTableBoundaries | Public method to get the first and last character position of the given table.
getTableIndex | Public method to get the current table index.
getTableNames | Public method to get a list of table names.
headerData | Public method to get header data from the model.
rowCount | Public method to get the number of rows of the model.
selectTable | Public method to select the shown character table.

### Static Methods

None

#### SymbolsModel (Constructor)

SymbolsModel(parent=None)

Constructor

parent
  reference to the parent object (QObject)

#### SymbolsModel.__isDigit

__isDigit(char)

Private method to check, if a character is a digit.

char
  character to test (one character string)

Returns:
  flag indicating a digit (boolean)

#### SymbolsModel.__isLetter

__isLetter(char)

Private method to check, if a character is a letter.

char
  character to test (one character string)

Returns:
  flag indicating a letter (boolean)

#### SymbolsModel.__isMark

__isMark(char)

Private method to check, if a character is a mark character.

char
  character to test (one character string)

Returns:
  flag indicating a mark character (boolean)

#### SymbolsModel.__isPunct

__isPunct(char)

Private method to check, if a character is a punctuation character.

char
  character to test (one character string)

Returns:
  flag indicating a punctuation character (boolean)

#### SymbolsModel.__isSymbol

__isSymbol(char)

Private method to check, if a character is a symbol.

char
  character to test (one character string)

Returns:
  flag indicating a symbol (boolean)

#### SymbolsModel.columnCount

columnCount(parent)

Public method to get the number of columns of the model.

parent
  parent index (QModelIndex)

Returns:
  number of columns (integer)

#### SymbolsModel.data

data(index, role=Qt.DisplayRole)

Public method to get data from the model.

index
  index to get data for (QModelIndex)
role
  role of the data to retrieve (integer)

Returns:
  requested data

#### SymbolsModel.getLocale

getLocale()

Public method to get the used locale.

Returns:
  used locale

Return Type:
  QLocale

#### SymbolsModel.getTableBoundaries

getTableBoundaries(index)

Public method to get the first and last character position of the given table.

index
  index of the character table (integer)

Returns:
  first and last character position (integer, integer)

#### SymbolsModel.getTableIndex

getTableIndex()

Public method to get the current table index.

Returns:
  current table index (integer)

#### SymbolsModel.getTableNames

getTableNames()

Public method to get a list of table names.

Returns:
  list of table names (list of strings)

#### SymbolsModel.headerData

headerData(section, orientation, role=Qt.DisplayRole)

Public method to get header data from the model.

section
  section number (integer)
orientation
  orientation (Qt.Orientation)
role
  role of the data to retrieve (integer)

Returns:
  requested data

#### SymbolsModel.rowCount

rowCount(parent)

Public method to get the number of rows of the model.

parent
  parent index (QModelIndex)

Returns:
  number of columns (integer)

#### SymbolsModel.selectTable

selectTable(index)

Public method to select the shown character table.

index
  index of the character table (integer)

Up

## SymbolsWidget

Class implementing a widget to select a symbol in various formats.

### Signals

insertSymbol(str)
  emitted after the user has selected a symbol

### Derived from

QWidget, Ui_SymbolsWidget

### Class Attributes

None

### Class Methods

None

### Methods

SymbolsWidget | Constructor
__currentRowChanged | Private slot recording the currently selected row.
on_symbolSpinBox_editingFinished | Private slot to move the table to the entered symbol id.
on_symbolsTable_activated | Private slot to signal the selection of a symbol.
on_tableCombo_currentIndexChanged | Private slot to select the current character table.

### Static Methods

None

#### SymbolsWidget (Constructor)

SymbolsWidget(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### SymbolsWidget.__currentRowChanged

__currentRowChanged(current, previous)

Private slot recording the currently selected row.

current
  current index (QModelIndex)
previous
  previous current index (QModelIndex)

#### SymbolsWidget.on_symbolSpinBox_editingFinished

on_symbolSpinBox_editingFinished()

Private slot to move the table to the entered symbol id.

#### SymbolsWidget.on_symbolsTable_activated

on_symbolsTable_activated(index)

Private slot to signal the selection of a symbol.

index
  index of the selected symbol (QModelIndex)

#### SymbolsWidget.on_tableCombo_currentIndexChanged

on_tableCombo_currentIndexChanged(index)

Private slot to select the current character table.

index
  index of the character table (integer)

Up