Add support for SpinBox and DoubleSpinBox
authorTobias Koenig <tobias.koenig@kdab.com>
Sun, 28 Oct 2012 08:28:47 +0000 (09:28 +0100)
committerTobias Koenig <tobias.koenig@kdab.com>
Sun, 28 Oct 2012 08:28:47 +0000 (09:28 +0100)
declarativeobjects.cpp
declarativeobjects_p.h
declarativewidgetdocument.cpp
gallery.qml
qwidgets.list

index 7c29ddf..201bf2e 100644 (file)
@@ -734,6 +734,14 @@ DeclarativeDialogButtonBox::DeclarativeDialogButtonBox(QObject *parent) : Declar
 
 CUSTOM_METAOBJECT(DeclarativeDialogButtonBox, QDialogButtonBox)
 
+// DeclarativeDoubleSpinBox
+DeclarativeDoubleSpinBox::DeclarativeDoubleSpinBox(QObject *parent) : DeclarativeWidgetProxy<QDoubleSpinBox>(parent)
+{
+  connectAllSignals(m_proxiedObject, this);
+}
+
+CUSTOM_METAOBJECT(DeclarativeDoubleSpinBox, QDoubleSpinBox)
+
 // DeclarativeFileDialog
 class DeclarativeFileDialogAttached::Private
 {
@@ -1217,6 +1225,14 @@ DeclarativeSlider::DeclarativeSlider(QObject *parent) : DeclarativeWidgetProxy<Q
 
 CUSTOM_METAOBJECT(DeclarativeSlider, QSlider)
 
+// DeclarativeSpinBox
+DeclarativeSpinBox::DeclarativeSpinBox(QObject *parent) : DeclarativeWidgetProxy<QSpinBox>(parent)
+{
+  connectAllSignals(m_proxiedObject, this);
+}
+
+CUSTOM_METAOBJECT(DeclarativeSpinBox, QSpinBox)
+
 // DeclarativeStatusBar
 class DeclarativeStatusBarAttached::Private
 {
index 60fd0d7..9b38daa 100644 (file)
@@ -27,6 +27,7 @@
 #include <QtGui/QPushButton>
 #include <QtGui/QRadioButton>
 #include <QtGui/QSlider>
+#include <QtGui/QSpinBox>
 #include <QtGui/QStatusBar>
 #include <QtGui/QTabWidget>
 #include <QtGui/QTextBrowser>
@@ -494,6 +495,14 @@ class DeclarativeDialogButtonBox : public DeclarativeWidgetProxy<QDialogButtonBo
     DeclarativeDialogButtonBox(QObject *parent = 0);
 };
 
+class DeclarativeDoubleSpinBox : public DeclarativeWidgetProxy<QDoubleSpinBox>
+{
+  DECLARATIVE_OBJECT
+
+  public:
+    DeclarativeDoubleSpinBox(QObject *parent = 0);
+};
+
 class DeclarativeFileDialogAttached : public QObject
 {
   Q_OBJECT
@@ -736,6 +745,14 @@ class DeclarativeSlider : public DeclarativeWidgetProxy<QSlider>
     DeclarativeSlider(QObject *parent = 0);
 };
 
+class DeclarativeSpinBox : public DeclarativeWidgetProxy<QSpinBox>
+{
+  DECLARATIVE_OBJECT
+
+  public:
+    DeclarativeSpinBox(QObject *parent = 0);
+};
+
 // attached property for DeclarativeStatusBar
 class DeclarativeStatusBarAttached : public QObject
 {
index 069f18b..2071af4 100644 (file)
@@ -54,6 +54,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p
   qmlRegisterType<DeclarativeDateTimeEdit>("QtGui", 1, 0, "DateTimeEdit");
   qmlRegisterType<DeclarativeDialog>("QtGui", 1, 0, "Dialog");
   qmlRegisterType<DeclarativeDialogButtonBox>("QtGui", 1, 0, "DialogButtonBox");
+  qmlRegisterType<DeclarativeDoubleSpinBox>("QtGui", 1, 0, "DoubleSpinBox");
   qmlRegisterType<DeclarativeFileDialogAttached>();
   qmlRegisterType<DeclarativeFileDialog>("QtGui", 1, 0, "FileDialog");
   qmlRegisterType<DeclarativeFontDialog>("QtGui", 1, 0, "FontDialog");
@@ -72,6 +73,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p
   qmlRegisterType<DeclarativePushButton>("QtGui", 1, 0, "PushButton");
   qmlRegisterType<DeclarativeRadioButton>("QtGui", 1, 0, "RadioButton");
   qmlRegisterType<DeclarativeSlider>("QtGui", 1, 0, "Slider");
+  qmlRegisterType<DeclarativeSpinBox>("QtGui", 1, 0, "SpinBox");
   qmlRegisterType<DeclarativeStatusBarAttached>();
   qmlRegisterType<DeclarativeStatusBar>("QtGui", 1, 0, "StatusBar");
   qmlRegisterType<DeclarativeTabWidgetAttached>();
index c8cf24f..3e6c22e 100644 (file)
@@ -74,6 +74,10 @@ TabWidget {
         plainText: qsTr("PlainTextEdit")
       }
 
+      SpinBox {}
+
+      DoubleSpinBox {}
+
       TimeEdit {}
 
       DateEdit {}
index 890637e..3e19378 100644 (file)
@@ -26,7 +26,6 @@ qprintpreviewwidget.h
 qprogressbar.h
 qscrollarea.h
 qscrollbar.h
-qspinbox.h
 qsplashscreen.h
 qsplitter.h
 qstackedlayout.h