User Tools

Site Tools


DzLineEdit

Script wrapper for QLineEdit.

More...

Inherits :

Enumerations

Properties

Constructors

DAZ Script
DzLineEdit ( DzWidget parent )

Methods

DAZ Script
voidbackspace ()
voidclear ()
voidclearModified ()
voidcopy ()
voidcursorBackward ( Boolean mark=false, Number steps=1 )
voidcursorForward ( Boolean mark=false, Number steps=1 )
voidcursorWordBackward ( Boolean mark=false, Number steps=1 )
voidcursorWordForward ( Boolean mark=false, Number steps=1 )
voidcut ()
voiddel ()
voiddeselect ()
voidend ( Boolean mark=false )
DzSettingsgetValidatorSettings ()
BooleanhasAcceptableInput ()
BooleanhasSelectedText ()
voidhome ( Boolean mark=false )
voidpaste ()
voidredo ()
voidselectAll ()
StringselectedText ()
NumberselectionStart ()
voidsetDoubleValidator ( Number bottom, Number top, Number decimals, Boolean scientific=false )
voidsetIntValidator ( Number minimum, Number maximum )
voidsetRegExValidator ( String rx, Boolean caseSensitive=true )
voidsetSelection ( Number start, Number length )
voidsetValidator ( DzSettings settings )
voidundo ()

Signals

voidcursorPositionChanged ( Number oldPos, Number newPos )
voideditingFinished ()
voidreturnPressed ()
voidselectionChanged ()
voidtextChanged ( String text )
voidtextEdited ( String text )

Detailed Description

Provides a single line text editor to the user.

Enumerations


: EchoMode

Enumerated values for describing how a line edit should display its contents.

Since:

  • 4.6.2.50
  • Normal - Display characters as they are entered.
  • NoEcho - Do not display anything. This may be appropriate for passwords where even the length of the password should be kept secret.
  • Password - Display asterisks instead of the characters actually entered.
  • PasswordEchoOnEdit - Display characters as they are entered while editing otherwise display asterisks.

Properties


Boolean : acceptableInput

Holds whether or not the input satisfies the inputMask and the validator. (Read Only)

Since:

  • 4.6.2.50

DzWidget::AlignmentFlags : alignment

Holds the alignment of the text displayed in the editor.


Number : cursorPosition

Holds the position of the cursor in the editor.


EchoMode : echoMode

Holds the value that determines how the text entered is displayed to the user.

Since:

  • 4.6.2.50

Boolean : frame

Holds whether or not the editor is drawn with a frame.


Boolean : hasSelectedText

Holds whether or not text is selected. (Read Only)

Since:

  • 4.6.2.50

String : inputMask

Holds the input mask for the editor. Set this to an empty string to clear the input mask.


Number : maxLength

Holds the maximum length of the text in the editor.


Boolean : modified

Holds whether or not the text in the editor has been modified. (Read Only < 4.9.3.93)


String : placeholderText

Holds the text string displayed in the editor when its text string is empty.

Since:

  • 4.6.2.50

Boolean : readOnly

Holds whether or not the text in the editor can be edited by the user.


Boolean : redoAvailable

Holds whether or not a redo operation is available. (Read Only)

Since:

  • 4.6.2.50

String : selectedText

Holds the selected text (if any) of the editor.

Since:

  • 4.6.2.50

String : text

Holds the text value of the editor.


Boolean : undoAvailable

Holds whether or not an undo operation is available. (Read Only)

Since:

  • 4.6.2.50

Constructors


DzLineEdit( DzWidget parent )

Creates a line edit as a child of the given parent widget.

Parameter(s):

  • parent - The widget parent for the editor.

Methods


void : backspace()

If text is currently selected, it will be deleted and the cursor moved to the beginning of the selection. If no text is selected, the cursor will be moved one character to the left and the character will be deleted.


void : clear()

Clears the text in the editor.


void : clearModified()

Deprecated

Exists only to keep old code working. Do not use in new code. Use the modified property instead.


void : copy()

Copies the selected text into the clipboard.


void : cursorBackward( Boolean mark=false, Number steps=1 )

Moves the cursor backward the given number of characters.

Parameter(s):

  • mark - If true, each character that is stepped over will be added to the current selection.
  • steps - The number of characters to move the cursor.

void : cursorForward( Boolean mark=false, Number steps=1 )

Moves the cursor forward the given number of characters.

Parameter(s):

  • mark - If true, each character that is stepped over will be added to the current selection.
  • steps - The number of characters to move the cursor.

void : cursorWordBackward( Boolean mark=false, Number steps=1 )

Moves the cursor backward one word.

Parameter(s):

  • mark - If true, the word will be added to the current selection.
  • steps - The number of words to move the cursor. (since 4.9.3.93)

void : cursorWordForward( Boolean mark=false, Number steps=1 )

Moves the cursor forward one word.

Parameter(s):

  • mark - If true, the word will be added to the current selection.
  • steps - The number of words to move the cursor. (since 4.9.3.93)

void : cut()

Copies the selected text into the clipboard and removes it from the editor.


void : del()

If text is currently selected, it will be deleted and the cursor moved to the beginning of the selection. If no text is selected, the character to the right of the cursor will be deleted.


void : deselect()

Clears any selection in the editor.


void : end( Boolean mark=false )

Moves the cursor to the end of the line.

Parameter(s):

  • mark - If true, the text from the cursor's previous position to the end of the line will be added to the current selection.

DzSettings : getValidatorSettings()

Return Value:

  • The settings for the validator (if any) set on this line edit, otherwise null.

Since:

  • 4.12.1.97

Boolean : hasAcceptableInput()

Return Value:

  • true if the input satisfies the inputMask and the validator, otherwise false.

Boolean : hasSelectedText()

Return Value:

  • true if some or all of the text in the editor is selected, otherwise false.

void : home( Boolean mark=false )

Moves the cursor to the beginning of the line.

Parameter(s):

  • mark - If true, the text from the beginning of the line to the cursor's previous position will be added to the current selection.

void : paste()

Inserts any text on the clipboard into the line at the cursor's current position.


void : redo()

If redoAvailable is true, redoes the next operation in the editor.


void : selectAll()

Selects all the text in the editor.


String : selectedText()

Return Value:

  • The currently selected text (if any) in the editor.

Number : selectionStart()

Return Value:

  • The position in the editor where the current selection begins.

void : setDoubleValidator( Number bottom, Number top, Number decimals, Boolean scientific=false )

Causes this line edit to only accept characters that represent double precision floating point (decimal) numbers.

Parameter(s):

  • bottom - The minimum acceptable value.
  • top - The maximum acceptable value.
  • decimals - The maximum number of digits after the decimal point to allow.
  • scientific - If true, the text of the editor is expressed in scientific form; i.e., it may have an exponent part; i.e., 1.5E-2. If false (default), the text of the editor is expressed as a standard number; i.e., 0.015.

Since:

  • 4.6.2.50

void : setIntValidator( Number minimum, Number maximum )

Causes this line edit to only accept characters that represent whole numbers (integers).

Parameter(s):

  • minimum - The minimum acceptable value.
  • maximum - The maximum acceptable value.

Since:

  • 4.6.2.50

void : setRegExValidator( String rx, Boolean caseSensitive=true )

Causes this line edit to only accept characters that satisfy a Regular Expression.

Parameter(s):

  • regx - The Regular Expression to use.
  • caseSensitive - If true (default), the expression is case sensitive.

Since:

  • 4.6.2.50

void : setSelection( Number start, Number length )

Sets the selected portion of the text in the editor.

Parameter(s):

  • start - The position to start the selection from.
  • length - The number of characters from start to select.

void : setValidator( DzSettings settings )

Causes this line edit to only accept characters that satisfy a validator configured with a settings object.

Parameter(s):

  • settings - The settings to use in choosing and configuring the validator. The settings must contain a string value named “validator” that provides the type of validator to set. Valid types are: float, int, regexp, subpath, filename, nodename, nodelabel.

Attention:

Since:

  • 4.12.1.97

void : undo()

If undoAvailable is true, undoes the last operation in the editor.

Signals


void : cursorPositionChanged( Number oldPos, Number newPos )

Signature:“cursorPositionChanged(int, int)”

Emitted when the current position changes.

Since:

  • 4.6.2.50

void : editingFinished()

Signature:“editingFinished()”

Emitted when the [Return] or [Enter] key is pressed or the editor loses focus.

Since:

  • 4.6.2.50

void : returnPressed()

Signature:“returnPressed()”

Emitted when the user presses the [Return] key in the editor.


void : selectionChanged()

Signature:“selectionChanged()”

Emitted when the selected text in the editor changes.


void : textChanged( String text )

Signature:“textChanged(const QString&)”

Emitted when the text of the editor changes, passes the new text.


void : textEdited( String text )

Signature:“textEdited(const QString&)”

Emitted when the text edited, passes the new text.

Since:

  • 4.6.2.50