26 #ifndef OBJECTCONTROLLER_H
27 #define OBJECTCONTROLLER_H
31 #include <QtVariantProperty>
35 #include <QPushButton>
36 #include <QScrollArea>
37 #include <QVBoxLayout>
185 void setObject(QObject*
object);
188 QObject* object()
const;
191 void setAutoUpdateProperty(
bool);
195 void setViewMode(
ViewMode viewMode);
221 Q_PRIVATE_SLOT(d_func(),
void saveChange(
QtProperty*,
const QVariant&))
222 Q_PRIVATE_SLOT(d_func(),
void valueChanged(
QtProperty*,
const QVariant&))
256 int enumToInt(
const QMetaEnum& metaEnum,
int enumValue)
const;
257 int intToEnum(
const QMetaEnum& metaEnum,
int intValue)
const;
258 int flagToInt(
const QMetaEnum& metaEnum,
int flagValue)
const;
259 int intToFlag(
const QMetaEnum& metaEnum,
int intValue)
const;
260 bool isSubValue(
int value,
int subValue)
const;
300 QtVariantProperty*
buildQtVariantProperty(QString name, QMetaType::Type type, QVariant value,
bool isReadable,
bool isWritable,
bool isEnumType,
bool isFlagType,
bool isDesignable, QMetaEnum* metaEnum = NULL);
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: objectcontroller.cpp:50
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition: qtpropertybrowser.h:301
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:113
The QtVariantPropertyManager class provides and manages QVariant based properties.
Definition: qtvariantproperty.h:119
The QtVariantProperty class is a convenience class handling QVariant based properties.
Definition: qtvariantproperty.h:97
Definition: ObjectController.h:240
QMap< const QMetaObject *, QMap< int, QtVariantProperty * > > m_classToIndexToProperty
Each meta object have a map to get the property by its index.
Definition: ObjectController.h:273
int flagToInt(const QMetaEnum &metaEnum, int flagValue) const
Definition: ObjectController.cpp:118
void addDynamicProperties(QObject *edited)
Definition: ObjectController.cpp:361
QMap< QtProperty *, QVariant > saveChangeValue
when a property is modified by the user, the change is stored here (until applyChange is called)
Definition: ObjectController.h:287
void updateClassProperties(const QMetaObject *metaObject, bool recursive)
Definition: ObjectController.cpp:175
int intToEnum(const QMetaEnum &metaEnum, int intValue) const
Definition: ObjectController.cpp:65
QMap< QtProperty *, int > m_dynamicPropertyToIndex
map from the dynamic property to the idx in the dynamic property
Definition: ObjectController.h:278
QMap< QtProperty *, bool > m_propertyToExpanded
TODO doc.
Definition: ObjectController.h:281
QMap< QString, QtProperty * > groupProperties
map of all the QtProperty that are top-level groups
Definition: ObjectController.h:303
QMap< QtProperty *, int > m_classPropertyToIndex
map from the class property to the index in the meta object
Definition: ObjectController.h:271
int enumToInt(const QMetaEnum &metaEnum, int enumValue) const
Definition: ObjectController.cpp:46
void valueChanged(QtProperty *property, const QVariant value)
Definition: ObjectController.cpp:459
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...
Definition: ObjectController.cpp:207
void restoreExpandedState()
Definition: ObjectController.cpp:455
QMap< int, QtVariantProperty * > m_indexToDynamicProperty
map from idx of the dynamic property to the property
Definition: ObjectController.h:276
QtAbstractPropertyBrowser * m_browser
the browser where all properties are shown to the user
Definition: ObjectController.h:290
void updateDynamicProperties(const QObject *edited)
Definition: ObjectController.cpp:339
void saveExpandedState()
Definition: ObjectController.cpp:451
bool isSubValue(int value, int subValue) const
Definition: ObjectController.cpp:85
QList< QtProperty * > m_topLevelProperties
TODO doc.
Definition: ObjectController.h:284
QObject * m_object
the currently edited object
Definition: ObjectController.h:264
void addClassProperties(const QMetaObject *metaObject)
Definition: ObjectController.cpp:291
QtVariantPropertyManager * m_readOnlyManager
the property manager for the read only property
Definition: ObjectController.h:296
void saveChange(QtProperty *property, const QVariant &value)
Definition: ObjectController.cpp:494
QtVariantPropertyManager * m_manager
the main property manager (does not include the read only property)
Definition: ObjectController.h:293
int intToFlag(const QMetaEnum &metaEnum, int intValue) const
Definition: ObjectController.cpp:142
void applyChange()
Definition: ObjectController.cpp:498
bool isPowerOf2(int value) const
Definition: ObjectController.cpp:106
The object controller class.
Definition: ObjectController.h:162
ViewMode
The property browser can be shown in different view mode.
Definition: ObjectController.h:171
@ GROUPBOX
It is like the TREE but with a delimitation to indicate the arborescence of the property type.
Definition: ObjectController.h:173
@ TREE
The property browser can be shown like a QListView.
Definition: ObjectController.h:172
Definition: Action.cpp:36