aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure (KDE) <faure@kde.org>2013-01-23 18:34:01 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-23 18:41:57 +0100
commit0e856d7cb5280f19e93a0738a2eb11f70cf9f119 (patch)
tree5132ff2f9b4040fed2f31eb9e8c79387d989d065 /src
parentb700796884d29f1947194553c0103b5390b6bd42 (diff)
parent44b7d97d565677d6decbef2d010709bdb3d7cbd4 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src')
-rw-r--r--src/quick/doc/snippets/qml/path/basiccurve.qml1
-rw-r--r--src/quick/items/qquickpathview.cpp10
-rw-r--r--src/quick/util/qquickimageprovider.cpp6
3 files changed, 11 insertions, 6 deletions
diff --git a/src/quick/doc/snippets/qml/path/basiccurve.qml b/src/quick/doc/snippets/qml/path/basiccurve.qml
index 4a97f1bc96..ca554c56a0 100644
--- a/src/quick/doc/snippets/qml/path/basiccurve.qml
+++ b/src/quick/doc/snippets/qml/path/basiccurve.qml
@@ -43,6 +43,7 @@ import QtQuick 2.0
Canvas {
width: 400; height: 200
+ contextType: "2d"
Path {
id: myPath
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index a58ed599be..a7be50bc11 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -193,7 +193,7 @@ void QQuickPathView::initItem(int index, QQuickItem *item)
if (att) {
att->m_view = this;
qreal percent = d->positionOfIndex(index);
- if (percent < 1.0) {
+ if (percent < 1.0 && d->path) {
foreach (const QString &attr, d->path->attributes())
att->setValue(attr.toUtf8(), d->path->attributeAt(attr, percent));
item->setZ(d->requestedZ);
@@ -227,8 +227,10 @@ QQmlOpenMetaObjectType *QQuickPathViewPrivate::attachedType()
if (!attType) {
// pre-create one metatype to share with all attached objects
attType = new QQmlOpenMetaObjectType(&QQuickPathViewAttached::staticMetaObject, qmlEngine(q));
- foreach (const QString &attr, path->attributes())
- attType->createProperty(attr.toUtf8());
+ if (path) {
+ foreach (const QString &attr, path->attributes())
+ attType->createProperty(attr.toUtf8());
+ }
}
return attType;
@@ -423,6 +425,8 @@ void QQuickPathView::pathUpdated()
void QQuickPathViewPrivate::updateItem(QQuickItem *item, qreal percent)
{
+ if (!path)
+ return;
if (QQuickPathViewAttached *att = attached(item)) {
if (qFuzzyCompare(att->m_percent, percent))
return;
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index 5242269393..fb75a7669e 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -169,7 +169,7 @@ QImage QQuickTextureFactory::image() const
an image provider named "colors", and the images to be loaded are "yellow"
and "red", respectively:
- \snippet qml/imageprovider/imageprovider-example.qml 0
+ \snippet quick/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
@@ -180,9 +180,9 @@ QImage QQuickTextureFactory::image() const
requested by the above QML. This implementation dynamically
generates QPixmap images that are filled with the requested color:
- \snippet qml/imageprovider/imageprovider.cpp 0
+ \snippet quick/imageprovider/imageprovider.cpp 0
\codeline
- \snippet qml/imageprovider/imageprovider.cpp 1
+ \snippet quick/imageprovider/imageprovider.cpp 1
To make this provider accessible to QML, it is registered with the QML engine
with a "colors" identifier: