Add support for LineEdit
authorTobias Koenig <tobias.koenig@kdab.com>
Sun, 28 Oct 2012 07:08:07 +0000 (08:08 +0100)
committerTobias Koenig <tobias.koenig@kdab.com>
Sun, 28 Oct 2012 07:08:07 +0000 (08:08 +0100)
declarativeobjects.cpp
declarativeobjects_p.h
declarativewidgetdocument.cpp
gallery.qml
qwidgets.list

index 88ea6e2..a96a0d6 100644 (file)
@@ -944,6 +944,14 @@ DeclarativeLabel::DeclarativeLabel(QObject *parent) : DeclarativeWidgetProxy<QLa
 
 CUSTOM_METAOBJECT(DeclarativeLabel, QLabel)
 
+// DeclarativeLineEdit
+DeclarativeLineEdit::DeclarativeLineEdit(QObject *parent) : DeclarativeWidgetProxy<QLineEdit>(parent)
+{
+  connectAllSignals(m_proxiedObject, this);
+}
+
+CUSTOM_METAOBJECT(DeclarativeLineEdit, QLineEdit)
+
 // DeclarativeMainWindow
 DeclarativeMainWindow::DeclarativeMainWindow(QObject *parent) : DeclarativeWidgetProxy<QMainWindow>(parent)
 {
index f7a3b36..89efa6d 100644 (file)
@@ -15,6 +15,7 @@
 #include <QtGui/QFormLayout>
 #include <QtGui/QHBoxLayout>
 #include <QtGui/QLabel>
+#include <QtGui/QLineEdit>
 #include <QtGui/QMainWindow>
 #include <QtGui/QMenu>
 #include <QtGui/QMenuBar>
@@ -575,6 +576,14 @@ class DeclarativeLabel : public DeclarativeWidgetProxy<QLabel>
     DeclarativeLabel(QObject *parent = 0);
 };
 
+class DeclarativeLineEdit : public DeclarativeWidgetProxy<QLineEdit>
+{
+  DECLARATIVE_OBJECT
+
+  public:
+    DeclarativeLineEdit(QObject *parent = 0);
+};
+
 class DeclarativeMainWindow : public DeclarativeWidgetProxy<QMainWindow>
 {
   DECLARATIVE_OBJECT
index fd2648a..e2ff173 100644 (file)
@@ -57,6 +57,7 @@ DeclarativeWidgetDocument::DeclarativeWidgetDocument(const QUrl &url, QObject *p
   qmlRegisterType<DeclarativeInputDialogAttached>();
   qmlRegisterType<DeclarativeInputDialog>("QtGui", 1, 0, "InputDialog");
   qmlRegisterType<DeclarativeLabel>("QtGui", 1, 0, "Label");
+  qmlRegisterType<DeclarativeLineEdit>("QtGui", 1, 0, "LineEdit");
   qmlRegisterType<DeclarativeMainWindow>("QtGui", 1, 0, "MainWindow");
   qmlRegisterType<DeclarativeMenu>("QtGui", 1, 0, "Menu");
   qmlRegisterType<DeclarativeMenuBar>("QtGui", 1, 0, "MenuBar");
index eed9141..f7b90b6 100644 (file)
@@ -4,5 +4,8 @@ Widget {
   VBoxLayout
   {
     CalendarWidget {}
+    LineEdit {
+      onTextChanged: console.log("Types: " + text)
+    }
   }
 }
index 25d7b88..66d4d35 100644 (file)
@@ -22,7 +22,6 @@ qgraphicswidget.h
 qgroupbox.h
 qheaderview.h
 qlcdnumber.h
-qlineedit.h
 qlistview.h
 qlistwidget.h
 qmdiarea.h