VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
makVrv::DtToolbarWidget Class Referenceabstract

A wrapper class for toolbar widgets. More...

Inheritance diagram for makVrv::DtToolbarWidget:
Inheritance graph
[legend]

Public Member Functions

 DtToolbarWidget (QWidget *p=0, Qt::WindowFlags f=0)
 CTOR The parent widget should be a QToolBar so that we can connect to its toolButtonStyleChanged(Qt::ToolButtonStyle) signal. More...
 
virtual ~DtToolbarWidget ()
 DTOR. More...
 
void setToolButtonChecked (bool checked)
 Set/Get whether or not the tool button is checked. More...
 
bool isToolButtonChecked () const
 
void setToolButtonStyle (Qt::ToolButtonStyle style)
 Set/Get the current toolbutton style If myToolButton is uninitialized, the getter defaults to returning Qt::ToolButtonFollowStyle. More...
 
Qt::ToolButtonStyle toolButtonStyle () const
 

Protected Slots

virtual void on_toolButtonStyleChanged (Qt::ToolButtonStyle val)
 Updates widget to match the new ToolButtonStyle. More...
 
virtual void on_toolButtonClicked (bool checked)=0
 Slot when this widget's toolbutton has been clicked. More...
 
virtual void on_aboutToShow ()
 Slot for when the menu for this widget is about to be shown The slot is only used if this toolbar widget is configured to have a menu. More...
 

Protected Member Functions

virtual void configureToolButton (const QString &text, const QString &tooltip, const QString &iconPath, bool checkable=false, bool hasMenu=false, QToolButton::ToolButtonPopupMode menuMode=QToolButton::DelayedPopup)
 Configure the QToolButton for this toolbar widget. More...
 
virtual void setWidgetsVisible (bool visible)
 Called whenever the ToolButtonStyle has changed. More...
 

Protected Attributes

QToolButtonmyToolButton
 
QHBoxLayout * myWidgetLayout
 

Detailed Description

A wrapper class for toolbar widgets.

A DtToolbarWidget is a widget that is a child to a QToolBar. A DtToolbarWidget is composed of a QHBoxLayout (myWidgetLayout).

The class is responsible for ensuring the toolbar widget appearance is consistent with the current tool button style of the parent toolbar. In order for this to work properly, inheriting tool button widget classes need to: 1) During setup of GUI, A) Use utility method configureToolButton(...) OR configure myToolButton directly. B) Use myWidgetLayout as the main layout, e.g. to add custom child widgets 2) Call setToolButtonChecked(bool checked) to update state when needed 3) Define abstract methods: on_toolButtonClicked 4) Define setWidgetsVisible to toggle the visibility of custom child widgets

Constructor & Destructor Documentation

makVrv::DtToolbarWidget::DtToolbarWidget ( QWidget *  p = 0,
Qt::WindowFlags  f = 0 
)

CTOR The parent widget should be a QToolBar so that we can connect to its toolButtonStyleChanged(Qt::ToolButtonStyle) signal.

virtual makVrv::DtToolbarWidget::~DtToolbarWidget ( )
virtual

DTOR.

Member Function Documentation

void makVrv::DtToolbarWidget::setToolButtonChecked ( bool  checked)

Set/Get whether or not the tool button is checked.

bool makVrv::DtToolbarWidget::isToolButtonChecked ( ) const
void makVrv::DtToolbarWidget::setToolButtonStyle ( Qt::ToolButtonStyle  style)

Set/Get the current toolbutton style If myToolButton is uninitialized, the getter defaults to returning Qt::ToolButtonFollowStyle.

Qt::ToolButtonStyle makVrv::DtToolbarWidget::toolButtonStyle ( ) const
virtual void makVrv::DtToolbarWidget::configureToolButton ( const QString &  text,
const QString &  tooltip,
const QString &  iconPath,
bool  checkable = false,
bool  hasMenu = false,
QToolButton::ToolButtonPopupMode  menuMode = QToolButton::DelayedPopup 
)
protectedvirtual

Configure the QToolButton for this toolbar widget.

Parameters
textThe text the QToolButton will display
tooltipThe tooltip of the QToolButton
iconPathThe absolute path to use for the tool button's QIcon
checkableWhether or not the created QToolButton is checkable
hasMenuWhether or not the created QToolButton has a menu
menuModeThe mode that controls how the menu is shown (ignored if hasMenu is false)
virtual void makVrv::DtToolbarWidget::setWidgetsVisible ( bool  visible)
protectedvirtual

Called whenever the ToolButtonStyle has changed.

Parameters
visibleWhether or not any custom widgets are visible This function should update the visibility of all widgets that are specific to the inheriting child class.

Reimplemented in makVrv::DtAudioVolumeWidget, makVrv::DtModelScaleWidget, and makVrv::DtEntityLabelsWidget.

virtual void makVrv::DtToolbarWidget::on_toolButtonStyleChanged ( Qt::ToolButtonStyle  val)
protectedvirtualslot

Updates widget to match the new ToolButtonStyle.

Parameters
valThe current ToolButtonStyle of the parent QToolBar This function calls setWidgetsVisible(val != Qt::ToolButtonTextOnly) and does nothing when val is Qt::ToolButtonFollowStyle.
virtual void makVrv::DtToolbarWidget::on_toolButtonClicked ( bool  checked)
protectedpure virtualslot

Slot when this widget's toolbutton has been clicked.

Parameters
checkedWhether or not the QToolButton is checked or not
virtual void makVrv::DtToolbarWidget::on_aboutToShow ( )
protectedvirtualslot

Slot for when the menu for this widget is about to be shown The slot is only used if this toolbar widget is configured to have a menu.

If so, the child class should override this definition to populate myToolButton->menu().

Member Data Documentation

QToolButton* makVrv::DtToolbarWidget::myToolButton
protected
QHBoxLayout* makVrv::DtToolbarWidget::myWidgetLayout
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)