From: Tobias Koenig Date: Wed, 17 Oct 2012 12:10:08 +0000 (+0200) Subject: Add wrapper for QCalendarWidget X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=37a76bca37660f16b116d25238a52698dbba8858;p=web%2Fkonrad%2FDeclarativeWidgets.git Add wrapper for QCalendarWidget --- diff --git a/declarativeobjects.cpp b/declarativeobjects.cpp index 7c04415..bcaf145 100644 --- a/declarativeobjects.cpp +++ b/declarativeobjects.cpp @@ -158,6 +158,14 @@ CUSTOM_METAOBJECT(DeclarativeVBoxLayout, QVBoxLayout) //// Widgets //// +// DeclarativeCalendarWidget +DeclarativeCalendarWidget::DeclarativeCalendarWidget(QObject *parent) : DeclarativeWidgetProxy(parent) +{ + connectAllSignals(m_proxiedObject, this); +} + +CUSTOM_METAOBJECT(DeclarativeCalendarWidget, QCalendarWidget) + // DeclarativeCheckBox DeclarativeCheckBox::DeclarativeCheckBox(QObject *parent) : DeclarativeWidgetProxy(parent) { diff --git a/declarativeobjects_p.h b/declarativeobjects_p.h index f8bcf44..01d1f03 100644 --- a/declarativeobjects_p.h +++ b/declarativeobjects_p.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -185,6 +186,14 @@ class DeclarativeVBoxLayout : public DeclarativeBoxLayout }; //// Widgets //// +class DeclarativeCalendarWidget : public DeclarativeWidgetProxy +{ + DECLARATIVE_OBJECT + + public: + DeclarativeCalendarWidget(QObject *parent = 0); +}; + class DeclarativeCheckBox : public DeclarativeWidgetProxy { DECLARATIVE_OBJECT diff --git a/declarativewidgetdocument.cpp b/declarativewidgetdocument.cpp index 1377bf8..b9abae9 100644 --- a/declarativewidgetdocument.cpp +++ b/declarativewidgetdocument.cpp @@ -29,15 +29,19 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p : QObject(parent) , d(new Private(this, url)) { - qmlRegisterType("QtGui", 1, 0, "Widget"); - qmlRegisterType("QtGui", 1, 0, "Label"); + // layouts qmlRegisterType("QtGui", 1, 0, "HBoxLayout"); qmlRegisterType("QtGui", 1, 0, "VBoxLayout"); - qmlRegisterType(); - qmlRegisterType("QtGui", 1, 0, "TabWidget"); - qmlRegisterType("QtGui", 1, 0, "PushButton"); + + // widgets + qmlRegisterType("QtGui", 1, 0, "CalendarWidget"); qmlRegisterType("QtGui", 1, 0, "CheckBox"); + qmlRegisterType("QtGui", 1, 0, "Label"); + qmlRegisterType("QtGui", 1, 0, "PushButton"); qmlRegisterType("QtGui", 1, 0, "Slider"); + qmlRegisterType(); + qmlRegisterType("QtGui", 1, 0, "TabWidget"); + qmlRegisterType("QtGui", 1, 0, "Widget"); d->m_component->loadUrl(d->m_url); if (d->m_component->isError()) { diff --git a/gallery.qml b/gallery.qml new file mode 100644 index 0000000..eed9141 --- /dev/null +++ b/gallery.qml @@ -0,0 +1,8 @@ +import QtGui 1.0 + +Widget { + VBoxLayout + { + CalendarWidget {} + } +} diff --git a/qwidgets.list b/qwidgets.list index 6285e3f..05c6a99 100644 --- a/qwidgets.list +++ b/qwidgets.list @@ -1,18 +1,28 @@ +// objects qbuttongroup.h -qcalendarwidget.h + +// dialogs qcolordialog.h +qdialog.h +qfiledialog.h +qfontdialog.h +qinputdialog.h +qpagesetupdialog.h +qprintdialog.h +qprintpreviewdialog.h +qprogressdialog.h + +// widgets +qcalendarwidget.h qcolumnview.h qcombobox.h qcommandlinkbutton.h qdatetimeedit.h qdial.h qdialogbuttonbox.h -qdialog.h qdockwidget.h -qfiledialog.h qfocusframe.h qfontcombobox.h -qfontdialog.h qformlayout.h qframe.h qgraphicsview.h @@ -20,7 +30,6 @@ qgraphicswidget.h qgridlayout.h qgroupbox.h qheaderview.h -qinputdialog.h qlayout.h qlayoutitem.h qlcdnumber.h @@ -31,16 +40,11 @@ qmainwindow.h qmdiarea.h qmdisubwindow.h qmenubar.h -qmenudata.h qmenu.h qmessagebox.h -qpagesetupdialog.h qplaintextedit.h -qprintdialog.h -qprintpreviewdialog.h qprintpreviewwidget.h qprogressbar.h -qprogressdialog.h qradiobutton.h qscrollarea.h qscrollbar.h