From 2cbc35fabe703d8d0c43a3e0d75c353ac1238c00 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Sun, 28 Oct 2012 09:28:47 +0100 Subject: [PATCH] Add support for SpinBox and DoubleSpinBox --- declarativeobjects.cpp | 16 ++++++++++++++++ declarativeobjects_p.h | 17 +++++++++++++++++ declarativewidgetdocument.cpp | 2 ++ gallery.qml | 4 ++++ qwidgets.list | 1 - 5 files changed, 39 insertions(+), 1 deletions(-) diff --git a/declarativeobjects.cpp b/declarativeobjects.cpp index 7c29ddf..201bf2e 100644 --- a/declarativeobjects.cpp +++ b/declarativeobjects.cpp @@ -734,6 +734,14 @@ DeclarativeDialogButtonBox::DeclarativeDialogButtonBox(QObject *parent) : Declar CUSTOM_METAOBJECT(DeclarativeDialogButtonBox, QDialogButtonBox) +// DeclarativeDoubleSpinBox +DeclarativeDoubleSpinBox::DeclarativeDoubleSpinBox(QObject *parent) : DeclarativeWidgetProxy(parent) +{ + connectAllSignals(m_proxiedObject, this); +} + +CUSTOM_METAOBJECT(DeclarativeDoubleSpinBox, QDoubleSpinBox) + // DeclarativeFileDialog class DeclarativeFileDialogAttached::Private { @@ -1217,6 +1225,14 @@ DeclarativeSlider::DeclarativeSlider(QObject *parent) : DeclarativeWidgetProxy(parent) +{ + connectAllSignals(m_proxiedObject, this); +} + +CUSTOM_METAOBJECT(DeclarativeSpinBox, QSpinBox) + // DeclarativeStatusBar class DeclarativeStatusBarAttached::Private { diff --git a/declarativeobjects_p.h b/declarativeobjects_p.h index 60fd0d7..9b38daa 100644 --- a/declarativeobjects_p.h +++ b/declarativeobjects_p.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -494,6 +495,14 @@ class DeclarativeDialogButtonBox : public DeclarativeWidgetProxy +{ + DECLARATIVE_OBJECT + + public: + DeclarativeDoubleSpinBox(QObject *parent = 0); +}; + class DeclarativeFileDialogAttached : public QObject { Q_OBJECT @@ -736,6 +745,14 @@ class DeclarativeSlider : public DeclarativeWidgetProxy DeclarativeSlider(QObject *parent = 0); }; +class DeclarativeSpinBox : public DeclarativeWidgetProxy +{ + DECLARATIVE_OBJECT + + public: + DeclarativeSpinBox(QObject *parent = 0); +}; + // attached property for DeclarativeStatusBar class DeclarativeStatusBarAttached : public QObject { diff --git a/declarativewidgetdocument.cpp b/declarativewidgetdocument.cpp index 069f18b..2071af4 100644 --- a/declarativewidgetdocument.cpp +++ b/declarativewidgetdocument.cpp @@ -54,6 +54,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p qmlRegisterType("QtGui", 1, 0, "DateTimeEdit"); qmlRegisterType("QtGui", 1, 0, "Dialog"); qmlRegisterType("QtGui", 1, 0, "DialogButtonBox"); + qmlRegisterType("QtGui", 1, 0, "DoubleSpinBox"); qmlRegisterType(); qmlRegisterType("QtGui", 1, 0, "FileDialog"); qmlRegisterType("QtGui", 1, 0, "FontDialog"); @@ -72,6 +73,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p qmlRegisterType("QtGui", 1, 0, "PushButton"); qmlRegisterType("QtGui", 1, 0, "RadioButton"); qmlRegisterType("QtGui", 1, 0, "Slider"); + qmlRegisterType("QtGui", 1, 0, "SpinBox"); qmlRegisterType(); qmlRegisterType("QtGui", 1, 0, "StatusBar"); qmlRegisterType(); diff --git a/gallery.qml b/gallery.qml index c8cf24f..3e6c22e 100644 --- a/gallery.qml +++ b/gallery.qml @@ -74,6 +74,10 @@ TabWidget { plainText: qsTr("PlainTextEdit") } + SpinBox {} + + DoubleSpinBox {} + TimeEdit {} DateEdit {} diff --git a/qwidgets.list b/qwidgets.list index 890637e..3e19378 100644 --- a/qwidgets.list +++ b/qwidgets.list @@ -26,7 +26,6 @@ qprintpreviewwidget.h qprogressbar.h qscrollarea.h qscrollbar.h -qspinbox.h qsplashscreen.h qsplitter.h qstackedlayout.h -- 1.7.2.5