From: Tobias Koenig Date: Sun, 28 Oct 2012 07:08:07 +0000 (+0100) Subject: Add support for LineEdit X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9b45e1f5db0a1911625eb014d161a8646280e4c5;p=konrad%2FDeclarativeWidgets.git Add support for LineEdit --- diff --git a/declarativeobjects.cpp b/declarativeobjects.cpp index 88ea6e2..a96a0d6 100644 --- a/declarativeobjects.cpp +++ b/declarativeobjects.cpp @@ -944,6 +944,14 @@ DeclarativeLabel::DeclarativeLabel(QObject *parent) : DeclarativeWidgetProxy(parent) +{ + connectAllSignals(m_proxiedObject, this); +} + +CUSTOM_METAOBJECT(DeclarativeLineEdit, QLineEdit) + // DeclarativeMainWindow DeclarativeMainWindow::DeclarativeMainWindow(QObject *parent) : DeclarativeWidgetProxy(parent) { diff --git a/declarativeobjects_p.h b/declarativeobjects_p.h index f7a3b36..89efa6d 100644 --- a/declarativeobjects_p.h +++ b/declarativeobjects_p.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -575,6 +576,14 @@ class DeclarativeLabel : public DeclarativeWidgetProxy DeclarativeLabel(QObject *parent = 0); }; +class DeclarativeLineEdit : public DeclarativeWidgetProxy +{ + DECLARATIVE_OBJECT + + public: + DeclarativeLineEdit(QObject *parent = 0); +}; + class DeclarativeMainWindow : public DeclarativeWidgetProxy { DECLARATIVE_OBJECT diff --git a/declarativewidgetdocument.cpp b/declarativewidgetdocument.cpp index fd2648a..e2ff173 100644 --- a/declarativewidgetdocument.cpp +++ b/declarativewidgetdocument.cpp @@ -57,6 +57,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p qmlRegisterType(); qmlRegisterType("QtGui", 1, 0, "InputDialog"); qmlRegisterType("QtGui", 1, 0, "Label"); + qmlRegisterType("QtGui", 1, 0, "LineEdit"); qmlRegisterType("QtGui", 1, 0, "MainWindow"); qmlRegisterType("QtGui", 1, 0, "Menu"); qmlRegisterType("QtGui", 1, 0, "MenuBar"); diff --git a/gallery.qml b/gallery.qml index eed9141..f7b90b6 100644 --- a/gallery.qml +++ b/gallery.qml @@ -4,5 +4,8 @@ Widget { VBoxLayout { CalendarWidget {} + LineEdit { + onTextChanged: console.log("Types: " + text) + } } } diff --git a/qwidgets.list b/qwidgets.list index 25d7b88..66d4d35 100644 --- a/qwidgets.list +++ b/qwidgets.list @@ -22,7 +22,6 @@ qgraphicswidget.h qgroupbox.h qheaderview.h qlcdnumber.h -qlineedit.h qlistview.h qlistwidget.h qmdiarea.h