Public Slots | Signals | Public Member Functions | Properties | List of all members
pqSignalAdaptorTreeWidget Class Reference

pqSignalAdaptorTreeWidget can be used to connect any property with repeat_command to a tree widget that displays the property value. More...

#include <pqSignalAdaptorTreeWidget.h>

Inherits QObject.

Public Slots

void setValues (const QList< QVariant > &)
 Set the values in the widget. More...
 
QTreeWidgetItem * growTable ()
 Called when user navigates beyond the end in the indices table widget. More...
 

Signals

void valuesChanged ()
 Fired when the tree widget is modified. More...
 
void tableGrown (QTreeWidgetItem *item)
 Fired when the table is automatically grown due to the user navigating past the end. More...
 

Public Member Functions

 pqSignalAdaptorTreeWidget (QTreeWidget *treeWidget, bool editable)
 Constructor. More...
 
 ~pqSignalAdaptorTreeWidget () override
 
QList< QVariant > values () const
 Returns a list of the values currently in the tree widget. More...
 
QTreeWidgetItem * appendValue (const QList< QVariant > &values)
 Append an item to the tree. More...
 
QTreeWidgetItem * appendValue (const QStringList &values)
 
void setItemCreatorFunction (QTreeWidgetItem *(fptr)(QTreeWidget *, const QStringList &))
 This adaptor create QTreeWidgetItem instances by default when new entries are to be shown in the widget. More...
 

Properties

QList< QVariant > values
 

Detailed Description

pqSignalAdaptorTreeWidget can be used to connect any property with repeat_command to a tree widget that displays the property value.

The TreeWidget must have exactly as many columns as the number of elements in each command for the property (i.e. number_of_element_per_command). Note that the adaptor does not force the repeat command or size requirements mentioned above.

Definition at line 24 of file pqSignalAdaptorTreeWidget.h.

Constructor & Destructor Documentation

◆ pqSignalAdaptorTreeWidget()

pqSignalAdaptorTreeWidget::pqSignalAdaptorTreeWidget ( QTreeWidget *  treeWidget,
bool  editable 
)

Constructor.

Parameters
treeWidgetis the tree widget we are connecting.
editableindicates if items in the widget can be edited by the user.

◆ ~pqSignalAdaptorTreeWidget()

pqSignalAdaptorTreeWidget::~pqSignalAdaptorTreeWidget ( )
override

Member Function Documentation

◆ values()

QList<QVariant> pqSignalAdaptorTreeWidget::values ( ) const

Returns a list of the values currently in the tree widget.

◆ appendValue() [1/2]

QTreeWidgetItem* pqSignalAdaptorTreeWidget::appendValue ( const QList< QVariant > &  values)

Append an item to the tree.

The size of values == this->TreeWidget->columnCount(). Returns the newly created item, or 0 on failure.

◆ appendValue() [2/2]

QTreeWidgetItem* pqSignalAdaptorTreeWidget::appendValue ( const QStringList &  values)

◆ setItemCreatorFunction()

void pqSignalAdaptorTreeWidget::setItemCreatorFunction ( QTreeWidgetItem *  fptr)(QTreeWidget *, const QStringList &)
inline

This adaptor create QTreeWidgetItem instances by default when new entries are to be shown in the widget.

To change the type of QTreeWidgetItem subclass created, simply set a function pointer to a callback which will be called every time a new item is needed. The signature for the callback is: QTreeWidgetItem* callback(QTreeWidget* parent, const QStringList& val)

Definition at line 60 of file pqSignalAdaptorTreeWidget.h.

◆ valuesChanged

void pqSignalAdaptorTreeWidget::valuesChanged ( )
signal

Fired when the tree widget is modified.

◆ tableGrown

void pqSignalAdaptorTreeWidget::tableGrown ( QTreeWidgetItem *  item)
signal

Fired when the table is automatically grown due to the user navigating past the end.

This only supported for editable pqTreeWidget instances.

◆ setValues

void pqSignalAdaptorTreeWidget::setValues ( const QList< QVariant > &  )
slot

Set the values in the widget.

◆ growTable

QTreeWidgetItem* pqSignalAdaptorTreeWidget::growTable ( )
slot

Called when user navigates beyond the end in the indices table widget.

We add a new row to simplify editing.

Property Documentation

◆ values

QList<QVariant> pqSignalAdaptorTreeWidget::values
readwrite

Definition at line 27 of file pqSignalAdaptorTreeWidget.h.


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