diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-11-25 01:33:59 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-11-25 01:33:59 (GMT) |
commit | 553cf812d36437542005fcf758fe707b7e1c63a5 (patch) | |
tree | d8f66a8c2718215c4e2297bc2490c0cc82bd38b2 | |
parent | 5271a2f1a1bbc7eae45824d3aa860d53e3879b79 (diff) | |
parent | 368aa557ab3cf8a5c241890ff2f21e2b890df114 (diff) | |
download | Qt-553cf812d36437542005fcf758fe707b7e1c63a5.zip Qt-553cf812d36437542005fcf758fe707b7e1c63a5.tar.gz Qt-553cf812d36437542005fcf758fe707b7e1c63a5.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | doc/src/declarative/declarativeui.qdoc | 104 | ||||
-rw-r--r-- | doc/src/declarative/qmlintro.qdoc | 11 | ||||
-rw-r--r-- | doc/src/declarative/qtdeclarative.qdoc | 54 | ||||
-rw-r--r-- | doc/src/index.qdoc | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsflickable.cpp | 4 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsgridview.cpp | 12 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsimage.cpp | 10 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsimage_p.h | 3 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicslistview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.h | 2 |
10 files changed, 134 insertions, 70 deletions
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc new file mode 100644 index 0000000..7df87c5 --- /dev/null +++ b/doc/src/declarative/declarativeui.qdoc @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\title Declarative UI +\page declarativeui.html + +\brief The Qt Declarative module provides a declarative framework for building +highly dynamic, custom user interfaces. + +Qt Declarative aids programmers and designers in building the animation rich, +highly fluid user interfaces that are becoming common in portable consumer +electronics devices, such as mobile phones, media players, set-top boxes and +netbooks. The Qt Declarative module provides an engine for interpreting the +declarative QML language, and a rich set of \l {QML Elements}{QML elements} that can be used +from QML. + +QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm} +{ECMAScript}, that provides a mechanism to declaratively build an object tree +of QML elements. QML improves the integration between ECMAScript and Qt's +existing QObject based type system, adds support for automatic +\l {Property Binding}{property bindings} and provides \l {Network Transparency}{network transparency} at the language +level. + +The QML elements are a sophisticated set of graphical and behavioral building +blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components +ranging in complexity from simple buttons and sliders, to complete +internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo browser. + +Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}. +QML can be be used to incrementally extend an existing application or to build +completely new applications. QML is fully \l {Extending QML}{extensible from C++}. + +\section1 Getting Started: +\list +\o \l {Introduction to the QML language} +\o \l {Tutorial}{Tutorial: 'Hello World'} +\o \l {advtutorial.html}{Tutorial: 'Same Game'} +\o \l {QML Examples and Walkthroughs} +\o \l {Using QML in C++ Applications} +\endlist + +\section1 Core QML Features: +\list +\o \l {QML Documents} +\o \l {Property Binding} +\o \l {ECMAScript Blocks} +\o \l {QML Scope} +\o \l {Network Transparency} +\o \l {qmlmodels}{Data Models} +\o \l {anchor-layout}{Anchor-based Layout} +\o \l {qmlstates}{States} +\o \l {qmlanimation.html}{Animation} +\o \l {qmlmodules.html}{Modules} +\o \l {qmlfocus}{Keyboard Focus} +\o \l {Extending types from QML} +\endlist + +\section1 Reference: +\list +\o \l {QML Elements} +\o \l {QML Global Object} +\o \l {Extending QML} +\o \l {QtDeclarative Module} +\endlist +*/ diff --git a/doc/src/declarative/qmlintro.qdoc b/doc/src/declarative/qmlintro.qdoc index 2487a85..78462db 100644 --- a/doc/src/declarative/qmlintro.qdoc +++ b/doc/src/declarative/qmlintro.qdoc @@ -45,14 +45,10 @@ \tableofcontents -\section1 What is QML? - QML is a declarative language designed to describe the user interface of a program: both what it looks like, and how it behaves. In QML, a user interface is specified as a tree of objects with properties. -\section1 What should I know before starting? - This introduction is meant for those with little or no programming experience. JavaScript is used as a scripting language in QML, so you may want to learn a bit more about it (\l{JavaScript: The Definitive Guide}) before diving @@ -80,10 +76,9 @@ types always begin with a capital letter. In the above example, there are two objects, a \l Rectangle, and an \l Image. Between the braces, we can specify information about the object, such as its properties. -Properties are specified as \c {property: value} (much like CSS). In the above -example, we can see the Image has a property named \c source, which has been -assigned the value \c "pics/logo.png". The property and its value are -separated by a colon. +Properties are specified as \c {property: value}. In the above example, we +can see the Image has a property named \c source, which has been assigned the +value \c "pics/logo.png". The property and its value are separated by a colon. Properties can be specified one-per-line: diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index e46cbab..5947429 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -47,58 +47,4 @@ \brief The Qt Declarative module provides a declarative framework for building highly dynamic, custom user interfaces. -Qt Declarative aids programmers and designers in building the animation rich, -highly fluid user interfaces that are becoming common in portable consumer -electronics devices, such as mobile phones, media players, set-top boxes and -netbooks. The Qt Declarative module provides an engine for interpreting the -declarative QML language, and a rich set of \l {QML Elements}{QML elements} that can be used -from QML. - -QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm} -{ECMAScript}, that provides a mechanism to declaratively build an object tree -of QML elements. QML improves the integration between ECMAScript and Qt's -existing QObject based type system, adds support for automatic -\l {Property Binding}{property bindings} and provides \l {Network Transparency}{network transparency} at the language -level. - -The QML elements are a sophisticated set of graphical and behavioral building -blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components -ranging in complexity from simple buttons and sliders, to complete -internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo browser. - -Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}. -QML can be be used to incrementally extend an existing application or to build -completely new applications. QML is fully \l {Extending QML}{extensible from C++}. - -\section1 Getting Started: -\list -\o \l {Introduction to the QML language} -\o \l {Tutorial}{Tutorial: 'Hello World'} -\o \l {advtutorial.html}{Tutorial: 'Same Game'} -\o \l {QML Examples and Walkthroughs} -\o \l {Using QML in C++ Applications} -\endlist - -\section1 Core QML Features: -\list -\o \l {QML Documents} -\o \l {Property Binding} -\o \l {ECMAScript Blocks} -\o \l {QML Scope} -\o \l {Network Transparency} -\o \l {qmlmodels}{Data Models} -\o \l {anchor-layout}{Anchor-based Layout} -\o \l {qmlstates}{States} -\o \l {qmlanimation.html}{Animation} -\o \l {qmlmodules.html}{Modules} -\o \l {qmlfocus}{Keyboard Focus} -\o \l {Extending types from QML} -\endlist - -\section1 Reference: -\list -\o \l {QML Elements} -\o \l {QML Global Object} -\o \l {Extending QML} -\endlist */ diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 6b81936..762a900 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -103,7 +103,7 @@ <li><a href="paintsystem.html">Painting and Printing</a></li> <li><a href="graphicsview.html">Canvas UI with Graphics View</a></li> <li><a href="webintegration.html">Integrating Web Content</a></li> - <li><a href="qtdeclarative.html">Declarative UI</a></li> + <li><a href="declarativeui.html">Declarative UI</a></li> </ul> </td> <td valign="top"> diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp index b3a34ed..cc0f905 100644 --- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp @@ -613,7 +613,7 @@ void QmlGraphicsFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent const qreal maxY = q->maxYExtent(); if (newY > minY) newY = minY + (newY - minY) / 2; - if (newY < maxY && maxY - minY < 0) + if (newY < maxY && maxY - minY <= 0) newY = maxY + (newY - maxY) / 2; if (!q->overShoot() && (newY > minY || newY < maxY)) { if (newY > minY) @@ -640,7 +640,7 @@ void QmlGraphicsFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent const qreal maxX = q->maxXExtent(); if (newX > minX) newX = minX + (newX - minX) / 2; - if (newX < maxX && maxX - minX < 0) + if (newX < maxX && maxX - minX <= 0) newX = maxX + (newX - maxX) / 2; if (!q->overShoot() && (newX > minX || newX < maxX)) { if (newX > minX) diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp index 7e2d983..e36ea50 100644 --- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp @@ -1138,7 +1138,11 @@ qreal QmlGraphicsGridView::maxYExtent() const Q_D(const QmlGraphicsGridView); if (d->flow == QmlGraphicsGridView::TopToBottom) return QmlGraphicsFlickable::maxYExtent(); - return -(d->endPosition() - height()); + qreal extent = -(d->endPosition() - height()); + const qreal minY = minYExtent(); + if (extent > minY) + extent = minY; + return extent; } qreal QmlGraphicsGridView::minXExtent() const @@ -1154,7 +1158,11 @@ qreal QmlGraphicsGridView::maxXExtent() const Q_D(const QmlGraphicsGridView); if (d->flow == QmlGraphicsGridView::LeftToRight) return QmlGraphicsFlickable::maxXExtent(); - return -(d->endPosition() - width()); + qreal extent = -(d->endPosition() - width()); + const qreal minX = minXExtent(); + if (extent > minX) + extent = minX; + return extent; } void QmlGraphicsGridView::keyPressEvent(QKeyEvent *event) diff --git a/src/declarative/graphicsitems/qmlgraphicsimage.cpp b/src/declarative/graphicsitems/qmlgraphicsimage.cpp index 42fd910..9d59796 100644 --- a/src/declarative/graphicsitems/qmlgraphicsimage.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsimage.cpp @@ -141,6 +141,15 @@ QmlGraphicsImage::~QmlGraphicsImage() { } +/*! + \qmlproperty QPixmap Image::pixmap + + This property holds the QPixmap image to display. + + This is useful for displaying images provided by a C++ implementation, + for example, a model may provide a data role of type QPixmap. +*/ + QPixmap QmlGraphicsImage::pixmap() const { Q_D(const QmlGraphicsImage); @@ -164,6 +173,7 @@ void QmlGraphicsImagePrivate::setPixmap(const QPixmap &pixmap) q->setImplicitHeight(pix.height()); q->update(); + emit q->pixmapChanged(); } /*! diff --git a/src/declarative/graphicsitems/qmlgraphicsimage_p.h b/src/declarative/graphicsitems/qmlgraphicsimage_p.h index 76b8da5..81e10ab 100644 --- a/src/declarative/graphicsitems/qmlgraphicsimage_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsimage_p.h @@ -56,7 +56,7 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsImage : public QmlGraphicsImageBase Q_OBJECT Q_ENUMS(FillMode) - Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap DESIGNABLE false) + Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap NOTIFY pixmapChanged DESIGNABLE false) Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged) public: @@ -74,6 +74,7 @@ public: Q_SIGNALS: void fillModeChanged(); + void pixmapChanged(); protected: QmlGraphicsImage(QmlGraphicsImagePrivate &dd, QmlGraphicsItem *parent); diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index c6291f2..e05ae66 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1318,7 +1318,7 @@ void QmlGraphicsListView::setHighlightFollowsCurrentItem(bool autoHighlight) /*! \qmlproperty real ListView::preferredHighlightBegin \qmlproperty real ListView::preferredHighlightEnd - \qmlproperty bool ListView::highlightRangeMode + \qmlproperty enumeration ListView::highlightRangeMode These properties set the preferred range of the highlight (current item) within the view. diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qmlmetaproperty.h index 6db99c6..4b343f0 100644 --- a/src/declarative/qml/qmlmetaproperty.h +++ b/src/declarative/qml/qmlmetaproperty.h @@ -133,7 +133,7 @@ public: int valueTypeCoreIndex() const; private: friend class QmlEnginePrivate; - friend class QmlMetaPropertyPrivate;; + friend class QmlMetaPropertyPrivate; QmlMetaPropertyPrivate *d; }; typedef QList<QmlMetaProperty> QmlMetaProperties; |