#include <ObjectController.h>
Public Member Functions | |
void | addClassProperties (const QMetaObject *metaObject) |
void | addDynamicProperties (QObject *edited) |
void | applyChange () |
QtVariantProperty * | buildQtVariantProperty (QString name, QMetaType::Type type, QVariant value, bool isReadable, bool isWritable, bool isEnumType, bool isFlagType, bool isDesignable, QMetaEnum *metaEnum=NULL) |
build a QtVariantProperty from name, type, property...etc... More... | |
int | enumToInt (const QMetaEnum &metaEnum, int enumValue) const |
int | flagToInt (const QMetaEnum &metaEnum, int flagValue) const |
int | intToEnum (const QMetaEnum &metaEnum, int intValue) const |
int | intToFlag (const QMetaEnum &metaEnum, int intValue) const |
bool | isPowerOf2 (int value) const |
bool | isSubValue (int value, int subValue) const |
void | restoreExpandedState () |
void | saveChange (QtProperty *property, const QVariant &value) |
void | saveExpandedState () |
void | updateClassProperties (const QMetaObject *metaObject, bool recursive) |
void | updateDynamicProperties (const QObject *edited) |
void | valueChanged (QtProperty *property, const QVariant value) |
Public Attributes | |
QMap< QString, QtProperty * > | groupProperties |
map of all the QtProperty that are top-level groups More... | |
QtAbstractPropertyBrowser * | m_browser |
the browser where all properties are shown to the user More... | |
QMap< QtProperty *, int > | m_classPropertyToIndex |
map from the class property to the index in the meta object More... | |
QMap< const QMetaObject *, QMap< int, QtVariantProperty * > > | m_classToIndexToProperty |
Each meta object have a map to get the property by its index. More... | |
QMap< QtProperty *, int > | m_dynamicPropertyToIndex |
map from the dynamic property to the idx in the dynamic property More... | |
QMap< int, QtVariantProperty * > | m_indexToDynamicProperty |
map from idx of the dynamic property to the property More... | |
QtVariantPropertyManager * | m_manager |
the main property manager (does not include the read only property) More... | |
QObject * | m_object |
the currently edited object More... | |
QMap< QtProperty *, bool > | m_propertyToExpanded |
TODO doc. More... | |
QtVariantPropertyManager * | m_readOnlyManager |
the property manager for the read only property More... | |
QList< QtProperty * > | m_topLevelProperties |
TODO doc. More... | |
QMap< QtProperty *, QVariant > | saveChangeValue |
when a property is modified by the user, the change is stored here (until applyChange is called) More... | |
void ObjectControllerPrivate::addClassProperties | ( | const QMetaObject * | metaObject | ) |
References QtAbstractPropertyBrowser::addProperty(), buildQtVariantProperty(), m_browser, m_classPropertyToIndex, m_classToIndexToProperty, m_object, and m_topLevelProperties.
Referenced by camitk::ObjectController::setObject().
void ObjectControllerPrivate::addDynamicProperties | ( | QObject * | edited | ) |
References QtVariantPropertyManager::addProperty(), QtAbstractPropertyBrowser::addProperty(), QtProperty::addSubProperty(), buildQtVariantProperty(), description, camitk::Property::getAttribute(), camitk::Property::getAttributeList(), camitk::Property::getDescription(), camitk::Property::getEnumIcons(), camitk::Property::getEnumTypeName(), camitk::Property::getGroupName(), camitk::Property::getProperty(), camitk::Property::getReadOnly(), groupProperties, QtVariantPropertyManager::groupTypeId(), m_browser, m_dynamicPropertyToIndex, m_indexToDynamicProperty, m_manager, m_topLevelProperties, QtVariantProperty::setAttribute(), QtProperty::setStatusTip(), QtProperty::setToolTip(), QtVariantProperty::setValue(), and QtProperty::setWhatsThis().
Referenced by camitk::ObjectController::setObject().
void ObjectControllerPrivate::applyChange | ( | ) |
References saveChangeValue, and valueChanged().
Referenced by camitk::ObjectController::apply().
QtVariantProperty * ObjectControllerPrivate::buildQtVariantProperty | ( | QString | name, |
QMetaType::Type | type, | ||
QVariant | value, | ||
bool | isReadable, | ||
bool | isWritable, | ||
bool | isEnumType, | ||
bool | isFlagType, | ||
bool | isDesignable, | ||
QMetaEnum * | metaEnum = NULL |
||
) |
build a QtVariantProperty from name, type, property...etc...
References QtVariantPropertyManager::addProperty(), QtProperty::addSubProperty(), enumToInt(), QtVariantPropertyManager::enumTypeId(), flagToInt(), QtVariantPropertyManager::flagTypeId(), QtVariantPropertyManager::groupTypeId(), isPowerOf2(), QtVariantPropertyManager::isPropertyTypeSupported(), m_manager, m_readOnlyManager, QtVariantProperty::setAttribute(), QtProperty::setEnabled(), QtVariantProperty::setValue(), and QtVariantProperty::value().
Referenced by addClassProperties(), and addDynamicProperties().
int ObjectControllerPrivate::enumToInt | ( | const QMetaEnum & | metaEnum, |
int | enumValue | ||
) | const |
Referenced by buildQtVariantProperty(), and updateClassProperties().
int ObjectControllerPrivate::flagToInt | ( | const QMetaEnum & | metaEnum, |
int | flagValue | ||
) | const |
References isPowerOf2(), and isSubValue().
Referenced by buildQtVariantProperty(), and updateClassProperties().
int ObjectControllerPrivate::intToEnum | ( | const QMetaEnum & | metaEnum, |
int | intValue | ||
) | const |
int ObjectControllerPrivate::intToFlag | ( | const QMetaEnum & | metaEnum, |
int | intValue | ||
) | const |
References isPowerOf2().
Referenced by valueChanged().
bool ObjectControllerPrivate::isPowerOf2 | ( | int | value | ) | const |
Referenced by buildQtVariantProperty(), flagToInt(), and intToFlag().
bool ObjectControllerPrivate::isSubValue | ( | int | value, |
int | subValue | ||
) | const |
void ObjectControllerPrivate::restoreExpandedState | ( | ) |
void ObjectControllerPrivate::saveChange | ( | QtProperty * | property, |
const QVariant & | value | ||
) |
References saveChangeValue.
void ObjectControllerPrivate::saveExpandedState | ( | ) |
void ObjectControllerPrivate::updateClassProperties | ( | const QMetaObject * | metaObject, |
bool | recursive | ||
) |
References enumToInt(), flagToInt(), m_classToIndexToProperty, m_object, and QtVariantProperty::setValue().
Referenced by valueChanged().
void ObjectControllerPrivate::updateDynamicProperties | ( | const QObject * | edited | ) |
References QtVariantPropertyManager::isPropertyTypeSupported(), m_indexToDynamicProperty, m_manager, and QtVariantProperty::setValue().
Referenced by valueChanged().
void ObjectControllerPrivate::valueChanged | ( | QtProperty * | property, |
const QVariant | value | ||
) |
References intToEnum(), intToFlag(), m_classPropertyToIndex, m_dynamicPropertyToIndex, m_object, updateClassProperties(), and updateDynamicProperties().
Referenced by applyChange().
QMap<QString, QtProperty*> camitk::ObjectControllerPrivate::groupProperties |
map of all the QtProperty that are top-level groups
Referenced by addDynamicProperties(), and camitk::ObjectController::setObject().
QtAbstractPropertyBrowser* camitk::ObjectControllerPrivate::m_browser |
the browser where all properties are shown to the user
Referenced by addClassProperties(), addDynamicProperties(), camitk::ObjectController::ObjectController(), camitk::ObjectController::setObject(), and camitk::ObjectController::setViewMode().
QMap<QtProperty*, int> camitk::ObjectControllerPrivate::m_classPropertyToIndex |
map from the class property to the index in the meta object
Referenced by addClassProperties(), and valueChanged().
QMap<const QMetaObject*, QMap<int, QtVariantProperty*> > camitk::ObjectControllerPrivate::m_classToIndexToProperty |
Each meta object have a map to get the property by its index.
Referenced by addClassProperties(), and updateClassProperties().
QMap<QtProperty*, int> camitk::ObjectControllerPrivate::m_dynamicPropertyToIndex |
map from the dynamic property to the idx in the dynamic property
Referenced by addDynamicProperties(), and valueChanged().
QMap<int, QtVariantProperty*> camitk::ObjectControllerPrivate::m_indexToDynamicProperty |
map from idx of the dynamic property to the property
Referenced by addDynamicProperties(), and updateDynamicProperties().
QtVariantPropertyManager* camitk::ObjectControllerPrivate::m_manager |
the main property manager (does not include the read only property)
Referenced by addDynamicProperties(), buildQtVariantProperty(), camitk::ObjectController::ObjectController(), camitk::ObjectController::setAutoUpdateProperty(), and updateDynamicProperties().
QObject* camitk::ObjectControllerPrivate::m_object |
the currently edited object
Referenced by addClassProperties(), camitk::ObjectController::object(), camitk::ObjectController::ObjectController(), camitk::ObjectController::setObject(), updateClassProperties(), and valueChanged().
QMap<QtProperty*, bool> camitk::ObjectControllerPrivate::m_propertyToExpanded |
TODO doc.
QtVariantPropertyManager* camitk::ObjectControllerPrivate::m_readOnlyManager |
the property manager for the read only property
Referenced by buildQtVariantProperty(), and camitk::ObjectController::ObjectController().
QList<QtProperty*> camitk::ObjectControllerPrivate::m_topLevelProperties |
TODO doc.
Referenced by addClassProperties(), addDynamicProperties(), and camitk::ObjectController::setObject().
QMap<QtProperty*, QVariant> camitk::ObjectControllerPrivate::saveChangeValue |
when a property is modified by the user, the change is stored here (until applyChange is called)
Referenced by applyChange(), camitk::ObjectController::isModified(), camitk::ObjectController::revert(), saveChange(), and camitk::ObjectController::setObject().