 |
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:264
QObject * m_object
Definition: objectcontroller.cpp:104
int enumToInt(const QMetaEnum &metaEnum, int enumValue) const
Definition: ObjectController.cpp:69
QMap< int, QtVariantProperty * > m_indexToDynamicProperty
map from idx of the dynamic property to the property
Definition: ObjectController.h:299
QMap< QString, QtProperty * > groupProperties
map of all the QtProperty that are top-level groups
Definition: ObjectController.h:326
void setStatusTip(const QString &text)
Definition: qtpropertybrowser.cpp:318
Definition: ObjectController.h:263
void valueChanged(QtProperty *property, const QVariant value)
Definition: ObjectController.cpp:494
void addClassProperties(const QMetaObject *metaObject)
Definition: ObjectController.cpp:314
QMap< int, QIcon > getEnumIcons() const
get the enum icons
Definition: Property.cpp:149
void initViewMode()
initialize the view mode depending on currentViewMode
Definition: ObjectController.cpp:652
QMap< QtProperty *, int > m_dynamicPropertyToIndex
map from the dynamic property to the idx in the dynamic property
Definition: ObjectController.h:301
QMap< QtProperty *, QVariant > saveChangeValue
when a property is modified by the user, the change is stored here (until applyChange is called)
Definition: ObjectController.h:310
The description of this class will come soon !
Definition: qttreepropertybrowser.h:60
QMap< QtProperty *, bool > m_propertyToExpanded
Definition: objectcontroller.cpp:111
Definition: objectcontroller.h:47
void slotValueChanged(QtProperty *property, const QVariant &value)
Definition: objectcontroller.cpp:313
QtVariantPropertyManager * m_manager
Definition: objectcontroller.cpp:116
QString getGroupName() const
get this property subgroup's name
Definition: Property.cpp:159
void saveExpandedState()
Definition: ObjectController.cpp:486
~ObjectController() override
destructor of object controller
Definition: ObjectController.cpp:573
QtVariantPropertyManager * m_manager
the main property manager (does not include the read only property)
Definition: ObjectController.h:316
void setRootIsDecorated(bool show)
Definition: qttreepropertybrowser.cpp:792
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
Definition: qtpropertybrowser.h:297
QMap< const QMetaObject *, QMap< int, QtVariantProperty * > > m_classToIndexToProperty
Each meta object have a map to get the property by its index.
Definition: ObjectController.h:296
void setEnabled(bool enable)
Definition: qtpropertybrowser.cpp:362
void updateClassProperties(const QMetaObject *metaObject, bool recursive)
Definition: objectcontroller.cpp:186
QMap< const QMetaObject *, QMap< int, QtVariantProperty * > > m_classToIndexToProperty
Definition: objectcontroller.cpp:109
ObjectControllerPrivate * d_ptr
Definition: objectcontroller.h:57
QMap< const QMetaObject *, QtProperty * > m_classToProperty
Definition: objectcontroller.cpp:106
bool isSubValue(int value, int subValue) const
Definition: ObjectController.cpp:108
static int enumTypeId()
Definition: qtvariantproperty.cpp:90
@ TREE
The property browser can be shown like a QListView.
Definition: ObjectController.h:196
QtBrowserItem * addProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:1783
ViewMode
Definition: ObjectController.h:195
void apply()
slot to apply change made by the user in the property editor
Definition: ObjectController.cpp:682
void saveChange(QtProperty *property, const QVariant &value)
Definition: ObjectController.cpp:529
The QtVariantPropertyManager class provides and manages QVariant based properties.
Definition: qtvariantproperty.h:117
int intToFlag(const QMetaEnum &metaEnum, int intValue) const
Definition: ObjectController.cpp:165
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:113
QtVariantPropertyManager * m_readOnlyManager
the property manager for the read only property
Definition: ObjectController.h:319
QVBoxLayout * layout
layout which will contains the propertybrowser and, in view mode GROUPBOX and BUTTON,...
Definition: ObjectController.h:256
static int flagTypeId()
Definition: qtvariantproperty.cpp:103
void addClassProperties(const QMetaObject *metaObject)
Definition: objectcontroller.cpp:221
QMap< QtProperty *, int > m_propertyToIndex
Definition: objectcontroller.cpp:108
void setObject(QObject *object)
Definition: objectcontroller.cpp:375
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:314
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:313
void setFactoryForManager(PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
Definition: qtpropertybrowser.h:311
bool isPowerOf2(int value) const
Definition: ObjectController.cpp:129
void setWhatsThis(const QString &text)
Definition: qtpropertybrowser.cpp:332
void saveExpandedState()
Definition: objectcontroller.cpp:305
void applyChange()
Definition: ObjectController.cpp:533
QObject * m_object
the currently edited object
Definition: ObjectController.h:287
ObjectController * q_ptr
Definition: objectcontroller.cpp:88
The QtVariantProperty class is a convenience class handling QVariant based properties.
Definition: qtvariantproperty.h:95
void restoreExpandedState()
Definition: objectcontroller.cpp:309
int flagToInt(const QMetaEnum &metaEnum, int flagValue) const
Definition: ObjectController.cpp:141
void setObject(QObject *object)
mutatorMethod of the object at unroll in the property browser
Definition: ObjectController.cpp:577
The object controller class.
Definition: ObjectController.h:185
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:59
QObject * object() const
accessorMethod of the object contains in the property browser
Definition: ObjectController.cpp:611
bool getReadOnly() const
Definition: Property.cpp:88
void setToolTip(const QString &text)
Definition: qtpropertybrowser.cpp:304
QtVariantPropertyManager * m_readOnlyManager
Definition: objectcontroller.cpp:117
QScrollArea * scroll
scroll add to navigate in the property browser
Definition: ObjectController.h:259
bool isModified()
call this to check if a modification was done
Definition: ObjectController.cpp:678
const char * description
Definition: applications/cepgenerator/main.cpp:37
int intToFlag(const QMetaEnum &metaEnum, int intValue) const
Definition: objectcontroller.cpp:160
void updateDynamicProperties(const QObject *edited)
Definition: ObjectController.cpp:362
ObjectController(QWidget *parent=0)
Definition: objectcontroller.cpp:339
QStringList getAttributeList()
returns the list of attribute names that are specific to this property
Definition: Property.cpp:179
QMap< QtProperty *, bool > m_propertyToExpanded
TODO doc.
Definition: ObjectController.h:304
The QtVariantEditorFactory class provides widgets for properties created by QtVariantPropertyManager ...
Definition: qtvariantproperty.h:206
void removeProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:1850
void setAutoUpdateProperty(bool)
if set, the properties are immediatly updated in the managed object (default false)
Definition: ObjectController.cpp:616
QString getEnumTypeName() const
Definition: Property.cpp:104
QtAbstractPropertyBrowser * m_browser
Definition: objectcontroller.cpp:115
void addDynamicProperties(QObject *edited)
Definition: ObjectController.cpp:385
@ Interactive
Definition: qttreepropertybrowser.h:73
ViewMode getViewMode() const
accessorMethod of the view mode
Definition: ObjectController.cpp:674
QList< QtProperty * > m_topLevelProperties
TODO doc.
Definition: ObjectController.h:307
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:83
Definition: objectcontroller.cpp:50
QMap< QtProperty *, int > m_classPropertyToIndex
map from the class property to the index in the meta object
Definition: ObjectController.h:294
@ BUTTON
It is like the GROUPBOX but the buttons allow the user to control the comput display of arborescence.
Definition: ObjectController.h:198
void setValue(const QVariant &value)
Definition: qtvariantproperty.cpp:263
QObject * object() const
Definition: objectcontroller.cpp:400
QVariant getAttribute(QString attName)
get the current value of a given attribute, see setAttribute() if the attribute attName was never set...
Definition: Property.cpp:169
void setViewMode(ViewMode viewMode)
mutator Method of the view mode
Definition: ObjectController.cpp:627
ObjectControllerPrivate * d_ptr
private object controller wich contains pointer about object, browser and more
Definition: ObjectController.h:239
~ObjectController()
Definition: objectcontroller.cpp:371
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:544
void revert()
slot to revert the values of all properties (revert to values in memory)
Definition: ObjectController.cpp:686
QList< QtProperty * > m_topLevelProperties
Definition: objectcontroller.cpp:113
@ GROUPBOX
It is like the TREE but with a delimitation to indicate the arborescence of the property type.
Definition: ObjectController.h:197
const QString & getDescription() const
get the description
Definition: Property.cpp:98
int intToEnum(const QMetaEnum &metaEnum, int intValue) const
Definition: ObjectController.cpp:88
void setAttribute(const QString &attribute, const QVariant &value)
Definition: qtvariantproperty.cpp:276
int intToEnum(const QMetaEnum &metaEnum, int intValue) const
Definition: objectcontroller.cpp:98
virtual bool isPropertyTypeSupported(int propertyType) const
Definition: qtvariantproperty.cpp:1300
int flagToInt(const QMetaEnum &metaEnum, int flagValue) const
Definition: objectcontroller.cpp:141
void updateClassProperties(const QMetaObject *metaObject, bool recursive)
Definition: ObjectController.cpp:198
void addSubProperty(QtProperty *property)
Definition: qtpropertybrowser.cpp:393
QVariant value() const
Definition: qtvariantproperty.cpp:213
static int groupTypeId()
Definition: qtvariantproperty.cpp:116
void restoreExpandedState()
Definition: ObjectController.cpp:490
bool isPowerOf2(int value) const
Definition: objectcontroller.cpp:131
bool isSubValue(int value, int subValue) const
Definition: objectcontroller.cpp:114
QMap< QtProperty *, const QMetaObject * > m_propertyToClass
Definition: objectcontroller.cpp:107
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:230
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:36