summaryrefslogtreecommitdiff
path: root/src/private/plugin.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-04-11 19:49:39 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-15 15:09:57 +0200
commit5857ea03a77e44879191dd922b7c38c49616517b (patch)
treebff6d278b83e1ee1699ae36a89dfea463d08caa9 /src/private/plugin.cpp
parent2b309cf52dfff7307a055b2662e7ce1a53d44bdb (diff)
downloadqtquickcontrols-5857ea03a77e44879191dd922b7c38c49616517b.tar.gz
Remove hard dependency on widgets
Change-Id: I1fabb4efcc931f12f0a65ac5c66e6e085108269b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/private/plugin.cpp')
-rw-r--r--src/private/plugin.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/private/plugin.cpp b/src/private/plugin.cpp
index 17b2b09b..34486de1 100644
--- a/src/private/plugin.cpp
+++ b/src/private/plugin.cpp
@@ -43,6 +43,11 @@
#include "qquickwheelarea_p.h"
#include "qquickstyleitem_p.h"
#include "qquicktooltip_p.h"
+#include "qquickcontrolsettings_p.h"
+
+#ifndef QT_NO_WIDGETS
+#include "qquickstyleitem_p.h"
+#endif
#include <qqml.h>
#include <qqmlextensionplugin.h>
@@ -56,6 +61,13 @@ static QObject *registerTooltipModule(QQmlEngine *engine, QJSEngine *jsEngine)
return new QQuickTooltip();
}
+static QObject *registerSettingsModule(QQmlEngine *engine, QJSEngine *jsEngine)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(jsEngine);
+ return new QQuickControlSettings();
+}
+
class QtQuickControlsPrivatePlugin : public QQmlExtensionPlugin
{
Q_OBJECT
@@ -69,8 +81,11 @@ void QtQuickControlsPrivatePlugin::registerTypes(const char *uri)
{
qmlRegisterType<QQuickRangeModel>(uri, 1, 0, "RangeModel");
qmlRegisterType<QQuickWheelArea>(uri, 1, 0, "WheelArea");
- qmlRegisterType<QQuickStyleItem>(uri, 1, 0, "StyleItem");
qmlRegisterSingletonType<QQuickTooltip>(uri, 1, 0, "Tooltip", registerTooltipModule);
+ qmlRegisterSingletonType<QQuickControlSettings>(uri, 1, 0, "Settings", registerSettingsModule);
+#ifndef QT_NO_WIDGETS
+ qmlRegisterType<QQuickStyleItem>(uri, 1, 0, "StyleItem");
+#endif
}
QT_END_NAMESPACE