Professional Documents
Culture Documents
Text()
4
Displays the caption of the label
setText()
Programmatically sets the caption
selectedText()
Displays the selected text from the label (The textInteractionFlag must be set to TextSelectableByMouse)
setBuddy()
Associates the label with any input widget
setWordWrap()
Enables or disables wrapping text in the label
tableByMouse)
QLineEdit Methods:
setAlignment() setText()
5
Aligns the text as per alignment constants Programmatically sets th
Qt.AlignLeft
1
Qt.AlignRight clear()
6
Qt.AlignCenter Erases the contents
Qt.AlignJustify
setReadOnly()
7
text() Makes the text box non-e
2
Retrieves text in the field
setInputMask()
8
setMaxLength() Applies mask of combina
3
Sets the maximum number of characters for input
setFont()
9
setValidator() Displays the contents QF
4
Sets the validation rules. Available validators are
QIntValidator − Restricts input to integer
QDoubleValidator − Fraction part of number limited to specified decimals
QRegexpValidator − Checks input against a Regex expression
SIGNALS
setEchoMode()
Controls the appearance of the text inside the box. Echomode values are −
QLineEdit.Normal
QLineEdit.NoEcho
QLineEdit.Password
QLineEdit.PasswordEchoOnEdit
editingFinished()
When you press 'Enter' or the field loses focus
textChanged()
As text in the box changes either by input or by programmatic means
setText()
Programmatically sets the caption
setReadOnly()
Makes the text box non-editable
setInputMask()
Applies mask of combination of characters for input
setFont()
Displays the contents QFont object
leWidget.