VLineEdit

The VLineEdit is a widget that allow the user to enter and edit a single line of plain text.

Inherits: QLineEdit

Methods

Signals

Description

The VLineEdit is a widget that allow the user to enter and edit a single line of plain text.

The line edit area can have a set of three buttons, one button for reset the line to the last state with setResetButton, one button to show the historic with setHistoricButton and one command button used to execute an action related to the entry with setCommandButton.

The line edit area may have also an informative text with setInformativeText.

_images/vlineedit.png

Documentation

Methods

__init__(parent=None)

Instanciate the VLineEdit.

Arguments:

  • parent The parent of the VLineEdit.
add_historic_entry(entry)

Add an item into the historic. Since the historic is a stack, the entry is added at index 0.

Arguments:

  • entry A str() or QString() instance

Raise TypeError if the argument is not string.

add_historic_entries(entries, clear=False)

Add a list of items into the historic. Since the historic is a stack, the list is added at the beggining of the historic.

Arguments:

  • entries A list of str()
  • clear If True, the historic is cleared before adding the entries.
clear_historic()
Removes all items from the historic.
get_historic_entries()

Returns the list of the historic’s items.

Type: list()

getOrientation()

Returns the orientation of the button’s layout.

Type: Qt.LayoutDirection

See: setOrientation

hasCommandButton()

Returns True if the VLineEdit has a command button, otherwise returns False.

Type: Boolean

See: setCommandButton

hasHistoricButton()

Returns True if the VLineEdit has a historic button, otherwise returns False.

Type: Boolean

See: setHistoricButton

hasResetButton()

Returns True if the VLineEdit has a reset button, otherwise returns False.

Type: Boolean

See: setResetButton

informativeText()

Returns the informative text.

Type: QString()

See: setInformativeText

setCommandButton(b)

Sets the command button.

The command button may be used for any action related with the entry, like ‘Go to this page’, ‘Search for this item’, etc.

The VLineEdit emit a signal commandTriggered when clicked.

This property can be defined in the Qt Designer.

Arguments:
  • b Boolean

Raise TypeError if the argument is not boolean.

See: hasCommandButton

set_command_icon(icon)

Sets the command button icon.

Arguments:

  • icon A QIcon or a QPixmap instance or an image file path.

Raise NameError if the VLineEdit has no command button.

setHistoricButton(b)

Sets the historic button.

The VLineEdit emit a signal historicTriggered when clicked.

This property can be defined in the Qt Designer.

Arguments:

  • b Boolean

Raise TypeError if the argument is not boolean.

See: hasHistoricButton

setInformativeText(txt)

Sets the informative text.

This property can be defined in the Qt Designer.

Arguments:

  • txt str() or QString() instance.

Raise TypeError if the argument is not string.

See: informativeText

setOrientation(orientation)

Sets the orientation of the buttons.

This property can be defined in the Qt Designer.

Arguments:

  • orientation Qt.LayoutDirection

Raise ValueError if the argument is not a Qt.LayoutDirection.

See: getOrientation

setResetButton(b)

Set the reset button.

The reset button is used to reset the text line to the previous state.

The VLineEdit emit a signal resetTriggered when clicked.

This property can be defined in the Qt Designer.

Arguments:

  • b Boolean

Raise TypeError if the argument is not boolean.

See: hasResetButton

set_reset_icon(icon)

Sets the reset button icon.

Arguments:

  • icon A QIcon or a QPixmap instance or an image file path.

Raise NameError if the VLineEdit has no reset button.

Signals

commandTriggered(str)

This signal is sent whenever the user click on the button command.

Arguments:

  • str The text edited.
historicTriggered()
This signal is sent whenever the user click on the button historic.
resetTriggered()
This signal is sent whenever the user click on the button reset.

Table Of Contents

Previous topic

VColorComboBox

Next topic

VToolHeader

This Page