User Tools

Site Tools


DzListView

DAZScript wrapper for Q3ListView.

More...

Inherits :

Enumerations

Properties

Constructors

DAZ Script
DzListView ( DzWidget parent )

Methods

DAZ Script
NumberaddColumn ( String label )
voidclear ()
voidclearSelection ()
NumbercolumnAlignment ( Number column )
StringcolumnText ( Number index )
NumbercolumnWidth ( Number column )
WidthModecolumnWidthMode ( Number column )
DzListViewItemcurrentItem ()
voiddeleteItem ( DzListViewItem item )
voidensureItemVisible ( DzListViewItem item )
DzListViewItemfindItem ( String text, Number column, ComparisonFlags compare=ExactMatch|CaseSensitive )
DzListViewItemfirstChild ()
ArraygetItems ( ItemsMode mode )
voidhideColumn ( Number column )
BooleanisOpen ( DzListViewItem item )
BooleanisRenaming ()
BooleanisSelected ( DzListViewItem item )
DzListViewItemlastItem ()
voidremoveColumn ( Number index )
voidsetColumnAlignment ( Number column, Number align )
voidsetColumnText ( Number index, String label )
voidsetColumnWidth ( Number column, Number width )
voidsetColumnWidthMode ( Number column, WidthMode mode )
voidsetCurrentItem ( DzListViewItem item )
voidsetOpen ( DzListViewItem item, Boolean open )
voidsetSelected ( DzListViewItem item, Boolean selected )
voidsetSelectionAnchor ( DzListViewItem item )
voidsetSorting ( Number column, Boolean ascending=TRUE )
voidsort ()

Signals

voidclicked ( DzListViewItem item )
voidclicked ( DzListViewItem item, Point pos, Number col )
voidcollapsed ( DzListViewItem item )
voidcontextMenuRequested ( DzListViewItem item, Point pos, Number col )
voidcurrentChanged ( DzListViewItem item )
voiddoubleClicked ( DzListViewItem item, Point pos, Number col )
voidexpanded ( DzListViewItem item )
voiditemRenamed ( DzListViewItem item, Number col, String text )
voiditemRenamed ( DzListViewItem item, Number col )
voidmouseButtonClicked ( Number button, DzListViewItem item, Point pos, Number col )
voidmouseButtonPressed ( Number button, DzListViewItem item, Point pos, Number col )
voidpressed ( DzListViewItem item, Point pos, Number col )
voidpressed ( DzListViewItem item )
voidreturnPressed ( DzListViewItem item )
voidrightButtonClicked ( DzListViewItem item, Point pos, Number col )
voidrightButtonPressed ( DzListViewItem item, Point pos, Number col )
voidselectionChanged ()
voidselectionChanged ( DzListViewItem item )
voidspacePressed ( DzListViewItem item )

Detailed Description

Todo

The findItem() method takes a ComparisonFlags enum. ComparisonFlags is either not exposed or not documented.

Enumerations


: ItemsMode

The item mode types

  • Selected - The selected items
  • Unselected - The unselected items
  • Checked - The items that are checked
  • NotChecked - The items that are not checked
  • All - All the items in the view

—–

: RenameAction

The rename action types

  • Accept - The item is renamed if return is pressed or if the user clicks away from the entry field (it loses focus)
  • Reject - The item is renamed only if the user presses return in the entry field. If the entry field loses focus, the rename operation is discarded.

—–

: ResizeMode

The resize modes of list views

  • NoColumn - The columns do not get resized
  • AllColumns - All columns get resized equally
  • LastColumn - The last column is resized to fit the width of the view

—–

: SelectionMode

The selection mode types for list views

  • Single - Only one item in the list view can be selected
  • Multi - Multiple items in the list view can be selected. When the user clicks on an item, its selection state is toggled on/off.
  • Extended - Multiple items in the list view can be selected. When the user clicks on an item, the current selection is cleared, and that item becomes selected. Multiple items are selected by clicking with the CTRL key, or SHIFT key pressed, or by clicking and dragging.
  • NoSelection - No items in the list view can be selected

—–

: WidthMode

The width modes types

  • Manual - The column width does not change automatically
  • Maximum - The column width grows automatically according to the maximum width of all items in the column.

Properties


Boolean : allColumnsShowFocus

Whether or not all columns show keyboard focus.


Number : childCount

Read-Only: The number root level children in the list view


Number : columns

Read-Only: The number of items in the list box


RenameAction : defaultRenameAction

The default action that is taken when the user attempts to rename an item.


Number : itemMargin

The advisory margin for list view items


ResizeMode : resizeMode

The resize mode for the list view


Boolean : rootIsDecorated

Whether or not the root level items show expand/collapse boxes.


SelectionMode : selectionMode

The selection mode for the list view


Boolean : showSortIndicator

Whether or not the sort indicator should be displayed.


Boolean : showToolTips

Whether or not tool tips should be displayed.


Number : sortColumn

The column that the list is sorted by


SortOrder : sortOrder

The sort order of the list view.


Number : treeStepSize

The number of pixels that a child item is offset from its parent

Constructors


DzListView( DzWidget parent )

Creates a list view widget with the given parent widget

Methods


Number : addColumn( String label )

Add a column to the list view with the given label


void : clear()

Clears all the items from the list view.


void : clearSelection()

Clears the current selection in the view.


Number : columnAlignment( Number column )

Return Value:

  • The alignment of the given column.

String : columnText( Number index )

Return Value:

  • The label of the column at the given index

Number : columnWidth( Number column )

Return Value:

  • The width of the given column.

WidthMode : columnWidthMode( Number column )

Return Value:

  • The width mode of the given column.

DzListViewItem : currentItem()

Return Value:

  • The currently highlighted item

void : deleteItem( DzListViewItem item )

Deletes given item from the list view.


void : ensureItemVisible( DzListViewItem item )

Ensures the the given item is visible in the view.


DzListViewItem : findItem( String text, Number column, ComparisonFlags compare=ExactMatch|CaseSensitive )

Return Value:

  • The list view item with the given text for the given column, matched according to the given flags.

DzListViewItem : firstChild()

Return Value:

  • The first child in the list view.

Array : getItems( ItemsMode mode )

Return an array of DzListViewItems that match the supplied ItemsMode Flag.

Parameter(s):

  • mode - The ItemsMode which will be used to fill the array.

Return Value:

  • Array of DzListViewItems which match the supplied flag.

void : hideColumn( Number column )

Hide the given column


Boolean : isOpen( DzListViewItem item )

Return Value:

  • true if the given item is expanded (open), or false if it is collapsed (closed)

Boolean : isRenaming()

Return Value:

  • true if the view is currently in a renaming operation.

Boolean : isSelected( DzListViewItem item )

Return Value:

  • true if the given item is selected

DzListViewItem : lastItem()

Return Value:

  • The last item in the list view.

void : removeColumn( Number index )

Remove the column at index from the list view


void : setColumnAlignment( Number column, Number align )

Sets the alignment of the given column.


void : setColumnText( Number index, String label )

Change the label of the column at the given index


void : setColumnWidth( Number column, Number width )

Sets the width of the given column.


void : setColumnWidthMode( Number column, WidthMode mode )

Sets the width mode of the given column.


void : setCurrentItem( DzListViewItem item )

Set the currently highlighted item


void : setOpen( DzListViewItem item, Boolean open )

Sets whether the given item is expanded (open) or collapsed (closed)


void : setSelected( DzListViewItem item, Boolean selected )

Sets whether the given item is selected


void : setSelectionAnchor( DzListViewItem item )

Sets the selection anchor of the view to item.


void : setSorting( Number column, Boolean ascending=TRUE )

Sets the sorting column and order for the view.


void : sort()

Sort the view

Signals


void : clicked( DzListViewItem item )

Signature:“clicked(DzListViewItem*)”

Emitted when an item is clicked (mouse button pressed and released)

Parameter(s):

  • item - The item clicked (or 0 if no item was clicked)

void : clicked( DzListViewItem item, Point pos, Number col )

Signature:“clicked(DzListViewItem*,const QPoint&,int)”

Emitted when an item is clicked (mouse button pressed and released)

Parameter(s):

  • item - The item clicked (or 0 if no item was clicked)
  • pos - The position, in global coordinates, where the user clicked
  • col - The column in which the click occurred (undefined if item is 0)

void : collapsed( DzListViewItem item )

Signature:“collapsed(DzListViewItem*)”

Emitted when an item is collapsed (when item 's children are hidden)

Parameter(s):

  • item - The item collapsed

void : contextMenuRequested( DzListViewItem item, Point pos, Number col )

Signature:“contextMenuRequested(DzListViewItem*,const QPoint&,int)”

Emitted when the user right clicks the list view, or uses a special system key, for a context menu

Parameter(s):

  • item - The item under the cursor if pressed (or 0 if no item is under the cursor), the current item if the system key is used
  • pos - The position, in global coordinates, where the user pressed
  • col - The column in which the press occurred (-1 if no item is pressed)

void : currentChanged( DzListViewItem item )

Signature:“currentChanged(DzListViewItem*)”

Emitted when the current item changes

Parameter(s):


void : doubleClicked( DzListViewItem item, Point pos, Number col )

Signature:“doubleClicked(DzListViewItem*,const QPoint&,int)”

Emitted when an item is double clicked (on the second button press, not release)

Parameter(s):

  • item - The item double clicked (or 0 if no item was double clicked)
  • pos - The position, in global coordinates, where the user double clicked
  • col - The column in which the double click occurred (-1 if outside the list view)

void : expanded( DzListViewItem item )

Signature:“expanded(DzListViewItem*)”

Emitted when an item is expanded (when item 's children are shown)

Parameter(s):

  • item - The item expanded

void : itemRenamed( DzListViewItem item, Number col, String text )

Signature:“itemRenamed(DzListViewItem*,int,const QString&)”

Emitted when an item is renamed

Parameter(s):

  • item - The item renamed
  • col - The column in which the renaming occurred
  • text - The the new text for item

void : itemRenamed( DzListViewItem item, Number col )

Signature:“itemRenamed(DzListViewItem*,int)”

Emitted when an item is renamed

Parameter(s):

  • item - The item renamed
  • col - The column in which the renaming occurred

void : mouseButtonClicked( Number button, DzListViewItem item, Point pos, Number col )

Signature:“mouseButtonClicked(int,DzListViewItem*,const QPoint&,int)”

Emitted when an item is clicked with the a mouse button (mouse button pressed and released)

Parameter(s):

  • button - The mouse button clicked
  • item - The item clicked (or 0 if no item was clicked)
  • pos - The position, in global coordinates, where the user clicked
  • col - The column in which the click occurred (undefined if item is 0)

void : mouseButtonPressed( Number button, DzListViewItem item, Point pos, Number col )

Signature:“mouseButtonPressed(int,DzListViewItem*,const QPoint&,int)”

Emitted when an item is pressed with the a mouse button (mouse button pressed)

Parameter(s):

  • button - The mouse button pressed
  • item - The item pressed (or 0 if no item was pressed)
  • pos - The position, in global coordinates, where the user pressed
  • col - The column in which the press occurred (undefined if item is 0)

void : pressed( DzListViewItem item, Point pos, Number col )

Signature:“pressed(DzListViewItem*,const QPoint&,int)”

Emitted when an item is pressed (mouse button pressed)

Parameter(s):

  • item - The item pressed (or 0 if no item was pressed)
  • pos - The position, in global coordinates, where the user pressed
  • col - The column in which the press occurred (undefined if item is 0)

void : pressed( DzListViewItem item )

Signature:“pressed(DzListViewItem*)”

Emitted when an item is pressed (mouse button pressed)

Parameter(s):

  • item - The item pressed (or 0 if no item was pressed)

void : returnPressed( DzListViewItem item )

Signature:“returnPressed(DzListViewItem*)”

Emitted when return is pressed on the current item

Parameter(s):

  • item - The current item

void : rightButtonClicked( DzListViewItem item, Point pos, Number col )

Signature:“rightButtonClicked(DzListViewItem*,const QPoint&,int)”

Emitted when an item is clicked with the right button (mouse button pressed and released)

Parameter(s):

  • item - The item clicked (or 0 if no item was clicked)
  • pos - The position, in global coordinates, where the user clicked
  • col - The column in which the click occurred (-1 if outside the list view)

void : rightButtonPressed( DzListViewItem item, Point pos, Number col )

Signature:“rightButtonPressed(DzListViewItem*,const QPoint&,int)”

Emitted when an item is pressed with the right button (mouse button pressed)

Parameter(s):

  • item - The item pressed (or 0 if no item was pressed)
  • pos - The position, in global coordinates, where the user pressed
  • col - The column in which the press occurred (-1 if outside the list view)

void : selectionChanged()

Signature:“selectionChanged()”

Emitted when the selected item changes.


void : selectionChanged( DzListViewItem item )

Signature:“selectionChanged(DzListViewItem*)”

Emitted when the selected item changes

Parameter(s):

  • item - The newly selected item

void : spacePressed( DzListViewItem item )

Signature:“spacePressed(DzListViewItem*)”

Emitted when the spacebar is pressed on the current item

Parameter(s):

  • item - The current item