User Tools

Site Tools


DzComboEdit

A compound QLineEdit, QPushButton and QMenu widget.

More...

Inherits :

Properties

Constructors

DAZ Script
DzComboEdit ( DzWidget parent, Boolean updateOnSelect=true )

Methods

DAZ Script
voidaddItem ( String item, Boolean validate=true )
voidaddItems ( Array items, Boolean validate=true )
voidbackspace ()
voidclear ()
voidclearText ()
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 )
NumberfindItem ( String text )
DzSettingsgetValidatorSettings ()
BooleanhasAcceptableInput ()
BooleanhasSelectedText ()
voidhome ( Boolean mark=false )
voidinsertItem ( Number index, String item, Boolean validate=true )
voidinsertItems ( Number index, Array items, Boolean validate=true )
Arrayitems ()
voidpaste ()
voidredo ()
voidremoveItem ( String item )
voidselectAll ()
StringselectedText ()
NumberselectionStart ()
voidsetDoubleValidator ( Number bottom, Number top, Number decimals, Boolean scientific=false )
voidsetIntValidator ( Number bottom, Number top )
voidsetRegExValidator ( String rx, Boolean caseSensitive=true )
voidsetSelection ( Number start, Number length )
voidsetValidator ( DzSettings settings )
voidundo ()

Signals

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

Detailed Description

Provides a compound widget comprised of a line edit and a button that, when clicked, causes a menu to be displayed. Selecting one of the items in the popup menu causes the value of the editor to update with the text of the selected item by default.

See Also:

Properties


Boolean : acceptableInput

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

Since:

  • 4.12.0.80.

DzWidget::AlignmentFlags : alignment

Holds the alignment of the text displayed in the text field.

Since:

  • 4.12.0.80.

String : appendDelimiter

Holds the character(s) to detect in the text field as the delimiter between multiple values.

Since:

  • 4.15.0.15.

Number : cursorPosition

Holds the position of the cursor in the text field.

Since:

  • 4.12.0.80.

Boolean : holdModifierAppend

Holds whether holding the control modifier key causes the value of selection in the popup to be appended to the current text.

Since:

  • 4.15.0.15.

String : inputMask

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

Since:

  • 4.12.0.80.

Number : maxLength

Holds the maximum length of the text in the text field.

Since:

  • 4.12.0.80.

Boolean : menuSelectionIncludesPath

Holds whether clicking an item in the menu causes only its text (default - false), or the entire path (true), to be inserted into the field.

Since:

  • 4.11.0.226.

Boolean : modified

Holds whether the text in the text field has been modified.

Since:

  • 4.12.0.80.

String : placeholderText

Holds the text to display to the user when text is an empty string; e.g., a hint.


Boolean : readOnly

Holds whether the text field can be manually written to by the user.


Boolean : redoAvailable

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

Since:

  • 4.12.0.80.

Boolean : showClearButton

Holds whether to present a clear button to the user when there is text to clear.

Since:

  • 4.22.1.164.

String : submenuDelimiter

Holds the character(s) to detect in inserted items as the delimiter for constructing submenus.

Since:

  • 4.11.0.226.

String : text

Holds the text of the text field.


Boolean : undoAvailable

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

Since:

  • 4.12.0.80.

Boolean : usePathPopUp

Holds whether clicking the button causes a menu (default - false), or a treeview (true) to be displayed.

Constructors


DzComboEdit( DzWidget parent, Boolean updateOnSelect=true )

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

Parameter(s):

  • parent - The widget parent for this widget.
  • updateOnSelect - Whether the editor should automatically update when an item is selected.

Methods


void : addItem( String item, Boolean validate=true )

Adds an item with the given text to the list of options in the popup. The item is appended to the list of existing items.

Parameter(s):

  • item - The item to add. A separator can be created in a menu by using a single hyphen (“-”) character. Sub-menus can be created by using two consecutive greater than (“»”) characters as a delimiter between the entries of a given hierarchy.
  • validate - If true, causes the item to be checked for validity before being added to the list. (since 4.12.1.29)

See Also:


void : addItems( Array items, Boolean validate=true )

Adds each of the strings in the given list to the list of options in the popup. Each item is appended to the list of existing items in turn.

Parameter(s):

  • items - The list of items to add. Separators can be created in a menu by using a single hyphen (“-”) character. Sub-menus can be created by using two consecutive greater than (“»”) characters as a delimiter between the entries of a given hierarchy.
  • validate - If true, causes each item to be checked for validity before being added to the list. (since 4.12.1.29)

See Also:

Since:

  • 4.12.1.29

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.

Since:

  • 4.12.0.80

void : clear()

Removes all strings used to build the list of options in the popup.


void : clearText()

Clears the text in the editor.

Since:

  • 4.12.0.80

void : copy()

Copies the selected text into the clipboard.

Since:

  • 4.12.0.80

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.

Since:

  • 4.12.0.80

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.

Since:

  • 4.12.0.80

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.22.1.178)

Since:

  • 4.12.0.80

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.22.1.178)

Since:

  • 4.12.0.80

void : cut()

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

Since:

  • 4.12.0.80

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.

Since:

  • 4.12.0.80

void : deselect()

Clears any selection in the editor.

Since:

  • 4.12.0.80

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.

Since:

  • 4.12.0.80

Number : findItem( String text )

Search the list of items in the popup for the specified text. The search is not case sensitive.

Parameter(s):

  • text - The item text to find.

Return Value:

  • The index of the item that represents the given text (if any), otherwise -1.

DzSettings : getValidatorSettings()

Return Value:

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

Since:

  • 4.12.1.97

Boolean : hasAcceptableInput()

Return Value:

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

Since:

  • 4.12.0.80

Boolean : hasSelectedText()

Return Value:

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

Since:

  • 4.12.0.80

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.

Since:

  • 4.12.0.80

void : insertItem( Number index, String item, Boolean validate=true )

Inserts an item with the given text to the list of options in the popup at the given index.

Parameter(s):

  • index - The index to insert the item at. If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.
  • item - The item to insert. A separator can be created in a menu by using a single hyphen (“-”) character. Sub-menus can be created by using two consecutive greater than (“»”) characters as a delimiter between the entries of a given hierarchy.
  • validate - If true, causes the item to be checked for validity before being inserted into the list. (since 4.12.1.29)

See Also:


void : insertItems( Number index, Array items, Boolean validate=true )

Inserts each of the strings in the given list to the list of options in the popup at the given index. Each item is appended to the list of existing items, from the given index, in turn.

Parameter(s):

  • index - The index to insert the items at. If the index is equal to or higher than the total number of items, the new items are appended to the list of existing items. If the index is zero or negative, the new items are prepended to the list of existing items.
  • items - The list of items to insert. Separators can be created in a menu by using a single hyphen (“-”) character. Sub-menus can be created by using two consecutive greater than (“»”) characters as a delimiter between the entries of a given hierarchy.
  • validate - If true, causes each item to be checked for validity before being inserted into the list. (since 4.12.1.29)

See Also:


Array : items()

Return Value:

  • The list of strings used to build the list of options in the popup.

void : paste()

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

Since:

  • 4.12.0.80

void : redo()

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

Since:

  • 4.12.0.80

void : removeItem( String item )

Removes the specified item from the list of options in the popup.

Parameter(s):

  • item - The item to remove.

void : selectAll()

Selects all the text in the editor.

Since:

  • 4.12.0.80

String : selectedText()

Return Value:

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

Since:

  • 4.12.0.80

Number : selectionStart()

Return Value:

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

Since:

  • 4.12.0.80

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

Causes this combo 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.

Attention:

  • If bottom and top are set to the same value, the range of acceptable values is not limited (since 4.20.1.37). In earlier versions, setValidator() can be used to accomplish the same effect by not specifying the “top” or “bottom” values (since 4.12.1.97).

Since:

  • 4.11.0.346

void : setIntValidator( Number bottom, Number top )

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

Parameter(s):

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

Attention:

  • If bottom and top are set to the same value, the range of acceptable values is not limited (since 4.20.1.37). In earlier versions, setValidator() can be used to accomplish the same effect by not specifying the “top” or “bottom” values (since 4.12.1.97).

Since:

  • 4.11.0.346

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

Causes this combo 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.11.0.346

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.

Since:

  • 4.12.0.80

void : setValidator( DzSettings settings )

Causes this combo 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, path (since 4.20.1.67), subpath, filename, nodename, nodelabel.

Attention:

Since:

  • 4.12.1.97

void : undo()

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

Since:

  • 4.12.0.80

Signals


void : cursorPositionChanged( Number oldPos, Number newPos )

Signature:“cursorPositionChanged(int,int)”

Emitted when the cursor moves within the field.

Parameter(s):

  • oldPos - The previous position.
  • newPos - The new position.

Since:

  • 4.11.0.377

void : editingFinished()

Signature:“editingFinished()”

Emitted when the Return or Enter key is pressed or the line edit loses focus.

Since:

  • 4.11.0.377

void : itemChanged( String item )

Signature:“itemChanged(const QString&)”

Emitted when the selected item has changed.

Parameter(s):

  • item - The item that was selected from the menu.

void : returnPressed()

Signature:“returnPressed()”

Emitted when the Return or Enter key is pressed.

Since:

  • 4.11.0.377

void : selectionChanged()

Signature:“selectionChanged()”

Emitted when the selection within the field changes.

Since:

  • 4.11.0.377

void : textChanged( String text )

Signature:“textChanged(const QString&)”

Emitted when the text has changed.

Parameter(s):

  • text - The new text.

void : textCleared()

Signature:“textCleared()”

Emitted when the text has been cleared.

Since:

  • 4.22.1.164

void : textEdited( String text )

Signature:“textEdited(const QString&)”

Emitted when the text is edited.

Parameter(s):

  • text - The new text.

Since:

  • 4.11.0.377