Documents > BPS V2 C++ API
BpsTreeView Class Reference

This class adds some convenience to QTreeView: More...

#include <bpstreeview.h>

List of all members.

Signals

void contextMenuRequested (const QPoint &aPosition, const QModelIndex &aIndex)
 This signal is emitted when a context menu is requested on a item.
void currentItemChanged (const QModelIndex &aCurrent, const QModelIndex &aPrevious)
 This signal is emitted when the current item changes.
void dataGotChanged (const QModelIndex &aTopLeft, const QModelIndex &aBottomRight)
 This signal is emitted when item data are changed in the model.
void dropKeyboardModifiers (Qt::KeyboardModifiers aModifiers)
 Signal is emitted on drop events.
void focusInOutEvent (bool aFocusIn)
 This signal is emitted when the widget gets or loses the focus.

Public Member Functions

 BpsTreeView (QWidget *aParent=0)
void restoreHeaderState (const QVariant &aData)
 Restores the header state from settings.
QVariant saveHeaderState ()
void setSizeHint (const QSize &aSize)
 Define the size hint.
virtual QSize sizeHint () const

Detailed Description

This class adds some convenience to QTreeView:

  • Alternating row colors
  • Resize all columns to content with Ctrl + Plus
  • Variable size hint
  • Signals for context menus, item changes, data changes, drop keyboard modifiers

Constructor & Destructor Documentation

BpsTreeView::BpsTreeView ( QWidget *  aParent = 0)
Parameters:
[in]aParentThe parent widget.

Member Function Documentation

void BpsTreeView::contextMenuRequested ( const QPoint &  aPosition,
const QModelIndex &  aIndex 
) [signal]

This signal is emitted when a context menu is requested on a item.

Parameters:
[in]aPositionThe context menu position.
[in]aIndexThe model index of the item, or an invalid index when not on a item.
void BpsTreeView::currentItemChanged ( const QModelIndex &  aCurrent,
const QModelIndex &  aPrevious 
) [signal]

This signal is emitted when the current item changes.

Parameters:
[in]aCurrentThe new current item index.
[in]aPreviousThis previous item index.
void BpsTreeView::dataGotChanged ( const QModelIndex &  aTopLeft,
const QModelIndex &  aBottomRight 
) [signal]

This signal is emitted when item data are changed in the model.

The changed items are those from aTopLeft to aBottomRight inclusive. If just one item is changed aTopLeft == aBottomRight.

Parameters:
[in]aTopLeftThe top left index.
[in]aBottomRightThe bottom right index.
void BpsTreeView::dropKeyboardModifiers ( Qt::KeyboardModifiers  aModifiers) [signal]

Signal is emitted on drop events.

Parameters:
aModifiersKeyboard modifiers of the drop action
void BpsTreeView::focusInOutEvent ( bool  aFocusIn) [signal]

This signal is emitted when the widget gets or loses the focus.

Parameters:
[in]aFocusInTrue when getting focus, false when losing focus.
void BpsTreeView::restoreHeaderState ( const QVariant &  aData)

Restores the header state from settings.

Parameters:
[in]aDataThe data from the settings to restore
QVariant BpsTreeView::saveHeaderState ( )
Returns:
The current header state to save in the settings.
void BpsTreeView::setSizeHint ( const QSize &  aSize)

Define the size hint.

Parameters:
[in]aSizeThe size to use as size hint.
virtual QSize BpsTreeView::sizeHint ( ) const [virtual]
Returns:
A QSize as size hint.

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