Public Types | Public Member Functions | List of all members
pqCheckBoxDelegate Class Reference

Delegate for QTableView to draw a checkbox as an left-right (unchecked) and top-bottom (checked) arrow. More...

#include <pqCheckBoxDelegate.h>

Inherits QStyledItemDelegate.

Public Types

enum  CheckBoxValues { NOT_EXPANDED, EXPANDED, NOT_EXPANDED_DISABLED }
 

Public Member Functions

 pqCheckBoxDelegate (QObject *parent)
 
 ~pqCheckBoxDelegate () override
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
 

Detailed Description

Delegate for QTableView to draw a checkbox as an left-right (unchecked) and top-bottom (checked) arrow.

The checkbox has an extra state for unchecked disabled. Based on a Stack overflow answer: http://stackoverflow.com/questions/3363190/qt-qtableview-how-to-have-a-checkbox-only-column

Definition at line 43 of file pqCheckBoxDelegate.h.

Member Enumeration Documentation

◆ CheckBoxValues

Enumerator
NOT_EXPANDED 
EXPANDED 
NOT_EXPANDED_DISABLED 

Definition at line 48 of file pqCheckBoxDelegate.h.

Constructor & Destructor Documentation

◆ pqCheckBoxDelegate()

pqCheckBoxDelegate::pqCheckBoxDelegate ( QObject *  parent)

◆ ~pqCheckBoxDelegate()

pqCheckBoxDelegate::~pqCheckBoxDelegate ( )
override

Member Function Documentation

◆ paint()

void pqCheckBoxDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

◆ editorEvent()

bool pqCheckBoxDelegate::editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)
override

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