Public Types | Public Member Functions | Protected Slots | List of all members
pqTreeWidgetCheckHelper Class Reference

If a QTreeWidget has checkable elements in any column, one needs to explicitly click on the checkbox to change the check state. More...

#include <pqTreeWidgetCheckHelper.h>

Inherits QObject.

Public Types

enum  CheckMode { CLICK_IN_COLUMN, CLICK_IN_ROW }
 

Public Member Functions

 pqTreeWidgetCheckHelper (QTreeWidget *treeWidget, int checkableColumn, QObject *parent)
 
void setCheckMode (CheckMode mode)
 
CheckMode checkMode () const
 

Protected Slots

void onItemClicked (QTreeWidgetItem *item, int column)
 
void onItemPressed (QTreeWidgetItem *item, int column)
 

Detailed Description

If a QTreeWidget has checkable elements in any column, one needs to explicitly click on the checkbox to change the check state.

However, sometimes we simply want the checkbox to be updated when the user clicks on the entire row. For that purpose, we use pqTreeWidgetCheckHelper. Simply create and instance of pqTreeWidgetCheckHelper, and set a tree to use.

Definition at line 22 of file pqTreeWidgetCheckHelper.h.

Member Enumeration Documentation

◆ CheckMode

Enumerator
CLICK_IN_COLUMN 
CLICK_IN_ROW 

Definition at line 31 of file pqTreeWidgetCheckHelper.h.

Constructor & Destructor Documentation

◆ pqTreeWidgetCheckHelper()

pqTreeWidgetCheckHelper::pqTreeWidgetCheckHelper ( QTreeWidget *  treeWidget,
int  checkableColumn,
QObject *  parent 
)

Member Function Documentation

◆ setCheckMode()

void pqTreeWidgetCheckHelper::setCheckMode ( CheckMode  mode)
inline

Definition at line 41 of file pqTreeWidgetCheckHelper.h.

◆ checkMode()

CheckMode pqTreeWidgetCheckHelper::checkMode ( ) const
inline

Definition at line 42 of file pqTreeWidgetCheckHelper.h.

◆ onItemClicked

void pqTreeWidgetCheckHelper::onItemClicked ( QTreeWidgetItem *  item,
int  column 
)
protectedslot

◆ onItemPressed

void pqTreeWidgetCheckHelper::onItemPressed ( QTreeWidgetItem *  item,
int  column 
)
protectedslot

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