26 #ifndef OBJECTCONTROLLER_H
27 #define OBJECTCONTROLLER_H
33 #include <QtGui/QWidget>
34 #include <QtVariantProperty>
35 #include <QPushButton>
36 #include <QVBoxLayout>
37 #include <QScrollArea>
44 class ObjectControllerPrivate;
161 void setObject ( QObject *
object );
164 QObject *object()
const;
167 void setAutoUpdateProperty(
bool);
171 void setViewMode ( ViewMode viewMode );
175 ViewMode getViewMode()
const;
197 Q_PRIVATE_SLOT ( d_func(),
void saveChange ( QtProperty *, const QVariant & ) )
198 Q_PRIVATE_SLOT ( d_func(),
void valueChanged ( QtProperty *, const QVariant & ) )
202 ViewMode currentViewMode;
221 void addClassProperties ( const QMetaObject *metaObject );
222 void addDynamicProperties ( const QObject *edited );
223 void updateClassProperties ( const QMetaObject *metaObject,
bool recursive );
224 void updateDynamicProperties ( const QObject * edited);
225 void saveExpandedState();
226 void restoreExpandedState();
227 void valueChanged ( QtProperty *property, const QVariant value );
229 void saveChange ( QtProperty *property, const QVariant &value );
232 int enumToInt ( const QMetaEnum &metaEnum,
int enumValue ) const;
233 int intToEnum ( const QMetaEnum &metaEnum,
int intValue ) const;
234 int flagToInt ( const QMetaEnum &metaEnum,
int flagValue ) const;
235 int intToFlag ( const QMetaEnum &metaEnum,
int intValue ) const;
236 bool isSubValue (
int value,
int subValue ) const;
237 bool isPowerOf2 (
int value ) const;
247 QMap<QtProperty *,
int> m_classPropertyToIndex;
249 QMap<const QMetaObject *, QMap<
int, QtVariantProperty *> > m_classToIndexToProperty;
252 QMap<
int, QtVariantProperty *> m_indexToDynamicProperty;
254 QMap<QtProperty *,
int> m_dynamicPropertyToIndex;
257 QMap<QtProperty *,
bool> m_propertyToExpanded;
260 QList<QtProperty *> m_topLevelProperties;
263 QMap<QtProperty *, QVariant> saveChangeValue;
266 QtAbstractPropertyBrowser *m_browser;
269 QtVariantPropertyManager *m_manager;
272 QtVariantPropertyManager *m_readOnlyManager;
276 QtVariantProperty * buildQtVariantProperty(QString name, QMetaType::Type type, QVariant value,
bool isReadable,
bool isWritable,
bool isEnumType,
bool isFlagType,
bool isDesignable, QMetaEnum * metaEnum = NULL);