OSDN Git Service

QmlDesigner: Use Meego
authorMarco Bubke <marco.bubke@nokia.com>
Wed, 13 Oct 2010 14:18:49 +0000 (16:18 +0200)
committerMarco Bubke <marco.bubke@nokia.com>
Wed, 24 Nov 2010 14:52:22 +0000 (15:52 +0100)
src/plugins/qmldesigner/qtquickplugin/qtquickplugin.cpp
src/plugins/qmldesigner/qtquickplugin/qtquickplugin.pri

index 1480471..0d02d4b 100644 (file)
 #include <QtCore/QtPlugin>
 #include <private/qdeclarativerectangle_p.h>
 #include <private/qdeclarativescalegrid_p_p.h>
+#include <MComponentData>
 
 namespace QmlDesigner {
 
 
 QtQuickPlugin::QtQuickPlugin()
 {
-    qmlRegisterType<QDeclarativePen>("QtQuick", 1, 0, "Pen");
-    qmlRegisterType<QDeclarativeScaleGrid>("QtQuick", 1, 0, "ScaleGrid");
+    qApp->setProperty("NoMStyle", true);
+    if(!MComponentData::instance()) {
+        // This is a workaround because we can't use a default
+        // constructor for MComponentData
+        int argc = 1;
+        char *argv0 = "meegotouch";
+        (void) new MComponentData(argc, &argv0);
+    }
+
+    qmlRegisterType<QDeclarativePen>("Qt", 4, 7, "Pen");
+    qmlRegisterType<QDeclarativeScaleGrid>("Qt", 4, 7, "ScaleGrid");
 }
 
 QString QtQuickPlugin::pluginName()
index 5870c37..1436a03 100644 (file)
@@ -1,6 +1,6 @@
 TARGET = qtquickplugin
 TEMPLATE = lib
-CONFIG += plugin
+CONFIG += plugin meegotouch
 
 QT += script \
       declarative