#include <Libs/Widgets/ctkCheckableModelHelper.h>
|
QScopedPointer< ctkCheckableModelHelperPrivate > | d_ptr |
|
ctkCheckableModelHelper expose functions to handle checkable models
Definition at line 68 of file ctkCheckableModelHelper.h.
◆ ctkCheckableModelHelper()
ctkCheckableModelHelper::ctkCheckableModelHelper |
( |
Qt::Orientation |
orientation, |
|
|
QObject * |
parent = 0 |
|
) |
| |
◆ ~ctkCheckableModelHelper()
virtual ctkCheckableModelHelper::~ctkCheckableModelHelper |
( |
| ) |
|
|
virtual |
◆ checkState() [1/2]
Qt::CheckState ctkCheckableModelHelper::checkState |
( |
const QModelIndex & |
| ) |
const |
◆ checkState() [2/2]
bool ctkCheckableModelHelper::checkState |
( |
const QModelIndex & |
, |
|
|
Qt::CheckState & |
checkState |
|
) |
| const |
◆ defaultCheckState()
Qt::CheckState ctkCheckableModelHelper::defaultCheckState |
( |
| ) |
const |
◆ forceCheckability()
bool ctkCheckableModelHelper::forceCheckability |
( |
| ) |
const |
◆ headerCheckState() [1/2]
Qt::CheckState ctkCheckableModelHelper::headerCheckState |
( |
int |
section | ) |
const |
Utility function that returns the checkState of the section. One can access the same value through the model: model->headerData(orientation, section, Qt::CheckStateRole)
◆ headerCheckState() [2/2]
bool ctkCheckableModelHelper::headerCheckState |
( |
int |
section, |
|
|
Qt::CheckState & |
checkState |
|
) |
| const |
Utility function that returns the checkState of the section. One can access the same value through the model: model->headerData(orientation, section, Qt::CheckStateRole)
◆ isCheckable()
bool ctkCheckableModelHelper::isCheckable |
( |
const QModelIndex & |
index | ) |
const |
◆ isHeaderCheckable()
bool ctkCheckableModelHelper::isHeaderCheckable |
( |
int |
section | ) |
const |
A section is checkable if its CheckStateRole data is non null. One can access the same value through the model: model->headerData(orientation, section, Qt::CheckStateRole).isEmpty()
◆ model()
QAbstractItemModel* ctkCheckableModelHelper::model |
( |
| ) |
const |
When setting the model, if PropagateToItems is true (by default), the check state of the checkable headers is updated from the check state of the items If you want to make sure of the check state of a header, after setting the (done by myView.setHeader(myCheckableModelHelper)), you can call myModel.setHeaderData(0, Qt::Horizontal, Qt::Checked, Qt::CheckStateRole) or myCheckableModelHelper->setCheckState(0, Qt::Checked)
◆ orientation()
Qt::Orientation ctkCheckableModelHelper::orientation |
( |
| ) |
const |
◆ propagateDepth()
int ctkCheckableModelHelper::propagateDepth |
( |
| ) |
const |
◆ rootIndex()
QModelIndex ctkCheckableModelHelper::rootIndex |
( |
| ) |
const |
Reimplemented for internal reasons.
◆ setCheckState
void ctkCheckableModelHelper::setCheckState |
( |
const QModelIndex & |
modelIndex, |
|
|
Qt::CheckState |
checkState |
|
) |
| |
|
slot |
◆ setDefaultCheckState()
void ctkCheckableModelHelper::setDefaultCheckState |
( |
Qt::CheckState |
| ) |
|
◆ setForceCheckability()
void ctkCheckableModelHelper::setForceCheckability |
( |
bool |
force | ) |
|
When true, the new items are automatically set to checkable.
◆ setHeaderCheckState
void ctkCheckableModelHelper::setHeaderCheckState |
( |
int |
section, |
|
|
Qt::CheckState |
checkState |
|
) |
| |
|
slot |
Warning, setting the check state automatically set the header section checkable
◆ setModel()
virtual void ctkCheckableModelHelper::setModel |
( |
QAbstractItemModel * |
model | ) |
|
|
virtual |
◆ setPropagateDepth()
void ctkCheckableModelHelper::setPropagateDepth |
( |
int |
depth | ) |
|
How deep in the model(tree) do you want the check state to be propagated A value of -1 correspond to the deepest level of the model. -1 by default
◆ setRootIndex()
virtual void ctkCheckableModelHelper::setRootIndex |
( |
const QModelIndex & |
index | ) |
|
|
virtual |
◆ toggleCheckState
void ctkCheckableModelHelper::toggleCheckState |
( |
const QModelIndex & |
modelIndex | ) |
|
|
slot |
Utility function to toggle the checkstate of an index.
◆ toggleHeaderCheckState
void ctkCheckableModelHelper::toggleHeaderCheckState |
( |
int |
section | ) |
|
|
slot |
◆ d_ptr
QScopedPointer<ctkCheckableModelHelperPrivate> ctkCheckableModelHelper::d_ptr |
|
protected |
◆ defaultCheckState
Qt::CheckState ctkCheckableModelHelper::defaultCheckState |
|
readwrite |
◆ forceCheckability
bool ctkCheckableModelHelper::forceCheckability |
|
readwrite |
◆ propagateDepth
int ctkCheckableModelHelper::propagateDepth |
|
readwrite |
The documentation for this class was generated from the following file: