Documents > BPS V2 C++ API
BpsTableView Class Reference

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

#include <bpstableview.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 table cell.
void dataGotChanged (const QModelIndex &aTopLeft, const QModelIndex &aBottomRight)
 This signal is emitted when item data are changed in the model.
void focusInOutEvent (bool aFocusIn)
 This signal is emitted when the widget gets or loses the focus.

Public Member Functions

 BpsTableView (QWidget *aParent=0)
 Constructor for BpsTableView.
void restoreHorizontalHeaderState (const QVariant &aData)
 Restores the horizontal header state from settings.
QVariant saveHorizontalHeaderState ()
QList< int > selectedRowNumbers () const
void setSizeHint (const QSize &aSize)
 Define the size hint.
virtual QSize sizeHint () const

Detailed Description

This class adds some convenience to QTableView:

  • Alternating row colors
  • Resize all columns to content with Ctrl + Plus
  • Variable size hint
  • Get ordered list of selected row numbers
  • Signals for context menu and data changes

Constructor & Destructor Documentation

BpsTableView::BpsTableView ( QWidget *  aParent = 0)

Constructor for BpsTableView.

Parameters:
[in]aParentThe parent widget.

Member Function Documentation

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

This signal is emitted when a context menu is requested on a table cell.

Parameters:
[in]aPositionThe context menu position.
[in]aIndexThe model index of the cell, or an invalid index when not on a cell.
void BpsTableView::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 BpsTableView::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 BpsTableView::restoreHorizontalHeaderState ( const QVariant &  aData)

Restores the horizontal header state from settings.

Parameters:
[in]aDataThe data from the settings to restore
QVariant BpsTableView::saveHorizontalHeaderState ( )
Returns:
The current horizontal header state to save in the settings.
QList<int> BpsTableView::selectedRowNumbers ( ) const
Returns:
A list of the selected row numbers, sorted ascending.
void BpsTableView::setSizeHint ( const QSize &  aSize)

Define the size hint.

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

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