decorated_line_edit

class camelot.view.controls.decorated_line_edit.DecoratedLineEdit(parent=None)[source]

A QLineEdit with additional decorations :

  • a background text, visible when the line edit doesn’t contain any text
  • a validity, which will trigger the background color

Use the user_input method to get the text that was entered by the user.

Note : since QT 4.7 the background text could be replaced with the setPlaceholderText on a QLineEdit

set_background_text(background_text)[source]

Set the text to be displayed in the background when the line input does not contain any text :param background_text: the text to be shown, None if no text should be shown

set_minimum_width(width)[source]

Set the minimum width of the line edit, measured in number of characters. Use a number of characters the content of the editor is unknown, but a sample string can be used if the input pattern is known (such as a formatted date or a code) for greater accuracy.

Parameters:width – the number of characters that should be visible in the editor or a string that should fit in the editor
set_valid(valid)[source]

Set the validity of the current content of the line edit :param valid: True or False

Previous topic

combobox_input_dialog

Next topic

delegates

This Page