VR-Forces 4.6.1 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::DtDeselectableTreeWidget Class Reference

A tree widget that allows for selecting no item. More...

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

Public Member Functions

 DtDeselectableTreeWidget (QWidget *parent)
 CTOR.
virtual ~DtDeselectableTreeWidget ()
 DTOR.
virtual QTreeWidgetItemcurrentSelectedItem ()
 get the current selected tree item
virtual void setCurrentSelectedItem (QTreeWidgetItem *item)
 set the current selected tree item
virtual bool ifCurrentSelectedItemHasChild ()
 whether the current selected tree item has child

Protected Slots

virtual void rowsInserted (const QModelIndex &parent, int start, int end)
 Handle when rows are inserted into the tree.
virtual void rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 Handle when rows are removed from the tree.

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event)
 Handle mouse press events on the widget.
virtual bool eventFilter (QObject *obj, QEvent *event)
 Handle events on the widget.

Protected Attributes

QTreeWidgetItemmyCurrentSelectedItem

Detailed Description

A tree widget that allows for selecting no item.

Mouse clicking on any item in the tree will switch the selection-focus normally. Clicking white space off the tree will remove selection-focus from the current items.

Constructor & Destructor Documentation

makVrv::DtDeselectableTreeWidget::DtDeselectableTreeWidget ( QWidget *  parent)

CTOR.

virtual makVrv::DtDeselectableTreeWidget::~DtDeselectableTreeWidget ( )
virtual

DTOR.

Member Function Documentation

virtual QTreeWidgetItem* makVrv::DtDeselectableTreeWidget::currentSelectedItem ( )
virtual

get the current selected tree item

virtual void makVrv::DtDeselectableTreeWidget::setCurrentSelectedItem ( QTreeWidgetItem item)
virtual

set the current selected tree item

virtual bool makVrv::DtDeselectableTreeWidget::ifCurrentSelectedItemHasChild ( )
virtual

whether the current selected tree item has child

virtual void makVrv::DtDeselectableTreeWidget::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Handle mouse press events on the widget.

This handler identifies where the mouse clicked on the tree. If the click was on an item, the event is handled normally. If the click was not on an item, any selected item becomes un-selected.

virtual bool makVrv::DtDeselectableTreeWidget::eventFilter ( QObject obj,
QEvent *  event 
)
protectedvirtual

Handle events on the widget.

This handler un-selects all items when the widget is hidden so no item is selected when the widget is re-shown. The handler reselects the current item when the widget is activated. The re-selection forces the item to visually display focus, giving feedback to the user.

virtual void makVrv::DtDeselectableTreeWidget::rowsInserted ( const QModelIndex &  parent,
int  start,
int  end 
)
protectedvirtualslot

Handle when rows are inserted into the tree.

This handler clears the current selected item.

virtual void makVrv::DtDeselectableTreeWidget::rowsAboutToBeRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
protectedvirtualslot

Handle when rows are removed from the tree.

This handler clears the current selected item.

Member Data Documentation

QTreeWidgetItem* makVrv::DtDeselectableTreeWidget::myCurrentSelectedItem
protected

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)