12345678910111213141516171819202122232425262728293031323334353637383940414243 |
-
- #ifndef VARIANTFACTORY_H
- #define VARIANTFACTORY_H
- #include "qtvariantproperty.h"
- class FunctionEdit;
- class VariantFactory : public QtVariantEditorFactory
- {
- Q_OBJECT
- public:
- VariantFactory(QObject *parent = Q_NULLPTR) : QtVariantEditorFactory(parent) { }
- virtual ~VariantFactory();
- protected:
- // 关联属性管理器
- virtual void connectPropertyManager(QtVariantPropertyManager *manager);
- // 通过实现 createEditor 虚函数来为每种不同的类型增加对话框
- virtual QWidget *createEditor(QtVariantPropertyManager *manager,
- QtProperty *property,
- QWidget *parent);
- virtual void disconnectPropertyManager(QtVariantPropertyManager *manager);
- private slots:
- void slotPropertyChanged(QtProperty *property, const QVariant &value);
- void slotPropertyAttributeChanged(QtProperty *property,
- const QString &attribute,
- const QVariant &value);
- void slotSetValue(const QString &value);
- void slotEditorDestroyed(QObject *object);
- private:
- QMap<QtProperty *, QList<QWidget *> > theCreatedEditors;
- QMap<QWidget *, QtProperty *> theEditorToProperty;
- };
- #endif
|