forked from qt-creator/qt-creator
JsonWizard: Allow for custom widgets in the Field page
... instead of having a hard-coded list of widgets you can use. Change-Id: Iedf7016412ce9d619fea5cdffe6dbf86beda92b0 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
This commit is contained in:
@@ -115,6 +115,9 @@ public:
|
||||
JsonFieldPage(Utils::MacroExpander *expander, QWidget *parent = 0);
|
||||
~JsonFieldPage();
|
||||
|
||||
typedef std::function<Field *()> FieldFactory;
|
||||
static void registerFieldFactory(const QString &id, const FieldFactory &ff);
|
||||
|
||||
bool setup(const QVariant &data);
|
||||
|
||||
bool isComplete() const;
|
||||
@@ -129,6 +132,10 @@ public:
|
||||
Utils::MacroExpander *expander();
|
||||
|
||||
private:
|
||||
static QHash<QString, FieldFactory> m_factories;
|
||||
|
||||
static Field *createFieldData(const QString &type);
|
||||
|
||||
QFormLayout *m_formLayout;
|
||||
QLabel *m_errorLabel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user