****************************************************************************/
//![0]
import QtQuick 2.0
-import QtQuick.LocalStorage 2.0 as LS
+import QtQuick.LocalStorage 2.0
Rectangle {
- color: "white"
width: 200
height: 100
-
+
Text {
text: "?"
anchors.horizontalCenter: parent.horizontalCenter
+
function findGreetings() {
- var db = LS.openDatabaseSync("QDeclarativeExampleDB", "1.0", "The Example QML SQL!", 1000000);
+ var db = LocalStorage.openDatabaseSync("QQmlExampleDB", "1.0", "The Example QML SQL!", 1000000);
db.transaction(
function(tx) {
\section1 Detailed Description
- To use the types in this module, import the module with a namespace and call the
- relevant functions using the namespace qualifier:
+ To use the types in this module, import the module and call the
+ relevant functions using the \c LocalStorage type:
\code
- import QtQuick.LocalStorage 2.0 as LS
+ import QtQuick.LocalStorage 2.0
import QtQuick 2.0
Item {
Component.onCompleted: {
- var db = LS.openDatabaseSync(...)
+ var db = LocalStorage.openDatabaseSync(...)
}
}
\endcode
The API can be used from JavaScript functions in your QML:
-\snippet qml/sqllocalstorage/hello.qml 0
+\snippet localstorage/localstorage/hello.qml 0
The API conforms to the Synchronous API of the HTML5 Web Database API,
\link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink.
-The \l{declarative/sqllocalstorage}{SQL Local Storage example} demonstrates the basics of
+The \l{localstorage/localstorage}{SQL Local Storage example} demonstrates the basics of
using the Offline Storage API.
\section3 Open or create a databaseData
\code
import QtQuick.LocalStorage 2.0 as LS
-db = LS.openDatabaseSync(identifier, version, description, estimated_size, callback(db))
+db = Sql.openDatabaseSync(identifier, version, description, estimated_size, callback(db))
\endcode
The above code returns the database identified by \e identifier. If the database does not already exist, it
is created, and the function \e callback is called with the database as a parameter. \e description
The \l{Integrating QML and C++} documentation shows
other useful features that can be added to QML extensions. For example, we
-could use \l{Default Property}{default properties} to allow
+could use \l{Default Properties}{default properties} to allow
slices to be added without using the \c slices property:
\code
as a new QML element. It provides the current time through \c hour and \c minute
properties.
- \snippet examples/qml/cppextensions/plugins/plugin.cpp 0
+ \snippet examples/qml/plugins/plugin.cpp 0
\dots
To make this type available, we create a plugin class named \c QExampleQmlPlugin
definition to register the plugin with the Qt meta object system using a unique
identifier for the plugin.
- \snippet examples/qml/cppextensions/plugins/plugin.cpp plugin
+ \snippet examples/qml/plugins/plugin.cpp plugin
The \c TimeModel class receives a \c{1.0} version of this plugin library, as
a QML type called \c Time. The Q_ASSERT() macro can ensure the type namespace is
that is built by the project (as shown above in the \c .pro file) so both of these
need to be specified in the \c qmldir file:
- \quotefile examples/qml/cppextensions/plugins/com/nokia/TimeExample/qmldir
+ \quotefile examples/qml/plugins/com/nokia/TimeExample/qmldir
Once the project is built and installed, the new \c Time component is
accessible by any QML component that imports the \c com.nokia.TimeExample
module
- \snippet examples/qml/cppextensions/plugins/plugins.qml 0
+ \snippet examples/qml/plugins/plugins.qml 0
- The full source code is available in the \l {qml/cppextensions/plugins}{plugins example}.
+ The full source code is available in the \l {qml/plugins}{plugins example}.
\section1 Reference
for that version, leaving other identifiers available, even if the actual
installed version might otherwise provide those identifiers.
-See \l{examples/qml/cppextensions/plugins} for an example that uses C++
+See \l{examples/qml/plugins} for an example that uses C++
plugins.
with JavaScript and C++.
The Qt QML module provides both the \c QtQml QML module, which supplies
-\l{Qt QML - C++ Classes}{a set of core QML types} for creating QML
-applications, and the \c QtQml C++ module, which supplies \l{Qt QML - C++ Classes}{a set of C++
+\l{Qt QML Module - C++ Classes}{a set of core QML types} for creating QML
+applications, and the \c QtQml C++ module, which supplies \l{Qt QML Module - C++ Classes}{a set of C++
APIs} for extending QML applications with custom types and integrating C++
implementations with QML applications.
\qml
Rectangle {
- width: 200
- height: 200
+ width: 100
+ height: 100
color: "red"
}
\endqml
import QtQuick 2.0
Rectangle {
- width: 200
- height: 200
+ width: 100
+ height: 100
color: "red"
}
\endqml
\note If an object definition only has a small number of properties, it can be written on a single line like this, with the properties separated by semi-colons:
\qml
-Rectangle { width: 200; height: 200; color: "red" }
+Rectangle { width: 100; height: 100; color: "red" }
\endqml
Obviously, the \l Rectangle object declared in this example is very simple indeed, as it defines nothing more than a few property values. To create more useful objects, an object declaration may define many other types of attributes: these are discussed in the \l{qtqml-syntax-objectattributes.html}{QML Object Attributes} documentation. Additionally, an object declaration may define child objects, as discussed below.
import QtQuick 2.0
Rectangle {
- width: 200
- height: 200
+ width: 100
+ height: 100
gradient: Gradient {
GradientStop { position: 0.0; color: "yellow" }
as a new QML element. It provides the current time through \c hour and \c minute
properties, like this:
- \snippet examples/qml/cppextensions/plugins/plugin.cpp 0
+ \snippet examples/qml/plugins/plugin.cpp 0
\dots
To make this class available as a QML type, create a plugin that registers
module will be named \c com.nokia.TimeExample (as defined in the project
file further below).
- \snippet examples/qml/cppextensions/plugins/plugin.cpp plugin
+ \snippet examples/qml/plugins/plugin.cpp plugin
\codeline
- \snippet examples/qml/cppextensions/plugins/plugin.cpp export
+ \snippet examples/qml/plugins/plugin.cpp export
This registers the \c TimeModel class with the 1.0 version of this
plugin library, as a QML type called \c Time. The Q_ASSERT statement
should be bundled with the plugin, so it needs to be specified in the \c qmldir
file:
- \quotefile examples/qml/cppextensions/plugins/com/nokia/TimeExample/qmldir
+ \quotefile examples/qml/plugins/com/nokia/TimeExample/qmldir
Once the project is built and installed, the new \c Time element can be
used by any QML component that imports the \c com.nokia.TimeExample module:
- \snippet examples/qml/cppextensions/plugins/plugins.qml 0
+ \snippet examples/qml/plugins/plugins.qml 0
- The full source code is available in the \l {qml/cppextensions/plugins}{plugins example}.
+ The full source code is available in the \l {qml/plugins}{plugins example}.
The \l {Writing QML Extensions with C++} tutorial also contains a chapter
on creating QML plugins.
The QtQuick 1 version of this class is named QDeclarativeNetworkAccessManagerFactory.
- \sa {qml/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example}
+ \sa {qml/networkaccessmanagerfactory}{NetworkAccessManagerFactory example}
*/
/*!
**
****************************************************************************/
-//![0]
+//![import]
import QtQuick 2.0
-Item {
- width: 320
- height: 480
+//![import]
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
+Column {
+
+//![direct]
+Item {
+ width: 100; height: 100
Rectangle {
// Manually positioned at 20,20
height: 80
color: "red"
}
+}
+//![direct]
+
+//![anchors]
+Item {
+ width: 200; height: 200
+
Rectangle {
// Anchored to 20px off the top right corner of the parent
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 20 // Sets all margins at once
+
width: 80
height: 80
- color: "blue"
+ color: "orange"
}
+
Rectangle {
- // Anchored to 20px off the top center corner of the parent
- // Note the different group property syntax to the previous Rectangle. Both are valid.
+ // Anchored to 20px off the top center corner of the parent.
+ // Notice the different group property syntax for 'anchors' compared to
+ // the previous Rectangle. Both are valid.
anchors { horizontalCenter: parent.horizontalCenter; top: parent.top; topMargin: 20 }
+
width: 80
height: 80
color: "green"
}
+}
+//![anchors]
- Row { // Lays the Rectangles out in a line
- x: 20
- y: 120
+//![positioners]
+Item {
+ width: 300; height: 100
+
+ Row { // The "Row" type lays out its child items in a horizontal line
spacing: 20 // Places 20px of space between items
+
Rectangle { width: 80; height: 80; color: "red" }
Rectangle { width: 80; height: 80; color: "green" }
Rectangle { width: 80; height: 80; color: "blue" }
}
+}
+//![positioners]
+
+Item {
+ width: 300; height: 400
Rectangle {
id: middleRect
color: "blue"
}
}
-//![0]
+
+}
declarative, JSON-like syntax with support for imperative JavaScript
expressions combined with dynamic property bindings.
-The QML language and engine infrastructure is provided by the Qt QML module.
+The QML language and engine infrastructure is provided by the \l {Qt QML} module.
For in-depth information about the QML language, please see the
\l{Qt QML} module documentation.
XmlListModel and XmlRole types must import \e {QtQuick.XmlListModel} instead.
\li The local storage API that enables SQL support has been moved from the \l {QML Global Object}
into a \c QtQuick.LocalStorage singleton type. Any code that requires the local storage API must import
-\e {QtQuick.LocalStorage} instead. See the \l \l{QtQuick.LocalStorage 2}{QtQuick.LocalStorage} documentation
+\e {QtQuick.LocalStorage} instead. See the \l {QtQuick.LocalStorage 2}{QtQuick.LocalStorage} documentation
for examples.
\li The \c LayoutItem type has been removed from the \c QtQuick module as it was specific to the
Graphics View framework backend used in QtQuick 1.
\title Use Case - Layouts In QML
\brief Example of how to create layouts for visual elements in a QML application
-There are several ways to position items in QML, including simple property bindings.
+There are several ways to position items in QML.
+
+Below is a brief overview. For more details, see \l {Important Concepts In Qt Quick - Positioning}.
\section1 Manual Positioning
-Items can be placed at specific x,y coordinates on the screen by setting their x,y properties. This will setup their
-position relative to the top left corner of their parent, for more detail see \c {Visual Canvas}.
+Items can be placed at specific x,y coordinates on the screen by setting their x,y properties. This will
+setup their position relative to the top left corner of their parent, according to the
+\l {Concepts - Visual Coordinates in Qt Quick}{visual coordinate system} rules.
-Combined with using bindings instead of constant valudes for these properties, relative positioning is also easily
+Combined with using \l{Property Binding}{bindings} instead of constant valudes for these properties, relative positioning is also easily
accomplished by setting the x and y coordinates to the appropriate bindings.
+\snippet qml/usecases/layouts.qml import
\snippet qml/usecases/layouts.qml direct
+\image qml-uses-layouts-direct.png
+
+
\section1 Anchors
-The \c Item type provides the abilitiy to anchor to other Item types. There are six anchor lines for each item: left,
-right, vertical center, top, bottom and horizontal center. The three vertical anchor lines can be anchored to any of
+The \c Item type provides the abilitiy to anchor to other \l Item types. There are six anchor lines for each item: \e left,
+\e right, \e{vertical center}, \e top, \e bottom and \e{horizontal center}. The three vertical anchor lines can be anchored to any of
the three vertical anchor lines of another item, and the three horizontal anchor lines can be anchored to the
horizontal anchor lines of another item.
-For full details, see the documentation of the \l{Item::anchors}{anchors property}.
+For full details, see \l {Positioning with Anchors} and the documentation of the \l{Item::anchors.top}{anchors property}.
+\snippet qml/usecases/layouts.qml import
\snippet qml/usecases/layouts.qml anchors
+\image qml-uses-layouts-anchors.png
+
+
\section1 Positioners
-For the common case of wanting to position a set of elements in a regular pattern, QtQuick provides some Positioner
-types. Items placed in a positioner are automatically positioned in some way, for example a Row positions items to be
+For the common case of wanting to position a set of elements in a regular pattern, QtQuick provides some positioner
+types. Items placed in a positioner are automatically positioned in some way; for example, a \l Row positions items to be
horizontally adjacent (forming a row).
-For full details see the documentation for \l{qtquick-qmltypereference.html#positioning}{the positioner types}.
+For full details see \l {Item Layouts} and the documentation for \l{qtquick-qmltypereference.html#positioning}{the positioner types}.
+\snippet qml/usecases/layouts.qml import
\snippet qml/usecases/layouts.qml positioners
-\image qml-uses-layouts.png
+\image qml-uses-layouts-positioners.png
*/
in the \l{MouseArea} type (which will be documented thoroughly in a proceeding
section).
-\section1 Motion Gestures
-
-Detecting gestures with an accelerometer, or through camera-based gesture
-recognition, can allow users to interact with an application without requiring
-their full and undevided attention. It can also provide a more interactive
-and engaging experience.
-
-Qt Quick itself does not offer first-class support for motion gestures, however
-another QML add-on module which provides support for gestures, which uses
-Qt Quick and integrates with Qt Quick's visual canvas does exist. See the
-Qt Sensors module documentation for more information on the topic.
-
-\section1 Keyboard
-
-Supporting input from a keyboard is a vital component of the user-interface of
-many applications.
-
-XXX TODO: generic keypress event handling documentation?
-
-Qt Quick also provides visual object types which automatically receive keyboard
-events and key-presses, and displays the appropriate text. Please see the
-documentation about \l{qtquick-input-textinput.html}{text input} for
-in-depth information on the topic.
\section1 Mouse
-The computer mouse is still a very important vector for user-input. Detecting
-and reacting to clicks and presses according to their position is a fundamental
+Mouse input is another important user input for user interfaces. Detecting
+and reacting to clicks and presses according to the mouse cursor position is a fundamental
concept in user-interface design.
Qt Quick provides the MouseArea visual object type which automatically receives
documentation about \l{qtquick-input-mouseevents.html}
{mouse events in Qt Quick} for more information on the topic.
-\section1 Focus
-Most user-interfaces have multiple visual objects, but usually only one object
-has focus (that is, receives key-press events) at any time. Qt Quick has
-support for complex focus specification. See the documentation about
-\l{qtquick-input-focus.html}{keyboard focus in Qt Quick} for more
+\section1 Keyboard Input and Keyboard Focus
+
+Supporting input from a keyboard is a vital component of the user interface of
+many applications.
+
+Any visual item can receive keyboard input through the \l Keys attached type.
+Additionally, the issue of \e {keyboard focus} arises when multiple items
+are required to receive key events, as these events must be passed to the
+correct item. See the documentation about \l{Keyboard focus in Qt Quick} for more
information on this topic.
+Qt Quick also provides visual text items which automatically receive keyboard
+events and key-presses, and displays the appropriate text. See the
+documentation about \l{qtquick-input-textinput.html}{text input} for
+in-depth information on the topic.
+
+
+\section1 Device Motion Gestures
+
+Detecting device gestures with an accelerometer, or through camera-based gesture
+recognition, can allow users to interact with an application without requiring
+their full and undevided attention. It can also provide a more interactive
+and engaging experience.
+
+Qt Quick itself does not offer first-class support for physical device motion gestures;
+however, the \l{Qt Sensors} module provides QML types with support for such gestures.
+See the \l{Qt Sensors} module documentation for more information on the topic.
+
*/
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms
-** and conditions contained in a signed written agreement between you
-** and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-modelviewsdata-localstorage.html
-\title Local Storage
-\brief SQL storage for Qt Quick
-
-Qt Quick includes a simple API to allow saving data to an SQL database. The
-QtQuick.LocalStorage module provides a JavaScript interface to SQL which may be
-accessed from QML documents. When imported, the module may be namespaced for
-developer convenience.
-
-Import QtQuick.LocalStorage module from QML:
-\code
-//sql.qml
-
-import QtQuick.LocalStorage 2.0 as Sql
-\endcode
-
-
-Import QtQuick.LocalStorage module from JavaScript:
-\code
-//sql.js
-.import QtQuick.LocalStorage 2.0 as Sql
-\endcode
-
-Note, importing a module from JavaScript is different from importing from QML.
-The \l{JavaScript Code} article contains detailed information on importing in JavaScript code.
-
-
-\section2 Database API
-
-The \c openDatabaseSync() and related functions
-provide the ability to access local storage in an SQL database.
-
-These databases are user-specific and QML-specific, but accessible to all QML applications.
-They are stored in the \c Databases subdirectory
-of QQmlEngine::offlineStoragePath(), currently as SQLite databases.
-
-Database connections are automatically closed during Javascript garbage collection.
-
-The API can be used from JavaScript functions in your QML:
-
-\snippet examples/localstorage/hello.qml 0
-
-The API conforms to the Synchronous API of the HTML5 Web Database API,
-\link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink.
-
-The \l{examples/localstorage}{SQL Local Storage example} demonstrates the basics of
-using the Local Storage API.
-
-\section3 db = openDatabaseSync(identifier, version, description, estimated_size, callback(db))
-
-Returns the database identified by \e identifier. If the database does not already exist, it
-is created, and the function \e callback is called with the database as a parameter. \e description
-and \e estimated_size are written to the INI file (described below), but are otherwise currently
-unused.
-
-May throw exception with code property SQLException.DATABASE_ERR, or SQLException.VERSION_ERR.
-
-When a database is first created, an INI file is also created specifying its characteristics:
-
-\table
-\header \li \b {Key} \li \b {Value}
-\row \li Name \li The name of the database passed to \c openDatabase()
-\row \li Version \li The version of the database passed to \c openDatabase()
-\row \li Description \li The description of the database passed to \c openDatabase()
-\row \li EstimatedSize \li The estimated size (in bytes) of the database passed to \c openDatabase()
-\row \li Driver \li Currently "QSQLITE"
-\endtable
-
-This data can be used by application tools.
-
-\section3 db.changeVersion(from, to, callback(tx))
-
-This method allows you to perform a \e{Scheme Upgrade}.
-
-If the current version of \e db is not \e from, then an exception is thrown.
-
-Otherwise, a database transaction is created and passed to \e callback. In this function,
-you can call \e executeSql on \e tx to upgrade the database.
-
-May throw exception with code property SQLException.DATABASE_ERR or SQLException.UNKNOWN_ERR.
-
-\section3 db.transaction(callback(tx))
-
-This method creates a read/write transaction and passed to \e callback. In this function,
-you can call \e executeSql on \e tx to read and modify the database.
-
-If the callback throws exceptions, the transaction is rolled back.
-
-\section3 db.readTransaction(callback(tx))
-
-This method creates a read-only transaction and passed to \e callback. In this function,
-you can call \e executeSql on \e tx to read the database (with SELECT statements).
-
-\section3 results = tx.executeSql(statement, values)
-
-This method executes a SQL \e statement, binding the list of \e values to SQL positional parameters ("?").
-
-It returns a results object, with the following properties:
-
-\table
-\header \li \b {Type} \li \b {Property} \li \b {Value} \li \b {Applicability}
-\row \li int \li rows.length \li The number of rows in the result \li SELECT
-\row \li var \li rows.item(i) \li Function that returns row \e i of the result \li SELECT
-\row \li int \li rowsAffected \li The number of rows affected by a modification \li UPDATE, DELETE
-\row \li string \li insertId \li The id of the row inserted \li INSERT
-\endtable
-
-May throw exception with code property SQLException.DATABASE_ERR, SQLException.SYNTAX_ERR, or SQLException.UNKNOWN_ERR.
-
-
-
-*/
Databases are commonly used to store information in applications. Qt Quick
provides simplified access to relational databases via the
-\l{qtquick-modelviewsdata-localstorage.html}{Qt Quick local storage module}.
+\l{QtQuick.LocalStorage 2}{Qt Quick local storage module}.
*/
\l{qtquick-visual-coordinates.html}{coordinate system}
provided by the Qt Quick visual canvas. As described in that document, the
x and y coordinates of a visual object are relative to those of its visual
-parent, with the top-left corner have the value [0, 0].
+parent, with the top-left corner having the coordinate (0, 0).
-Thus, the following example will display three rectangles positioned manually:
+Thus, the following example will display two rectangles positioned manually:
\table
\header
\qml
import QtQuick 2.0
- Rectangle {
- id: r1
- x: 0
- y: 0
+ Item {
width: 200
height: 200
Rectangle {
- id: r2
- x: 0
- y: 100
+ x: 50
+ y: 50
width: 100
height: 100
- }
+ color: "green"
+ }
- Rectangle {
- id: r3
+ Rectangle {
x: 100
y: 100
width: 50
- height: 100
- }
+ height: 50
+ color: "yellow"
+ }
}
\endqml
\li
\title C++ Extension Points Provided By Qt Quick
\brief Description of the C++ extension points provided by the Qt Quick module
-// XXX TODO: should this be a topic page? Are each of the sections below big enough to require their own page?
+All QML applications can be extended from C++ in order to use additional
+functionality implemented in C++ code or to provide a C++ based QML plugin.
+This topic of extending QML from C++ is covered in the \l {Integrating QML and C++}
+documentation.
-Qt Quick provides several extension and integration points for C++ developers.
-In particular, it allows C++ developers to create and register custom
+Additionally, the Qt Quick module provides several extension and integration points for C++
+developers, specific to this module. In particular, it allows C++ developers to create and register custom
QQuickItem-derived types which can be rendered by Qt Quick. It also provides
several scene graph-related classes which allow developers to define their own
rendering primitives.
+
\section1 User-Defined QQuickItem-Derived Types
While the Qt Quick module already provides a rich library of visual item types
for use in a QML application, some developers may wish to define their own
-item-derived types in C++ and expose them to the QML type system.
+item-derived types in C++ and expose them to the QML type system. The easiest
+way to do this is to subclass QQuickItem, which is the base type
+for all visual types in the Qt Quick module. See the QQuickItem documentation
+for more details.
+
\section1 Scene Graph-Related Classes
As an OpenGL-based scene graph, the scene graph in Qt Quick uses nodes which
-may be geometries or textures.
+may be geometries or textures. The \l {Qt Quick Module - C++ Classes}{Qt Quick C++ API}
+provides various classes to enable custom nodes to be created in C++ to be
+used with the scene graph framework.
+
+See the \l {Qt Quick Scene Graph} documentation for details.
+
+
+\section1 Pixmap and Threaded Image Support
+
+While the QML engine allows QML application to load images from filesystem or
+network resources, some applications may require the additional option of
+loading images from C++ based processes. This can be implemented through the
+QQuickImageProvider class, which provides support for pixmap loading and
+threaded image requests for QML applications. Any QML application that
+requests an image through the special "image:" URL scheme will be directed
+to an appropriate image provider to load the image.
+
+For more information, see the QQuickImageProvider documentation.
*/
\list
\li \l{qtquick-cppextensionpoints.html#user-defined-qquickitem-derived-types}{Creating User-Defined QQuickItem-Derived Types}
\li \l{qtquick-cppextensionpoints.html#scene-graph-related-classes}{Scene Graph-Related Classes}
+ \li \l{qtquick-cppextensionpoints.html#pixmap-and-threaded-image-support}{Pixmap and Threaded Image Support}
\endlist
\endlist
\li QSGGeometryNode
\li QSGClipNode
\li QSGTransformNode
-\li QSGRootNode
\li QSGOpacityNode
-\li QSGNodeVisitor
\li QSGFlatColorMaterial
\li QSGSimpleRectNode
\li QSGSimpleTextureNode
\li New \c getText() method returns the text located between specified start and end indexes.
Additionally TextEdit has a \l{TextEdit::}{getFormattedText()} method that returns the formatted
text.
- \li \c openSoftwareInputPanel() and \c closeSoftwareInputPanel() methods have been removed. Use
- \c Qt.application.inputMethod.show() and \c Qt.application.inputMethod.hide() instead.
\endlist
\li \l Text only:
\list
*/
/*!
+ \class QQuickItem::ItemChangeData
+ \internal
+*/
+
+/*!
\enum QQuickItem::TransformOrigin
Controls the point about which simple transforms like scale apply.
See \l{Qt Quick States} and \l{Animation and Transitions in Qt Quick} for
more details on using states and transitions.
- \sa transitions
+ \sa states
*/
/*!
\property QQuickItem::transitions
\property QQuickItem::transform
\internal
*/
+/*!
+ \internal
+ */
QQmlListProperty<QQuickTransform> QQuickItem::transform()
{
return QQmlListProperty<QQuickTransform>(this, 0, QQuickItemPrivate::transform_append,
}
/*!
+ \qmlmethod object QtQuick2::Item::contains(point point)
+
+ Returns true if this item contains \a point, which is in local coordinates;
+ returns false otherwise.
+ */
+/*!
Returns true if this item contains \a point, which is in local coordinates;
returns false otherwise.
an image provider named "colors", and the images to be loaded are "yellow"
and "red", respectively:
- \snippet examples/qml/cppextensions/imageprovider/imageprovider-example.qml 0
+ \snippet examples/qml/imageprovider/imageprovider-example.qml 0
When these images are loaded by QML, it looks for a matching image provider
and calls its requestImage() or requestPixmap() method (depending on its
requested by the above QML. This implementation dynamically
generates QPixmap images that are filled with the requested color:
- \snippet examples/qml/cppextensions/imageprovider/imageprovider.cpp 0
+ \snippet examples/qml/imageprovider/imageprovider.cpp 0
\codeline
- \snippet examples/qml/cppextensions/imageprovider/imageprovider.cpp 1
+ \snippet examples/qml/imageprovider/imageprovider.cpp 1
To make this provider accessible to QML, it is registered with the QML engine
with a "colors" identifier:
\image imageprovider.png
A complete example is available in Qt's
- \l {qml/cppextensions/imageprovider}{examples/qml/cppextensions/imageprovider}
+ \l {qml/imageprovider}{examples/qml/imageprovider}
directory. Note the example registers the provider via a \l{QQmlExtensionPlugin}{plugin}
instead of registering it in the application \c main() function as shown above.