# eric7.EricWidgets.EricLineEdit

Module implementing specialized line edits.

### Global Attributes

None

### Classes

EricClearableLineEdit | Class implementing a line edit widget showing some inactive text and a clear button, if it has some contents.
EricLineEdit | Class implementing a line edit widget showing some inactive text.
EricLineEditSide | Class defining the line edit sides.
EricLineEditSideWidget | Class implementing the side widgets for the line edit class.

### Functions

None

## EricClearableLineEdit

Class implementing a line edit widget showing some inactive text and a clear button, if it has some contents.

### Derived from

EricLineEdit

### Class Attributes

None

### Class Methods

None

### Methods

EricClearableLineEdit | Constructor

### Static Methods

None

#### EricClearableLineEdit (Constructor)

EricClearableLineEdit(parent=None, placeholderText="")

Constructor

parent (QWidget)
  reference to the parent widget
placeholderText (str)
  text to be shown on inactivity

Up

## EricLineEdit

Class implementing a line edit widget showing some inactive text.

### Derived from

QLineEdit

### Class Attributes

None

### Class Methods

None

### Methods

EricLineEdit | Constructor
_updateTextMargins | Protected slot to update the text margins.
addWidget | Public method to add a widget to a side.
event | Public method to handle events.
leftMargin | Public method to get the size of the left margin.
removeWidget | Public method to remove a widget from a side.
setLeftMargin | Public method to set the left margin.
setWidgetSpacing | Public method to set the side widget spacing.
textMargin | Public method to get the text margin for a side.
widgetSpacing | Public method to get the side widget spacing.

### Static Methods

None

#### EricLineEdit (Constructor)

EricLineEdit(parent=None, placeholderText="")

Constructor

parent (QWidget)
  reference to the parent widget
placeholderText (str)
  text to be shown on inactivity

#### EricLineEdit._updateTextMargins

_updateTextMargins()

Protected slot to update the text margins.

#### EricLineEdit.addWidget

addWidget(widget, position)

Public method to add a widget to a side.

widget (QWidget)
  reference to the widget to add
position (EricLineEditSide)
  position to add to

#### EricLineEdit.event

event(evt)

Public method to handle events.

evt (QEvent)
  reference to the event

Return:
  flag indicating, whether the event was recognized

Return Type:
  bool

#### EricLineEdit.leftMargin

leftMargin()

Public method to get the size of the left margin.

Return:
  left margin in pixel

Return Type:
  int

#### EricLineEdit.removeWidget

removeWidget(widget)

Public method to remove a widget from a side.

widget (QWidget)
  reference to the widget to remove

#### EricLineEdit.setLeftMargin

setLeftMargin(margin)

Public method to set the left margin.

margin (int)
  left margin in pixel

#### EricLineEdit.setWidgetSpacing

setWidgetSpacing(spacing)

Public method to set the side widget spacing.

spacing (int)
  side widget spacing

#### EricLineEdit.textMargin

textMargin(position)

Public method to get the text margin for a side.

position (EricLineEditSide)
  side to get margin for

Return:
  text margin

Return Type:
  int

#### EricLineEdit.widgetSpacing

widgetSpacing()

Public method to get the side widget spacing.

Return:
  side widget spacing

Return Type:
  int

Up

## EricLineEditSide

Class defining the line edit sides.

### Derived from

enum.Enum

### Class Attributes

LEFT
RIGHT

### Class Methods

None

### Methods

None

### Static Methods

None

Up

## EricLineEditSideWidget

Class implementing the side widgets for the line edit class.

### Signals

sizeHintChanged()
  emitted to indicate a change of the size hint

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

EricLineEditSideWidget | Constructor
event | Public method to handle events.

### Static Methods

None

#### EricLineEditSideWidget (Constructor)

EricLineEditSideWidget(parent=None)

Constructor

parent (QWidget)
  reference to the parent widget

#### EricLineEditSideWidget.event

event(evt)

Public method to handle events.

evt (QEvent)
  reference to the event

Return:
  flag indicating, whether the event was recognized

Return Type:
  bool

Up