Add support for Dial
authorTobias Koenig <tobias.koenig@kdab.com>
Sun, 28 Oct 2012 08:33:16 +0000 (09:33 +0100)
committerTobias Koenig <tobias.koenig@kdab.com>
Sun, 28 Oct 2012 08:33:16 +0000 (09:33 +0100)
declarativeobjects.cpp
declarativeobjects_p.h
declarativewidgetdocument.cpp
gallery.qml

index 201bf2e..12685d3 100644 (file)
@@ -718,6 +718,14 @@ DeclarativeDateTimeEdit::DeclarativeDateTimeEdit(QObject *parent) : DeclarativeW
 
 CUSTOM_METAOBJECT(DeclarativeDateTimeEdit, QDateTimeEdit)
 
+// DeclarativeDial
+DeclarativeDial::DeclarativeDial(QObject *parent) : DeclarativeWidgetProxy<QDial>(parent)
+{
+  connectAllSignals(m_proxiedObject, this);
+}
+
+CUSTOM_METAOBJECT(DeclarativeDial, QDial)
+
 // DeclarativeDialog
 DeclarativeDialog::DeclarativeDialog(QObject *parent) : DeclarativeWidgetProxy<QDialog>(parent)
 {
index 9b38daa..d3bc6f6 100644 (file)
@@ -11,6 +11,7 @@
 #include <QtGui/QColorDialog>
 #include <QtGui/QCommandLinkButton>
 #include <QtGui/QDateTimeEdit>
+#include <QtGui/QDial>
 #include <QtGui/QDialog>
 #include <QtGui/QDialogButtonBox>
 #include <QtGui/QFontDialog>
@@ -479,6 +480,14 @@ class DeclarativeDateTimeEdit : public DeclarativeWidgetProxy<QDateTimeEdit>
     DeclarativeDateTimeEdit(QObject *parent = 0);
 };
 
+class DeclarativeDial : public DeclarativeWidgetProxy<QDial>
+{
+  DECLARATIVE_OBJECT
+
+  public:
+    DeclarativeDial(QObject *parent = 0);
+};
+
 class DeclarativeDialog : public DeclarativeWidgetProxy<QDialog>
 {
   DECLARATIVE_OBJECT
index 2071af4..4bce215 100644 (file)
@@ -52,6 +52,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p
   qmlRegisterType<DeclarativeCommandLinkButton>("QtGui", 1, 0, "CommandLinkButton");
   qmlRegisterType<DeclarativeDateEdit>("QtGui", 1, 0, "DateEdit");
   qmlRegisterType<DeclarativeDateTimeEdit>("QtGui", 1, 0, "DateTimeEdit");
+  qmlRegisterType<DeclarativeDial>("QtGui", 1, 0, "Dial");
   qmlRegisterType<DeclarativeDialog>("QtGui", 1, 0, "Dialog");
   qmlRegisterType<DeclarativeDialogButtonBox>("QtGui", 1, 0, "DialogButtonBox");
   qmlRegisterType<DeclarativeDoubleSpinBox>("QtGui", 1, 0, "DoubleSpinBox");
index 3e6c22e..019018a 100644 (file)
@@ -84,7 +84,14 @@ TabWidget {
 
       DateTimeEdit {}
 
-      Slider {}
+      Dial {}
+
+      Slider {
+        minimum: 0
+        maximum: 100
+        value: 50
+        orientation: Qt.Horizontal
+      }
     }
   }