From ae97355077f8a9b8c8aa9ed2a9cc210c5c68896b Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Sun, 28 Oct 2012 09:01:17 +0100 Subject: [PATCH] Add support for DateEdit/DateTimeEdit/TimeEdit --- declarativeobjects.cpp | 24 ++++++++++++++++++++++++ declarativeobjects_p.h | 25 +++++++++++++++++++++++++ declarativewidgetdocument.cpp | 3 +++ qwidgets.list | 1 - 4 files changed, 52 insertions(+), 1 deletions(-) diff --git a/declarativeobjects.cpp b/declarativeobjects.cpp index 551a4e8..fb36a9a 100644 --- a/declarativeobjects.cpp +++ b/declarativeobjects.cpp @@ -694,6 +694,22 @@ DeclarativeColorDialogAttached *DeclarativeColorDialog::qmlAttachedProperties(QO CUSTOM_METAOBJECT(DeclarativeColorDialog, QColorDialog) +// DeclarativeDateEdit +DeclarativeDateEdit::DeclarativeDateEdit(QObject *parent) : DeclarativeWidgetProxy(parent) +{ + connectAllSignals(m_proxiedObject, this); +} + +CUSTOM_METAOBJECT(DeclarativeDateEdit, QDateEdit) + +// DeclarativeDateTimeEdit +DeclarativeDateTimeEdit::DeclarativeDateTimeEdit(QObject *parent) : DeclarativeWidgetProxy(parent) +{ + connectAllSignals(m_proxiedObject, this); +} + +CUSTOM_METAOBJECT(DeclarativeDateTimeEdit, QDateTimeEdit) + // DeclarativeDialog DeclarativeDialog::DeclarativeDialog(QObject *parent) : DeclarativeWidgetProxy(parent) { @@ -1350,6 +1366,14 @@ DeclarativeTextEdit::DeclarativeTextEdit(QObject *parent) : DeclarativeWidgetPro CUSTOM_METAOBJECT(DeclarativeTextEdit, TextEdit) +// DeclarativeTimeEdit +DeclarativeTimeEdit::DeclarativeTimeEdit(QObject *parent) : DeclarativeWidgetProxy(parent) +{ + connectAllSignals(m_proxiedObject, this); +} + +CUSTOM_METAOBJECT(DeclarativeTimeEdit, QTimeEdit) + // DeclarativeToolBar DeclarativeToolBar::DeclarativeToolBar(QObject *parent) : DeclarativeWidgetProxy(parent) { diff --git a/declarativeobjects_p.h b/declarativeobjects_p.h index c1b228c..b79e93e 100644 --- a/declarativeobjects_p.h +++ b/declarativeobjects_p.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -450,6 +451,22 @@ class DeclarativeColorDialog : public DeclarativeWidgetProxy QML_DECLARE_TYPEINFO(DeclarativeColorDialog, QML_HAS_ATTACHED_PROPERTIES) +class DeclarativeDateEdit : public DeclarativeWidgetProxy +{ + DECLARATIVE_OBJECT + + public: + DeclarativeDateEdit(QObject *parent = 0); +}; + +class DeclarativeDateTimeEdit : public DeclarativeWidgetProxy +{ + DECLARATIVE_OBJECT + + public: + DeclarativeDateTimeEdit(QObject *parent = 0); +}; + class DeclarativeDialog : public DeclarativeWidgetProxy { DECLARATIVE_OBJECT @@ -797,6 +814,14 @@ class DeclarativeTextEdit : public DeclarativeWidgetProxy DeclarativeTextEdit(QObject *parent = 0); }; +class DeclarativeTimeEdit : public DeclarativeWidgetProxy +{ + DECLARATIVE_OBJECT + + public: + DeclarativeTimeEdit(QObject *parent = 0); +}; + class DeclarativeToolBar : public DeclarativeWidgetProxy { DECLARATIVE_OBJECT diff --git a/declarativewidgetdocument.cpp b/declarativewidgetdocument.cpp index dbbaffc..e15242e 100644 --- a/declarativewidgetdocument.cpp +++ b/declarativewidgetdocument.cpp @@ -49,6 +49,8 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p qmlRegisterType("QtGui", 1, 0, "CheckBox"); qmlRegisterType(); qmlRegisterType("QtGui", 1, 0, "ColorDialog"); + qmlRegisterType("QtGui", 1, 0, "DateEdit"); + qmlRegisterType("QtGui", 1, 0, "DateTimeEdit"); qmlRegisterType("QtGui", 1, 0, "Dialog"); qmlRegisterType("QtGui", 1, 0, "DialogButtonBox"); qmlRegisterType(); @@ -74,6 +76,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p qmlRegisterType("QtGui", 1, 0, "TabWidget"); qmlRegisterType("QtGui", 1, 0, "TextBrowser"); qmlRegisterType("QtGui", 1, 0, "TextEdit"); + qmlRegisterType("QtGui", 1, 0, "TimeEdit"); qmlRegisterType("QtGui", 1, 0, "ToolBar"); qmlRegisterType("QtGui", 1, 0, "WebView"); qmlRegisterType("QtGui", 1, 0, "Widget"); diff --git a/qwidgets.list b/qwidgets.list index 3dba9bb..c15dc06 100644 --- a/qwidgets.list +++ b/qwidgets.list @@ -11,7 +11,6 @@ qprogressdialog.h qcolumnview.h qcombobox.h qcommandlinkbutton.h -qdatetimeedit.h qdial.h qdockwidget.h qfocusframe.h -- 1.7.2.5