 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
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);
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);
ObjectController * q_ptr
Definition: ObjectController.h:262
QObject * m_object
Definition: objectcontroller.cpp:102
int enumToInt(const QMetaEnum &metaEnum, int enumValue) const
Definition: ObjectController.cpp:68
QMap< int, QtVariantProperty * > m_indexToDynamicProperty
map from idx of the dynamic property to the property
Definition: ObjectController.h:297
QMap< QString, QtProperty * > groupProperties
map of all the QtProperty that are top-level groups
Definition: ObjectController.h:324
void setStatusTip(const QString &text)
Definition: qtpropertybrowser.cpp:317
Definition: ObjectController.h:261
void valueChanged(QtProperty *property, const QVariant value)
Definition: ObjectController.cpp:493
void addClassProperties(const QMetaObject *metaObject)
Definition: ObjectController.cpp:313
QMap< int, QIcon > getEnumIcons() const
get the enum icons
Definition: Property.cpp:147
void initViewMode()
initialize the view mode depending on currentViewMode
Definition: ObjectController.cpp:651
QMap< QtProperty *, int > m_dynamicPropertyToIndex
map from the dynamic property to the idx in the dynamic property
Definition: ObjectController.h:299
QMap< QtProperty *, QVariant > saveChangeValue
when a property is modified by the user, the change is stored here (until applyChange is called)
Definition: ObjectController.h:308
The description of this class will come soon !
Definition: qttreepropertybrowser.h:59
QMap< QtProperty *, bool > m_propertyToExpanded
Definition: objectcontroller.cpp:109
Definition: objectcontroller.h:46
void slotValueChanged(QtProperty *property, const QVariant &value)
Definition: objectcontroller.cpp:312
QtVariantPropertyManager * m_manager
Definition: objectcontroller.cpp:114
QString getGroupName() const
get this property subgroup's name
Definition: Property.cpp:157
void saveExpandedState()
Definition: ObjectController.cpp:485
~ObjectController() override
destructor of object controller
Definition: ObjectController.cpp:572
QtVariantPropertyManager * m_manager
the main property manager (does not include the read only property)
Definition: ObjectController.h:314
void setRootIsDecorated(bool show)
Definition: qttreepropertybrowser.cpp:792
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition: qtpropertybrowser.h:296
QMap< const QMetaObject *, QMap< int, QtVariantProperty * > > m_classToIndexToProperty
Each meta object have a map to get the property by its index.
Definition: ObjectController.h:294
void setEnabled(bool enable)
Definition: qtpropertybrowser.cpp:361
void updateClassProperties(const QMetaObject *metaObject, bool recursive)
Definition: objectcontroller.cpp:185
QMap< const QMetaObject *, QMap< int, QtVariantProperty * > > m_classToIndexToProperty
Definition: objectcontroller.cpp:107
ObjectControllerPrivate * d_ptr
Definition: objectcontroller.h:56
QMap< const QMetaObject *, QtProperty * > m_classToProperty
Definition: objectcontroller.cpp:104
bool isSubValue(int value, int subValue) const
Definition: ObjectController.cpp:107
static int enumTypeId()
Definition: qtvariantproperty.cpp:90
The property browser can be shown like a QListView.
Definition: ObjectController.h:194
QtBrowserItem * addProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:1782
ViewMode
Definition: ObjectController.h:193
void apply()
slot to apply change made by the user in the property editor
Definition: ObjectController.cpp:681
void saveChange(QtProperty *property, const QVariant &value)
Definition: ObjectController.cpp:528
The QtVariantPropertyManager class provides and manages QVariant based properties.
Definition: qtvariantproperty.h:116
int intToFlag(const QMetaEnum &metaEnum, int intValue) const
Definition: ObjectController.cpp:164
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:112
QtVariantPropertyManager * m_readOnlyManager
the property manager for the read only property
Definition: ObjectController.h:317
QVBoxLayout * layout
layout which will contains the propertybrowser and, in view mode GROUPBOX and BUTTON,...
Definition: ObjectController.h:254
static int flagTypeId()
Definition: qtvariantproperty.cpp:103
void addClassProperties(const QMetaObject *metaObject)
Definition: objectcontroller.cpp:220
QMap< QtProperty *, int > m_propertyToIndex
Definition: objectcontroller.cpp:106
void setObject(QObject *object)
Definition: objectcontroller.cpp:374
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:312
virtual QtVariantProperty * addProperty(int propertyType, const QString &name=QString())
Definition: qtvariantproperty.cpp:1321
QtAbstractPropertyBrowser * m_browser
the browser where all properties are shown to the user
Definition: ObjectController.h:311
void setFactoryForManager(PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
Definition: qtpropertybrowser.h:310
bool isPowerOf2(int value) const
Definition: ObjectController.cpp:128
void setWhatsThis(const QString &text)
Definition: qtpropertybrowser.cpp:331
void saveExpandedState()
Definition: objectcontroller.cpp:304
void applyChange()
Definition: ObjectController.cpp:532
QObject * m_object
the currently edited object
Definition: ObjectController.h:285
ObjectController * q_ptr
Definition: objectcontroller.cpp:86
The QtVariantProperty class is a convenience class handling QVariant based properties.
Definition: qtvariantproperty.h:94
void restoreExpandedState()
Definition: objectcontroller.cpp:308
int flagToInt(const QMetaEnum &metaEnum, int flagValue) const
Definition: ObjectController.cpp:140
void setObject(QObject *object)
mutatorMethod of the object at unroll in the property browser
Definition: ObjectController.cpp:576
The object controller class.
Definition: ObjectController.h:183
void valueChanged(QtProperty *, const QVariant &)) ViewMode currentViewMode
variable to choose the type of property browser
The description of this class will come soon !
Definition: qtgroupboxpropertybrowser.h:58
QObject * object() const
accessorMethod of the object contains in the property browser
Definition: ObjectController.cpp:610
bool getReadOnly() const
Definition: Property.cpp:86
void setToolTip(const QString &text)
Definition: qtpropertybrowser.cpp:303
QtVariantPropertyManager * m_readOnlyManager
Definition: objectcontroller.cpp:115
QScrollArea * scroll
scroll add to navigate in the property browser
Definition: ObjectController.h:257
bool isModified()
call this to check if a modification was done
Definition: ObjectController.cpp:677
const char * description
Definition: applications/cepgenerator/main.cpp:37
int intToFlag(const QMetaEnum &metaEnum, int intValue) const
Definition: objectcontroller.cpp:159
void updateDynamicProperties(const QObject *edited)
Definition: ObjectController.cpp:361
ObjectController(QWidget *parent=0)
Definition: objectcontroller.cpp:338
QStringList getAttributeList()
returns the list of attribute names that are specific to this property
Definition: Property.cpp:177
QMap< QtProperty *, bool > m_propertyToExpanded
TODO doc.
Definition: ObjectController.h:302
The QtVariantEditorFactory class provides widgets for properties created by QtVariantPropertyManager ...
Definition: qtvariantproperty.h:205
void removeProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:1849
void setAutoUpdateProperty(bool)
if set, the properties are immediatly updated in the managed object (default false)
Definition: ObjectController.cpp:615
QString getEnumTypeName() const
Definition: Property.cpp:102
QtAbstractPropertyBrowser * m_browser
Definition: objectcontroller.cpp:113
void addDynamicProperties(QObject *edited)
Definition: ObjectController.cpp:384
Definition: qttreepropertybrowser.h:72
ViewMode getViewMode() const
accessorMethod of the view mode
Definition: ObjectController.cpp:673
QList< QtProperty * > m_topLevelProperties
TODO doc.
Definition: ObjectController.h:305
Q_ENUMS(ControlMode CameraOrientation)
RendererWidget implements all support methods to use camiTK with Qt interface.
int enumToInt(const QMetaEnum &metaEnum, int enumValue) const
Definition: objectcontroller.cpp:82
Definition: objectcontroller.cpp:49
QMap< QtProperty *, int > m_classPropertyToIndex
map from the class property to the index in the meta object
Definition: ObjectController.h:292
It is like the GROUPBOX but the buttons allow the user to control the comput display of arborescence.
Definition: ObjectController.h:196
void setValue(const QVariant &value)
Definition: qtvariantproperty.cpp:263
QObject * object() const
Definition: objectcontroller.cpp:399
QVariant getAttribute(QString attName)
get the current value of a given attribute, see setAttribute() if the attribute attName was never set...
Definition: Property.cpp:167
void setViewMode(ViewMode viewMode)
mutator Method of the view mode
Definition: ObjectController.cpp:626
ObjectControllerPrivate * d_ptr
private object controller wich contains pointer about object, browser and more
Definition: ObjectController.h:237
~ObjectController()
Definition: objectcontroller.cpp:370
ObjectController(QWidget *parent=nullptr, ViewMode viewMode=TREE)
constructor of object controller with in parameters the parent widget and the view mode (default : TR...
Definition: ObjectController.cpp:543
void revert()
slot to revert the values of all properties (revert to values in memory)
Definition: ObjectController.cpp:685
QList< QtProperty * > m_topLevelProperties
Definition: objectcontroller.cpp:111
It is like the TREE but with a delimitation to indicate the arborescence of the property type.
Definition: ObjectController.h:195
const QString & getDescription() const
get the description
Definition: Property.cpp:96
int intToEnum(const QMetaEnum &metaEnum, int intValue) const
Definition: ObjectController.cpp:87
void setAttribute(const QString &attribute, const QVariant &value)
Definition: qtvariantproperty.cpp:276
int intToEnum(const QMetaEnum &metaEnum, int intValue) const
Definition: objectcontroller.cpp:97
virtual bool isPropertyTypeSupported(int propertyType) const
Definition: qtvariantproperty.cpp:1300
int flagToInt(const QMetaEnum &metaEnum, int flagValue) const
Definition: objectcontroller.cpp:140
void updateClassProperties(const QMetaObject *metaObject, bool recursive)
Definition: ObjectController.cpp:197
void addSubProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:392
QVariant value() const
Definition: qtvariantproperty.cpp:213
static int groupTypeId()
Definition: qtvariantproperty.cpp:116
void restoreExpandedState()
Definition: ObjectController.cpp:489
bool isPowerOf2(int value) const
Definition: objectcontroller.cpp:130
bool isSubValue(int value, int subValue) const
Definition: objectcontroller.cpp:113
QMap< QtProperty *, const QMetaObject * > m_propertyToClass
Definition: objectcontroller.cpp:105
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:229
#define CAMITK_API
Definition: CamiTKAPI.h:48
Definition: Action.cpp:36