# eric7.EricWidgets.EricTextSpinBox

Module implementing a spinbox with textual entries.

### Global Attributes

None

### Classes

EricTextSpinBox | Class implementing a spinbox with textual entries.

### Functions

None

## EricTextSpinBox

Class implementing a spinbox with textual entries.

### Derived from

QSpinBox

### Class Attributes

None

### Class Methods

None

### Methods

EricTextSpinBox | Constructor
addItem | Public method to add an item with item data.
currentIndex | Public method to retrieve the current index.
itemData | Public method to retrieve the data associated with an item.
textFromValue | Public method to convert a value to text.
valueFromText | Public method to convert a text to a value.

### Static Methods

None

#### EricTextSpinBox (Constructor)

EricTextSpinBox(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### EricTextSpinBox.addItem

addItem(txt, data=None)

Public method to add an item with item data.

txt
  text to be shown (string)
data
  associated data

#### EricTextSpinBox.currentIndex

currentIndex()

Public method to retrieve the current index.

Return:
  current index (integer)

#### EricTextSpinBox.itemData

itemData(index)

Public method to retrieve the data associated with an item.

index
  index of the item (integer)

Return:
  associated data

#### EricTextSpinBox.textFromValue

textFromValue(value)

Public method to convert a value to text.

value
  value to be converted (integer)

Return:
  text for the given value (string)

#### EricTextSpinBox.valueFromText

valueFromText(txt)

Public method to convert a text to a value.

txt
  text to be converted (string)

Return:
  value for the given text (integer)

Up