# 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 (QWidget)
  reference to the parent widget

#### EricTextSpinBox.addItem

addItem(txt, data=None)

Public method to add an item with item data.

txt (str)
  text to be shown
data (Any)
  associated data

#### EricTextSpinBox.currentIndex

currentIndex()

Public method to retrieve the current index.

Return:
  current index

Return Type:
  int

#### EricTextSpinBox.itemData

itemData(index)

Public method to retrieve the data associated with an item.

index (int)
  index of the item

Return:
  associated data

Return Type:
  Any

#### EricTextSpinBox.textFromValue

textFromValue(value)

Public method to convert a value to text.

value (int)
  value to be converted

Return:
  text for the given value

Return Type:
  str

#### EricTextSpinBox.valueFromText

valueFromText(txt)

Public method to convert a text to a value.

txt (str)
  text to be converted

Return:
  value for the given text

Return Type:
  int

Up