Add wrapper for QCalendarWidget
authorTobias Koenig <tobias.koenig@kdab.com>
Wed, 17 Oct 2012 12:10:08 +0000 (14:10 +0200)
committerTobias Koenig <tobias.koenig@kdab.com>
Wed, 17 Oct 2012 12:10:08 +0000 (14:10 +0200)
declarativeobjects.cpp
declarativeobjects_p.h
declarativewidgetdocument.cpp
gallery.qml [new file with mode: 0644]
qwidgets.list

index 7c04415..bcaf145 100644 (file)
@@ -158,6 +158,14 @@ CUSTOM_METAOBJECT(DeclarativeVBoxLayout, QVBoxLayout)
 
 //// Widgets ////
 
+// DeclarativeCalendarWidget
+DeclarativeCalendarWidget::DeclarativeCalendarWidget(QObject *parent) : DeclarativeWidgetProxy<QCalendarWidget>(parent)
+{
+  connectAllSignals(m_proxiedObject, this);
+}
+
+CUSTOM_METAOBJECT(DeclarativeCalendarWidget, QCalendarWidget)
+
 // DeclarativeCheckBox
 DeclarativeCheckBox::DeclarativeCheckBox(QObject *parent) : DeclarativeWidgetProxy<QCheckBox>(parent)
 {
index f8bcf44..01d1f03 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <QtCore/QObject>
 #include <QtCore/QPointer>
+#include <QtGui/QCalendarWidget>
 #include <QtGui/QCheckBox>
 #include <QtGui/QHBoxLayout>
 #include <QtGui/QLabel>
@@ -185,6 +186,14 @@ class DeclarativeVBoxLayout : public DeclarativeBoxLayout<QVBoxLayout>
 };
 
 //// Widgets ////
+class DeclarativeCalendarWidget : public DeclarativeWidgetProxy<QCalendarWidget>
+{
+  DECLARATIVE_OBJECT
+
+  public:
+    DeclarativeCalendarWidget(QObject *parent = 0);
+};
+
 class DeclarativeCheckBox : public DeclarativeWidgetProxy<QCheckBox>
 {
   DECLARATIVE_OBJECT
index 1377bf8..b9abae9 100644 (file)
@@ -29,15 +29,19 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p
   : QObject(parent)
   , d(new Private(this, url))
 {
-  qmlRegisterType<DeclarativeWidget>("QtGui", 1, 0, "Widget");
-  qmlRegisterType<DeclarativeLabel>("QtGui", 1, 0, "Label");
+  // layouts
   qmlRegisterType<DeclarativeHBoxLayout>("QtGui", 1, 0, "HBoxLayout");
   qmlRegisterType<DeclarativeVBoxLayout>("QtGui", 1, 0, "VBoxLayout");
-  qmlRegisterType<TabWidgetTabHeader>();
-  qmlRegisterType<DeclarativeTabWidget>("QtGui", 1, 0, "TabWidget");
-  qmlRegisterType<DeclarativePushButton>("QtGui", 1, 0, "PushButton");
+
+  // widgets
+  qmlRegisterType<DeclarativeCalendarWidget>("QtGui", 1, 0, "CalendarWidget");
   qmlRegisterType<DeclarativeCheckBox>("QtGui", 1, 0, "CheckBox");
+  qmlRegisterType<DeclarativeLabel>("QtGui", 1, 0, "Label");
+  qmlRegisterType<DeclarativePushButton>("QtGui", 1, 0, "PushButton");
   qmlRegisterType<DeclarativeSlider>("QtGui", 1, 0, "Slider");
+  qmlRegisterType<TabWidgetTabHeader>();
+  qmlRegisterType<DeclarativeTabWidget>("QtGui", 1, 0, "TabWidget");
+  qmlRegisterType<DeclarativeWidget>("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 (file)
index 0000000..eed9141
--- /dev/null
@@ -0,0 +1,8 @@
+import QtGui 1.0
+
+Widget {
+  VBoxLayout
+  {
+    CalendarWidget {}
+  }
+}
index 6285e3f..05c6a99 100644 (file)
@@ -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