User Tools

Site Tools


DzToolBar

Class that encapsulates a QToolBar that contains DzToolBarItem items.

More...

Inherits :

Enumerations

Methods

DAZ Script
voidclear ()
voiddock ( DzToolBar::DockArea area, String beforeBar=“” )
DockAreadockedArea ()
DzToolBarItemgetItem ( Number which )
ArraygetItemList ()
NumbergetNumItems ()
BooleanhasItems ()
voidinsertAction ( DzAction action, DzAction before )
voidinsertAction ( String action, Number index=-1 )
voidinsertCustomAction ( String action, Number index=-1 )
voidinsertCustomWidget ( String uiScript, Number index=-1 )
voidinsertItem ( DzToolBarItem item, Number index=-1 )
voidinsertSeparator ( Number index=-1 )
voidinsertViewportAlignmentSpacer ( Number alignment, Number index=-1 )
voidinsertViewportCenterAlignSpacer ( Number index=-1 )
voidinsertViewportLeftAlignSpacer ( Number index=-1 )
BooleanisClosed ()
voidremoveItem ( Number index )
voidremoveItem ( DzToolBarItem item )
voidsetClosed ( Boolean onOff )
voidundock ( Point pos )

Signals

Detailed Description

This class provides access to a toolbar in the interface. This class is not intended to be constructed directly, rather an instance of the class is created using DzPaneMgr::createToolBar().

Enumerations


: DockArea

The areas of a DzActivityLayout where the toolbar can be docked.

  • ToolBarTop - The dock area at the top of a DzActivityLayout.
  • ToolBarBottom - The dock area at the bottom of a DzActivityLayout.
  • ToolBarLeft - The dock area on the left side of a DzActivityLayout.
  • ToolBarRight - The dock area on the right side of a DzActivityLayout.
  • NoToolBarArea - No dock area. The toolbar cannot be docked.

Methods


void : clear()

Removes all items from the bar.


void : dock( DzToolBar::DockArea area, String beforeBar=“” )

Docks the toolbar in the specified area on the DzActivityLayout, and shows the toolbar if it is hidden.

Parameter(s):

  • area - The DockArea to dock the toolbar to.
  • beforeBar - The name of the bar in the area to dock before.

DockArea : dockedArea()

Return Value:

  • The dock area that the toolbar is docked in.

DzToolBarItem : getItem( Number which )

Parameter(s):

  • which - The index of the item in the menu

Return Value:

  • A pointer to the toolbar item at the given index, NULL if the index is invalid

Array : getItemList()

This function is provided for DAZ Script access. Plug-in developers are encouraged to use the much more efficient itemListIterator() method.

Return Value:

  • A list of all the items in this toolbar.

Number : getNumItems()

Return Value:

  • The number of items in the toolbar

Boolean : hasItems()

Return Value:

  • true if there are items in this toolbar, false if the toolbar is empty.

void : insertAction( DzAction action, DzAction before )

Adds the given action to the toolbar.

Parameter(s):

  • action - The DzAction that will be added to the toolbar.
  • before - The DzAction to insert action before.

void : insertAction( String action, Number index=-1 )

Adds the given action to the toolbar.

Parameter(s):

  • action - The class name of the DzAction that will be added to the toolbar.
  • index - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

void : insertCustomAction( String action, Number index=-1 )

Adds the given custom action to the toolbar.

Parameter(s):

  • action - The name of the custom action that will be added to the toolbar.
  • index - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

void : insertCustomWidget( String uiScript, Number index=-1 )

Adds a custom widget to the toolbar.

Parameter(s):

  • uiScript - A path to the DAZ Script that loads the QtDesigner .ui file for the custom widget. A global function named getWidget() is provided to uiScript that returns a DzWidget which should be used as the parent argument in a DzUiLoader::load() call.
  • index - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

void : insertItem( DzToolBarItem item, Number index=-1 )

Inserts the given item into the toolbar at the given location.

Parameter(s):

  • item - The item to insert into the toolbar
  • index - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the toolbar.

void : insertSeparator( Number index=-1 )

Adds a separator to the toolbar.

Parameter(s):

  • index - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

void : insertViewportAlignmentSpacer( Number alignment, Number index=-1 )

Adds a spacer to the toolbar which adjusts itself so that items added after it are aligned over the application viewport.

Parameter(s):

  • alignment - The alignment to use for toolbar items. Currently supports Qt::AlignLeft and Qt::AlignCenter
  • index - The index at which to insert the spacer. If the index is invalid (the default) the item is appended to the end of the menu.

void : insertViewportCenterAlignSpacer( Number index=-1 )

Adds a spacer to the toolbar which adjusts itself so that any items after it are centered over the application viewport.

Parameter(s):

  • index - The index at which to insert the spacer. If the index is invalid (the default) the item is appended to the end of the menu.

void : insertViewportLeftAlignSpacer( Number index=-1 )

Adds a spacer to the toolbar which adjusts itself so that any items after it are left aligned over the application viewport.

Parameter(s):

  • index - The index at which to insert the spacer. If the index is invalid (the default) the item is appended to the end of the menu.

Boolean : isClosed()

Return Value:

  • true if the toolbar is closed (not displayed), false if the toolbar is open (displayed).

void : removeItem( Number index )

Parameter(s):

  • index - The index of the item to remove.

void : removeItem( DzToolBarItem item )

Parameter(s):

  • item - The item to remove.

void : setClosed( Boolean onOff )

Sets whether the toolbar is closed (not displayed), or open (displayed).


void : undock( Point pos )

Undocks the toolbar, moves it to the given global coordinates, and shows the toolbar if it is hidden.

Signals


void : itemListChanged()

Signature:“itemListChanged()”

Emitted when items are added to or removed from this toolbar