aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/designer/qquickdesignersupportmetainfo.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-09-28 16:52:53 +0200
committerThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-10-05 07:49:38 +0000
commit54765de17916948ef56a3fd1111e8c765c07155a (patch)
tree333973d100009a70b79daf1a753720e42a209748 /src/quick/designer/qquickdesignersupportmetainfo.cpp
parentc6d66f2e88b42079df9c21c10cf8922871932a32 (diff)
Adding QQuickDesignerSupportMetaInfo::registerMockupObject()
This allows Qt Quick Designer to register a component with a custom parser that can serve as a mockup for known C++ components registered in e.g. main.cpp. In many cases those components are the interface to the C++ backend. While the C++ components itself are not relevant for the gui designer, the user has to be able to instantiate gui components that use such C++ components. Therefore we create mockup components with a custom parser, so all property assignments are accepted. Change-Id: I9c25752b0a5f11c2613346ffbbfd10e3b6eb3a6f Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/quick/designer/qquickdesignersupportmetainfo.cpp')
-rw-r--r--src/quick/designer/qquickdesignersupportmetainfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/designer/qquickdesignersupportmetainfo.cpp b/src/quick/designer/qquickdesignersupportmetainfo.cpp
index 27c9814ef1..332ae26bd4 100644
--- a/src/quick/designer/qquickdesignersupportmetainfo.cpp
+++ b/src/quick/designer/qquickdesignersupportmetainfo.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include "qquickdesignercustomparserobject_p.h"
#include "qquickdesignersupportmetainfo_p.h"
#include "qqmldesignermetaobject_p.h"
@@ -70,5 +71,10 @@ void QQuickDesignerSupportMetaInfo::registerNotifyPropertyChangeCallBack(void (*
QQmlDesignerMetaObject::registerNotifyPropertyChangeCallBack(callback);
}
+void QQuickDesignerSupportMetaInfo::registerMockupObject(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+{
+ qmlRegisterCustomType<QQuickDesignerCustomParserObject>(uri, versionMajor, versionMinor, qmlName, new QQuickDesignerCustomParser);
+}
+
QT_END_NAMESPACE