#include <property_model.h>
Collaboration diagram for PropertyModel:
Public Slots | |
bool | createPropertySheet (ModuleInterface *) |
Public Member Functions | |
PropertyModel () | |
~PropertyModel () | |
IProperty * | rootProperty () const |
void | clear () |
bool | setData (const QModelIndex &, const QVariant &, int role=Qt::EditRole) |
QVariant | data (const QModelIndex &, int role=Qt::DisplayRole) const |
QModelIndex | index (int, int, const QModelIndex &parent=QModelIndex()) const |
QModelIndex | parent (const QModelIndex &index) const |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
int | columnCount (const QModelIndex &parent=QModelIndex()) const |
QVariant | headerData (int, Qt::Orientation, int role=Qt::DisplayRole) const |
Qt::ItemFlags | flags (const QModelIndex &) const |
Private Attributes | |
IProperty * | m_rootItem |
ModuleInterface * | m_module |
PropertyModel::PropertyModel | ( | ) |
PropertyModel::~PropertyModel | ( | ) |
void PropertyModel::clear | ( | ) |
deletes all visual properties in the tree
int PropertyModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
bool PropertyModel::createPropertySheet | ( | ModuleInterface * | module | ) | [slot] |
creates the visual property tree of a module. Most of the QVariant types are supported see AbstractProperty for details.
UnsupportedException | is thrown when the module has a property item that is not supported |
module | with a NULL pointer the property tree will be deleted otherwise the visual property tree will be created |
QVariant PropertyModel::data | ( | const QModelIndex & | index, | |
int | role = Qt::DisplayRole | |||
) | const |
returns information how a property look like or which property value will be set on different roles.
index | gives the current index | |
role | determine what kind of data is returned |
Qt::ItemFlags PropertyModel::flags | ( | const QModelIndex & | index | ) | const |
QVariant PropertyModel::headerData | ( | int | section, | |
Qt::Orientation | orientation, | |||
int | role = Qt::DisplayRole | |||
) | const |
QModelIndex PropertyModel::index | ( | int | row, | |
int | column, | |||
const QModelIndex & | parent = QModelIndex() | |||
) | const |
QModelIndex PropertyModel::parent | ( | const QModelIndex & | index | ) | const |
IProperty * PropertyModel::rootProperty | ( | ) | const |
int PropertyModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
bool PropertyModel::setData | ( | const QModelIndex & | index, | |
const QVariant & | value, | |||
int | role = Qt::EditRole | |||
) |
set the changed visual property value to intern property value of the module
index | determines where the property was changed | |
value | not used we get the value direct from the property item | |
role | determines on which role was the property changed |
ModuleInterface* PropertyModel::m_module [private] |
active module
IProperty* PropertyModel::m_rootItem [private] |
root node of the visual property tree