ParaView
Public Member Functions | Properties | List of all members
pqTableView Class Reference

pqTableView extends QTableView (in the spirit of pqTableView) to resize the view vertically to fit contents. More...

#include <pqTableView.h>

Inheritance diagram for pqTableView:
Inheritance graph
[legend]

Public Member Functions

 pqTableView (QWidget *parent=0)
 
virtual ~pqTableView ()
 
void setMaximumRowCountBeforeScrolling (int val)
 Set the maximum number of rows beyond which this view should show a vertical scroll bar. More...
 
int maximumRowCountBeforeScrolling () const
 
void setMinimumRowCount (int val)
 Set the number of rows to use as the minimum to determine the size of the widget when there are fewer or no rows. More...
 
int minimumRowCount () const
 
void setPadding (int val)
 Set the number of rows to always pad the widget with. More...
 
int padding () const
 
virtual void setModel (QAbstractItemModel *model)
 Overridden to ensure the view updates its size as rows are added/removed. More...
 
virtual void setRootIndex (const QModelIndex &index)
 
virtual QSize sizeHint () const
 Overridden to report size as per the state of this pqTableView. More...
 
virtual QSize minimumSizeHint () const
 
virtual bool eventFilter (QObject *watched, QEvent *evt)
 Overridden to handle events from QScrollBar. More...
 

Properties

int maximumRowCountBeforeScrolling
 Maximum number of rows beyond which this view should show a vertical scroll bar. More...
 
int minimumRowCount
 The number of rows to use as the minimum to determine the size of the widget when there are fewer or no rows. More...
 
int padding
 The number of rows to always pad the widget with. More...
 

Detailed Description

pqTableView extends QTableView (in the spirit of pqTableView) to resize the view vertically to fit contents.

It servers to purposes:

Definition at line 44 of file pqTableView.h.

Constructor & Destructor Documentation

◆ pqTableView()

pqTableView::pqTableView ( QWidget *  parent = 0)

◆ ~pqTableView()

virtual pqTableView::~pqTableView ( )
virtual

Member Function Documentation

◆ setMaximumRowCountBeforeScrolling()

void pqTableView::setMaximumRowCountBeforeScrolling ( int  val)
inline

Set the maximum number of rows beyond which this view should show a vertical scroll bar.

The pqTableView will keep on resizing until maximumRowCountBeforeScrolling row to avoid vertical scrolling. Set this to 0, and this will behave exactly as QTableView. Default is 0.

Definition at line 85 of file pqTableView.h.

◆ maximumRowCountBeforeScrolling()

int pqTableView::maximumRowCountBeforeScrolling ( ) const
inline

Definition at line 86 of file pqTableView.h.

◆ setMinimumRowCount()

void pqTableView::setMinimumRowCount ( int  val)
inline

Set the number of rows to use as the minimum to determine the size of the widget when there are fewer or no rows.

Definition at line 92 of file pqTableView.h.

◆ minimumRowCount()

int pqTableView::minimumRowCount ( ) const
inline

Definition at line 93 of file pqTableView.h.

◆ setPadding()

void pqTableView::setPadding ( int  val)
inline

Set the number of rows to always pad the widget with.

This is used when the actual number of rows is less than or equal to maximumRowCountBeforeScrolling for a non-zero maximumRowCountBeforeScrolling.

Definition at line 101 of file pqTableView.h.

◆ padding()

int pqTableView::padding ( ) const
inline

Definition at line 102 of file pqTableView.h.

◆ setModel()

virtual void pqTableView::setModel ( QAbstractItemModel *  model)
virtual

Overridden to ensure the view updates its size as rows are added/removed.

◆ setRootIndex()

virtual void pqTableView::setRootIndex ( const QModelIndex &  index)
virtual

◆ sizeHint()

virtual QSize pqTableView::sizeHint ( ) const
virtual

Overridden to report size as per the state of this pqTableView.

◆ minimumSizeHint()

virtual QSize pqTableView::minimumSizeHint ( ) const
virtual

◆ eventFilter()

virtual bool pqTableView::eventFilter ( QObject *  watched,
QEvent *  evt 
)
virtual

Overridden to handle events from QScrollBar.

Property Documentation

◆ maximumRowCountBeforeScrolling

int pqTableView::maximumRowCountBeforeScrolling
readwrite

Maximum number of rows beyond which this view should show a vertical scroll bar.

The pqTableView will keep on resizing until maximumRowCountBeforeScrolling row to avoid vertical scrolling. Set this to 0, and this will behave exactly as QTableView. Default is 0.

Definition at line 57 of file pqTableView.h.

◆ minimumRowCount

int pqTableView::minimumRowCount
readwrite

The number of rows to use as the minimum to determine the size of the widget when there are fewer or no rows.

Definition at line 57 of file pqTableView.h.

◆ padding

int pqTableView::padding
readwrite

The number of rows to always pad the widget with.

This is used, so long as the total number of rows doesn't exceed the maximumRowCountBeforeScrolling. Note this gets added on top of the padding added, if any, due to minimumRowCount.

Definition at line 63 of file pqTableView.h.


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