User Tools

Site Tools


DzLineEdit

DAZScript 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 )
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 )
voidundo ()

Signals

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

Detailed Description

This class provides a single line text editor.

Enumerations


: EchoMode

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

  • 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)


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.


Boolean : frame

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


Boolean : hasSelectedText

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


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.


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)


String : selectedText

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


String : text

Holds the text value of the editor.


Boolean : undoAvailable

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

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.

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.

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.

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.

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 : 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.


void : editingFinished()

Signature:“editingFinished()”

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


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.