# eric6.E5Gui.E5LineEdit

Module implementing specialized line edits.

### Global Attributes

None

### Classes

E5ClearableLineEdit | Class implementing a line edit widget showing some inactive text and a clear button, if it has some contents.
E5LineEdit | Class implementing a line edit widget showing some inactive text.
E5LineEditSideWidget | Class implementing the side widgets for the line edit class.

### Functions

None

## E5ClearableLineEdit

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

### Derived from

E5LineEdit

### Class Attributes

None

### Class Methods

None

### Methods

E5ClearableLineEdit | Constructor
__textChanged | Private slot to handle changes of the text.

### Static Methods

None

#### E5ClearableLineEdit (Constructor)

E5ClearableLineEdit(parent=None, inactiveText="", side=E5LineEdit.RightSide)

Constructor

parent
  reference to the parent widget (QWidget)
inactiveText=
  text to be shown on inactivity (string)
side=
  side the clear button should be shown at (E5LineEdit.RightSide, E5LineEdit.LeftSide)

#### E5ClearableLineEdit.__textChanged

__textChanged(txt)

Private slot to handle changes of the text.

txt
  text (string)

Up

## E5LineEdit

Class implementing a line edit widget showing some inactive text.

### Derived from

QLineEdit

### Class Attributes

LeftSide
RightSide

### Class Methods

None

### Methods

E5LineEdit | 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.
inactiveText | Public method to get the inactive text.
leftMargin | Public method to get the size of the left margin.
paintEvent | Protected method handling a paint event.
removeWidget | Public method to remove a widget from a side.
setInactiveText | Public method to set the inactive text.
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

#### E5LineEdit (Constructor)

E5LineEdit(parent=None, inactiveText="")

Constructor

parent
  reference to the parent widget (QWidget)
inactiveText
  text to be shown on inactivity (string)

#### E5LineEdit._updateTextMargins

_updateTextMargins()

Protected slot to update the text margins.

#### E5LineEdit.addWidget

addWidget(widget, position)

Public method to add a widget to a side.

widget
  reference to the widget to add (QWidget)
position
  position to add to (E5LineEdit.LeftSide, E5LineEdit.RightSide)

#### E5LineEdit.event

event(evt)

Public method to handle events.

evt
  reference to the event (QEvent)

Returns:
  flag indicating, whether the event was recognized (boolean)

#### E5LineEdit.inactiveText

inactiveText()

Public method to get the inactive text.

Returns:
  inactive text (string)

#### E5LineEdit.leftMargin

leftMargin()

Public method to get the size of the left margin.

Returns:
  left margin in pixel (integer)

#### E5LineEdit.paintEvent

paintEvent(evt)

Protected method handling a paint event.

evt
  reference to the paint event (QPaintEvent)

#### E5LineEdit.removeWidget

removeWidget(widget)

Public method to remove a widget from a side.

widget
  reference to the widget to remove (QWidget)

#### E5LineEdit.setInactiveText

setInactiveText(inactiveText)

Public method to set the inactive text.

inactiveText
  text to be shown on inactivity (string)

#### E5LineEdit.setLeftMargin

setLeftMargin(margin)

Public method to set the left margin.

margin
  left margin in pixel (integer)

#### E5LineEdit.setWidgetSpacing

setWidgetSpacing(spacing)

Public method to set the side widget spacing.

spacing
  side widget spacing (integer)

#### E5LineEdit.textMargin

textMargin(position)

Public method to get the text margin for a side.

position
  side to get margin for (E5LineEdit.LeftSide, E5LineEdit.RightSide)

Returns:
  text margin (integer)

#### E5LineEdit.widgetSpacing

widgetSpacing()

Public method to get the side widget spacing.

Returns:
  side widget spacing (integer)

Up

## E5LineEditSideWidget

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

E5LineEditSideWidget | Constructor
event | Public method to handle events.

### Static Methods

None

#### E5LineEditSideWidget (Constructor)

E5LineEditSideWidget(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### E5LineEditSideWidget.event

event(evt)

Public method to handle events.

evt
  reference to the event (QEvent)

Returns:
  flag indicating, whether the event was recognized (boolean)

Up