#include <qxtcheckcombobox_p.h>
Signals | |
void | checkStateChanged () |
Public Member Functions | |
QxtCheckComboModel (QObject *parent=0) | |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
Definition at line 33 of file qxtcheckcombobox_p.h.
QxtCheckComboModel::QxtCheckComboModel | ( | QObject * | parent = 0 ) |
[explicit] |
Definition at line 93 of file qxtcheckcombobox.cpp.
: QStandardItemModel(0, 1, parent) // rows,cols
{
}
void QxtCheckComboModel::checkStateChanged | ( | ) | [signal] |
Referenced by setData().
QVariant QxtCheckComboModel::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const [virtual] |
Definition at line 103 of file qxtcheckcombobox.cpp.
{ QVariant value = QStandardItemModel::data(index, role); if (index.isValid() && role == Qt::CheckStateRole && !value.isValid()) value = Qt::Unchecked; return value; }
Qt::ItemFlags QxtCheckComboModel::flags | ( | const QModelIndex & | index ) | const [virtual] |
Definition at line 98 of file qxtcheckcombobox.cpp.
{ return QStandardItemModel::flags(index) | Qt::ItemIsUserCheckable; }
bool QxtCheckComboModel::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role = Qt::EditRole |
||
) | [virtual] |
Definition at line 111 of file qxtcheckcombobox.cpp.
References checkStateChanged().
{ bool ok = QStandardItemModel::setData(index, value, role); if (ok && role == Qt::CheckStateRole) { emit dataChanged(index, index); emit checkStateChanged(); } return ok; }