diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-01 06:39:56 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-01 06:39:56 (GMT) |
commit | 43ddb1e98ef24daf8210ffacb5143a44ef6df1c9 (patch) | |
tree | a8f7bd5731853741a7c444b06c1125005f2f609f | |
parent | dac26313fcfc3862a7f2aeaa58bb2afe0d494ec9 (diff) | |
parent | 7f6cec754823ebbdc173fc9265e1049ae00649c7 (diff) | |
download | Qt-43ddb1e98ef24daf8210ffacb5143a44ef6df1c9.zip Qt-43ddb1e98ef24daf8210ffacb5143a44ef6df1c9.tar.gz Qt-43ddb1e98ef24daf8210ffacb5143a44ef6df1c9.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | doc/src/declarative/binding.qdoc | 8 | ||||
-rw-r--r-- | doc/src/declarative/elements.qdoc | 47 | ||||
-rw-r--r-- | doc/src/declarative/qmlfordesign.qdoc (renamed from doc/src/declarative/index.qdoc) | 15 | ||||
-rw-r--r-- | doc/src/index.qdoc | 2 | ||||
-rw-r--r-- | examples/declarative/contacts/main.cpp | 6 | ||||
-rw-r--r-- | examples/declarative/minehunt/main.cpp | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxblurfilter.cpp | 6 | ||||
-rw-r--r-- | src/declarative/test/qfxtestview.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qfxview.cpp | 41 | ||||
-rw-r--r-- | src/declarative/util/qfxview.h | 16 |
10 files changed, 79 insertions, 70 deletions
diff --git a/doc/src/declarative/binding.qdoc b/doc/src/declarative/binding.qdoc index b711a08..1d4f9a1 100644 --- a/doc/src/declarative/binding.qdoc +++ b/doc/src/declarative/binding.qdoc @@ -87,16 +87,16 @@ void setBrightness(int b) Next, make an instance of this class visible to the Qml bind engine: \code QFxView *view = new QFxView; -view->setXml("MyUI.qml"); +view->setUrl("MyUI.qml"); MyScreen *screen = new MyScreen; -QmlBindContext *ctxt = view->bindContext(); -ctxt->setProperty("screen", screen); +QmlBindContext *ctxt = view->rootContext(); +ctxt->setContextProperty("screen", screen); view->execute(); \endcode -\note Bindings must be made after setXml() but before execute(). +\note Bindings must be made after setUrl() but before execute(). Finally, in Qml you can make the appropriate bindings, so in \c "MyUI.qml": diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 3e88e5a..b6dec25 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -7,10 +7,11 @@ The following table lists the Qml elements provided by the Qt Declarative module \bold {Standard Qt Declarative Elements} -\table 100% +\table 80% \header \o \bold {States} \o \bold {Animation and Transitions} +\o \bold {Working with Data} \o \bold {Utility} \row @@ -40,22 +41,30 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \list -\o \l Script \o \l Bind -\o \l Connection -\o \l Component \o \l ListModel +\o \l XmlListModel +\o \l SqlQuery, \l SqlConnection, and \l SqlBind \o \l DateTimeFormatter +\o \l NumberFormatter +\endlist + +\o +\list +\o \l Script +\o \l Connection +\o \l Component \endlist \endtable \bold {Fluid UI Primitives} -\table 100% +\table 80% \header -\o \bold {Basic Items} -\o \bold {Utility} +\o \bold {Basic Visual Items} +\o \bold {Basic Interaction Items} \o \bold {Widgets} +\o \bold {Utility} \row \o @@ -65,20 +74,17 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \l Text \o \l TextEdit \o \l Rect -\o \l MouseRegion -\o \l KeyActions \o \l AnimatedImage \o \l BlendedImage \endlist \o \list -\o \l Repeater -\o \l Content +\o \l MouseRegion +\o \l KeyActions \o \l FocusPanel \o \l FocusRealm \o \l KeyProxy -\o \l ComponentInstance \endlist \o @@ -88,9 +94,18 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \l WebView \endlist +\o +\list +\o \l Repeater +\o \l Content +\o \l ComponentInstance +\o \l WidgetContainer +\endlist + \header \o \bold {Views} \o \bold {Layouts} +\o \bold {Transforms} \o \bold {Effects} \row @@ -122,6 +137,14 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \list +\o \l Squish +\o \l Perspective +\o \l Rotation3D +\o \l Translation3D +\endlist + +\o +\list \o \l Shadow \o \l Reflection \o \l Blur diff --git a/doc/src/declarative/index.qdoc b/doc/src/declarative/qmlfordesign.qdoc index fe1b46e..35e47df 100644 --- a/doc/src/declarative/index.qdoc +++ b/doc/src/declarative/qmlfordesign.qdoc @@ -1,6 +1,6 @@ /*! - \page qml.html - \title 'Qt Declarative' Documentation + \page qmlfordesigners.html + \title Qt Declarative for Designers \target qtdeclarativemainpage @@ -13,8 +13,7 @@ Building fluid applications is done declaratively, rather than procedurally. That is, you specify \e what the UI should look like and how it should behave - in an declarative format called QML, rather than specifying step-by-step \e how to - build it in a language like C++ or JavaScript. Specifying a UI declaratively + rather than specifying step-by-step \e how to build it. Specifying a UI declaratively does not just include the layout of the interface items, but also the way each individual item looks and behaves and the overall flow of the application. @@ -23,7 +22,6 @@ \o \l {qmlexamples}{Examples} \o \l {tutorial}{Tutorial: 'Hello World'} \o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'} - \o \l {qmlforcpp}{Qt Declarative Markup Language For C++ Programmers} \endlist Core Features: @@ -41,11 +39,4 @@ \list \o \l {elements}{Qml Elements} \endlist - - C++ Reference: - \list - \o \l {qtprogrammers}{QML for Qt programmers} - \o \l {qtbinding}{C++ Data Binding} - \o \l {cppitem}{C++ Components} - \endlist */ diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 8a856ea..f0debdb 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -188,7 +188,7 @@ <li><a href="qtxmlpatterns.html">XML Patterns: XQuery & XPath</a></li> <li><a href="phonon-module.html">Phonon Multimedia Framework</a></li> <li><a href="qtscripttools.html">Script Tools Module</a></li> - <li><a href="qml.html">Qt Markup Language</a></li> + <li><a href="qtdeclarative.html">Declarative Module</a></li> <li><a href="activeqt.html">ActiveQt Framework</a></li> </ul> </td> diff --git a/examples/declarative/contacts/main.cpp b/examples/declarative/contacts/main.cpp index 6bf9daf..bda6565 100644 --- a/examples/declarative/contacts/main.cpp +++ b/examples/declarative/contacts/main.cpp @@ -7,7 +7,7 @@ #include <QTime> #include <QVBoxLayout> -const char *defaultFileName("contacts.xml"); +const char *defaultFileName("contacts.qml"); class Contacts : public QWidget { @@ -43,8 +43,8 @@ Contacts::Contacts(const QString &fileName, int width, int height, QWidget *pare QFile file(fileName); file.open(QFile::ReadOnly); - QString xml = file.readAll(); - canvas->setXml(xml, fileName); + QString qml = file.readAll(); + canvas->setQml(qml, fileName); canvas->execute(); } diff --git a/examples/declarative/minehunt/main.cpp b/examples/declarative/minehunt/main.cpp index 9db717b..7f10757 100644 --- a/examples/declarative/minehunt/main.cpp +++ b/examples/declarative/minehunt/main.cpp @@ -130,8 +130,8 @@ MyWidget::MyWidget(int width, int height, QWidget *parent, Qt::WindowFlags flags QFile file(fileName); file.open(QFile::ReadOnly); - QString xml = file.readAll(); - canvas->setXml(xml, fileName); + QString qml = file.readAll(); + canvas->setQml(qml, fileName); QmlContext *ctxt = canvas->rootContext(); ctxt->activate(); diff --git a/src/declarative/fx/qfxblurfilter.cpp b/src/declarative/fx/qfxblurfilter.cpp index 2bad18c..baa2253 100644 --- a/src/declarative/fx/qfxblurfilter.cpp +++ b/src/declarative/fx/qfxblurfilter.cpp @@ -73,15 +73,15 @@ public: \qml HorizontalLayout { Image { - src: "icon.png" + source: "icon.png" filter: Blur { radius: 0 } } Image { - src: "icon.png" + source: "icon.png" filter: Blur { radius: 5 } } Image { - src: "icon.png" + source: "icon.png" filter: Blur { radius: 10 } } } diff --git a/src/declarative/test/qfxtestview.cpp b/src/declarative/test/qfxtestview.cpp index 67b6c15..94bcb30 100644 --- a/src/declarative/test/qfxtestview.cpp +++ b/src/declarative/test/qfxtestview.cpp @@ -59,8 +59,8 @@ QFxTestView::QFxTestView(const QString &filename, const QString &testdir) QFile file(filename); file.open(QFile::ReadOnly); - QString xml = QString::fromUtf8(file.readAll()); - setXml(xml, filename); + QString qml = QString::fromUtf8(file.readAll()); + setQml(qml, filename); execute(); } diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index aefe3e4..cac73a0 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -97,7 +97,7 @@ public: QFxItem *root; QUrl source; - QString xml; + QString qml; QmlEngine engine; QmlComponent *component; @@ -113,20 +113,15 @@ public: QFxView currently provides a minimal interface for displaying QML files, and connecting between QML and C++ Qt objects. - Typcial usage: + Typical usage: \code ... QFxView *view = new QFxView(this); vbox->addWidget(view); - QFile file(fileName); - file.open(QFile::ReadOnly); - QString xml = file.readAll(); - view->setXml(xml, fileName); - - QFileInfo fi(file); - view->setPath(fi.path()); - + QUrl url(fileName); + view->setUrl(url); + ... view->execute(); ... \endcode @@ -185,31 +180,31 @@ QFxView::~QFxView() } /*! - Sets the source to the \a url. The XML string is set to + Sets the source to the \a url. The QML string is set to empty. */ void QFxView::setUrl(const QUrl& url) { d->source = url; - d->xml = QString(); + d->qml = QString(); } /*! Sets the source to the URL from the \a filename, and sets - the XML string to \a xml. + the QML string to \a qml. */ -void QFxView::setXml(const QString &xml, const QString &filename) +void QFxView::setQml(const QString &qml, const QString &filename) { d->source = QUrl::fromLocalFile(filename); - d->xml = xml; + d->qml = qml; } /*! - Returns the XML string. + Returns the QML string. */ -QString QFxView::xml() const +QString QFxView::qml() const { - return d->xml; + return d->qml; } /*! @@ -240,10 +235,10 @@ void QFxView::execute() { rootContext()->activate(); - if (d->xml.isEmpty()) { + if (d->qml.isEmpty()) { d->component = new QmlComponent(&d->engine, d->source, this); } else { - d->component = new QmlComponent(&d->engine, d->xml.toUtf8(), d->source); + d->component = new QmlComponent(&d->engine, d->qml.toUtf8(), d->source); } if (!d->component->isLoading()) { @@ -324,17 +319,17 @@ void QFxView::timerEvent(QTimerEvent* e) } /*! - Creates a \l{QmlComponent} {component} from the \a xml + Creates a \l{QmlComponent} {component} from the \a qml string, and returns it as an \l {QFxItem} {item}. If the \a parent item is provided, it becomes the new item's parent. \a parent should be in this view's item hierarchy. */ -QFxItem* QFxView::addItem(const QString &xml, QFxItem* parent) +QFxItem* QFxView::addItem(const QString &qml, QFxItem* parent) { if (!d->root) return 0; - QmlComponent component(&d->engine, xml.toUtf8(), QUrl()); + QmlComponent component(&d->engine, qml.toUtf8(), QUrl()); QObject *obj = component.create(); if (obj){ QFxItem *item = static_cast<QFxItem *>(obj); diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qfxview.h index c658f07..d2cacf4 100644 --- a/src/declarative/util/qfxview.h +++ b/src/declarative/util/qfxview.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef _QFXVIEW_H_ -#define _QFXVIEW_H_ +#ifndef QFXVIEW_H +#define QFXVIEW_H #include <qfxglobal.h> #include <QtCore/qdatetime.h> @@ -48,12 +48,12 @@ #include <QtGui/qwidget.h> #include <qsimplecanvas.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxItem; class QmlEngine; class QmlContext; @@ -70,14 +70,14 @@ public: virtual ~QFxView(); void setUrl(const QUrl&); - void setXml(const QString &xml, const QString &filename=QString()); - QString xml() const; + void setQml(const QString &qml, const QString &filename=QString()); + QString qml() const; QmlEngine* engine(); QmlContext* rootContext(); virtual void execute(); virtual void reset(); - virtual QFxItem* addItem(const QString &xml, QFxItem* parent=0); + virtual QFxItem* addItem(const QString &qml, QFxItem* parent=0); virtual void clearItems(); virtual QFxItem *root() const; @@ -102,8 +102,8 @@ private: QFxViewPrivate *d; }; - QT_END_NAMESPACE QT_END_HEADER -#endif // _QFXVIEW_H_ + +#endif // QFXVIEW_H |