From 7df3dce47c1ed9545065f60c3faebdd31d922a38 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 11 Nov 2009 14:32:50 +1000 Subject: remove unneeded constructor --- src/declarative/extra/qmlgraphicsanimatedimageitem.cpp | 7 +------ src/declarative/extra/qmlgraphicsanimatedimageitem_p.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp index 2405bde..c364684 100644 --- a/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp +++ b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE QMovie::supportedFormats(). \table - \row + \row \o \image animatedimageitem.gif \o \qml @@ -83,11 +83,6 @@ QmlGraphicsAnimatedImageItem::QmlGraphicsAnimatedImageItem(QmlGraphicsItem *pare { } -QmlGraphicsAnimatedImageItem::QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent) - : QmlGraphicsImage(dd, parent) -{ -} - QmlGraphicsAnimatedImageItem::~QmlGraphicsAnimatedImageItem() { Q_D(QmlGraphicsAnimatedImageItem); diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h index b581ea3..d716114 100644 --- a/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h +++ b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h @@ -90,7 +90,6 @@ private Q_SLOTS: void playingStatusChanged(); protected: - QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent); void componentComplete(); private: -- cgit v0.12 From 7b06c4ca4bd6f91528d1d9ebf44e2f566e817558 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 11 Nov 2009 15:24:07 +1000 Subject: Doc fixes after \qmlmethod changes. --- src/declarative/graphicsitems/qmlgraphicsitem.cpp | 4 ++-- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 4 ++-- src/declarative/graphicsitems/qmlgraphicsparticles.cpp | 2 +- src/declarative/util/qmllistmodel.cpp | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp index 572aa98..aa5c4cb 100644 --- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp @@ -1329,9 +1329,9 @@ QmlGraphicsKeysAttached *QmlGraphicsKeysAttached::qmlAttachedProperties(QObject Key handling is available to all Item-based visual elements via the \l {Keys}{Keys} attached property. The \e Keys attached property provides basic handlers such - as \l {Keys::onPressed(event)}{onPressed} and \l {Keys::onReleased(event)}{onReleased}, + as \l {Keys::onPressed}{onPressed} and \l {Keys::onReleased}{onReleased}, as well as handlers for specific keys, such as - \l {Keys::onCancelPressed(event)}{onCancelPressed}. The example below + \l {Keys::onCancelPressed}{onCancelPressed}. The example below assigns \l {qmlfocus}{focus} to the item and handles the Left key via the general \e onPressed handler and the Select key via the onSelectPressed handler: diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 12bf0d8..edcd094 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1663,7 +1663,7 @@ void QmlGraphicsListView::keyPressEvent(QKeyEvent *event) } /*! - \qmlmethod ListView::incrementCurrentIndex + \qmlmethod ListView::incrementCurrentIndex() Increments the current index. The current index will wrap if keyNavigationWraps is true and it is currently at the end. @@ -1680,7 +1680,7 @@ void QmlGraphicsListView::incrementCurrentIndex() } /*! - \qmlmethod ListView::decrementCurrentIndex + \qmlmethod ListView::decrementCurrentIndex() Decrements the current index. The current index will wrap if keyNavigationWraps is true and it is currently at the beginning. diff --git a/src/declarative/graphicsitems/qmlgraphicsparticles.cpp b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp index 399e1a5..a0b41e8 100644 --- a/src/declarative/graphicsitems/qmlgraphicsparticles.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp @@ -1169,7 +1169,7 @@ void QmlGraphicsParticles::setMotion(QmlGraphicsParticleMotion *motion) } /*! - \qmlmethod Particles::burst + \qmlmethod Particles::burst(int count, int emissionRate) Initiates a burst of particles. diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 19282eb..9e91147 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -467,7 +467,7 @@ void QmlListModel::remove(int index) } /*! - \qmlmethod ListModel::insert(index,dict) + \qmlmethod ListModel::insert(int index, jsobject dict) Adds a new item to the list model at position \a index, with the values in \a dict. @@ -500,7 +500,7 @@ void QmlListModel::insert(int index, const QScriptValue& valuemap) } /*! - \qmlmethod ListModel::move(from,to,n) + \qmlmethod ListModel::move(int from, int to, int n) Moves \a n items \a from one position \a to another. @@ -551,7 +551,7 @@ void QmlListModel::move(int from, int to, int n) } /*! - \qmlmethod ListModel::append(dict) + \qmlmethod ListModel::append(jsobject dict) Adds a new item to the end of the list model, with the values in \a dict. @@ -578,7 +578,7 @@ void QmlListModel::append(const QScriptValue& valuemap) } /*! - \qmlmethod object ListModel::get(index) + \qmlmethod object ListModel::get(int index) Returns the item at \a index in the list model. @@ -620,7 +620,7 @@ QScriptValue QmlListModel::get(int index) const } /*! - \qmlmethod ListModel::set(index,dict) + \qmlmethod ListModel::set(int index, jsobject dict) Changes the item at \a index in the list model with the values in \a dict. Properties not appearing in \a valuemap @@ -663,7 +663,7 @@ void QmlListModel::set(int index, const QScriptValue& valuemap) } /*! - \qmlmethod ListModel::set(index,property,value) + \qmlmethod ListModel::set(int index, string property, variant value) Changes the \a property of the item at \a index in the list model to \a value. -- cgit v0.12 From 544c936c8db0560174f27241fbbe41c172e4b0ce Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 11 Nov 2009 15:24:55 +1000 Subject: Don't display "QML" for attached signals/methods. --- tools/qdoc3/cppcodemarker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index a8f6a02..f3c8fa5 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -1127,7 +1127,7 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, "signal", "signals"); FastSection qmlattachedsignals(qmlClassNode, - "QML Attached Signals", + "Attached Signals", "signal", "signals"); FastSection qmlmethods(qmlClassNode, @@ -1135,7 +1135,7 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, "method", "methods"); FastSection qmlattachedmethods(qmlClassNode, - "QML Attached Methods", + "Attached Methods", "method", "methods"); -- cgit v0.12 From 49e1b989213028dac8557d4e74ab530f77fc8a07 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 11 Nov 2009 16:42:22 +1000 Subject: basic PathView autotests --- tests/auto/declarative/declarative.pro | 1 + .../qmlgraphicspathview/data/pathview1.qml | 4 + .../qmlgraphicspathview/data/pathview2.qml | 57 ++++++++++ .../qmlgraphicspathview/data/pathview3.qml | 58 ++++++++++ .../qmlgraphicspathview/qmlgraphicspathview.pro | 8 ++ .../tst_qmlgraphicspathview.cpp | 123 +++++++++++++++++++++ 6 files changed, 251 insertions(+) create mode 100644 tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml create mode 100644 tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml create mode 100644 tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml create mode 100644 tests/auto/declarative/qmlgraphicspathview/qmlgraphicspathview.pro create mode 100644 tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 6b2e39e..0b9e6ec 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -27,6 +27,7 @@ SUBDIRS += \ qmlgraphicsflickable \ # Cover qmlgraphicsflipable \ # Cover qmlgraphicsparticles \ # Cover + qmlgraphicspathview \ # Cover qmlgraphicspositioners \ # Cover qmlgraphicstext \ # Cover qmlgraphicstextedit \ # Cover diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml new file mode 100644 index 0000000..b3b0a9a --- /dev/null +++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview1.qml @@ -0,0 +1,4 @@ +import Qt 4.6 + +PathView { +} diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml new file mode 100644 index 0000000..0d5c98b --- /dev/null +++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview2.qml @@ -0,0 +1,57 @@ +import Qt 4.6 + +PathView { + id: photoPathView; model: rssModel; delegate: photoDelegate + y: 100; width: 800; height: 330; pathItemCount: 10; z: 1 + + path: Path { + startX: -50; startY: 40; + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: -45 } + + PathCubic { + x: 400; y: 220 + control1X: 140; control1Y: 40 + control2X: 210; control2Y: 220 + } + + PathAttribute { name: "scale"; value: 1.2 } + PathAttribute { name: "angle"; value: 0 } + + PathCubic { + x: 850; y: 40 + control2X: 660; control2Y: 40 + control1X: 590; control1Y: 220 + } + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: 45 } + } + + model: ListModel { + id: rssModel + ListElement { lColor: "red" } + ListElement { lColor: "green" } + ListElement { lColor: "yellow" } + ListElement { lColor: "blue" } + ListElement { lColor: "purple" } + ListElement { lColor: "gray" } + ListElement { lColor: "brown" } + ListElement { lColor: "thistle" } + } + + delegate: Component { + id: photoDelegate + Rectangle { + id: wrapper + width: 85; height: 85; color: lColor + scale: wrapper.PathView.scale + + transform: Rotation { + id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2 + axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle + } + } + } +} diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml new file mode 100644 index 0000000..a8c1e91 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml @@ -0,0 +1,58 @@ +import Qt 4.6 + +PathView { + id: photoPathView; model: rssModel; delegate: photoDelegate + y: 100; width: 800; height: 330; pathItemCount: 4; offset: 10 + dragMargin: 24; snapPosition: 50 + + path: Path { + startX: -50; startY: 40; + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: -45 } + + PathCubic { + x: 400; y: 220 + control1X: 140; control1Y: 40 + control2X: 210; control2Y: 220 + } + + PathAttribute { name: "scale"; value: 1.2 } + PathAttribute { name: "angle"; value: 0 } + + PathCubic { + x: 850; y: 40 + control2X: 660; control2Y: 40 + control1X: 590; control1Y: 220 + } + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: 45 } + } + + model: ListModel { + id: rssModel + ListElement { lColor: "red" } + ListElement { lColor: "green" } + ListElement { lColor: "yellow" } + ListElement { lColor: "blue" } + ListElement { lColor: "purple" } + ListElement { lColor: "gray" } + ListElement { lColor: "brown" } + ListElement { lColor: "thistle" } + } + + delegate: Component { + id: photoDelegate + Rectangle { + id: wrapper + width: 85; height: 85; color: lColor + scale: wrapper.PathView.scale + + transform: Rotation { + id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2 + axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle + } + } + } +} diff --git a/tests/auto/declarative/qmlgraphicspathview/qmlgraphicspathview.pro b/tests/auto/declarative/qmlgraphicspathview/qmlgraphicspathview.pro new file mode 100644 index 0000000..142a256 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicspathview/qmlgraphicspathview.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicspathview.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp new file mode 100644 index 0000000..c36b969 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite 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 Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include "../../../shared/util.h" + +class tst_QmlGraphicsPathView : public QObject +{ + Q_OBJECT +public: + tst_QmlGraphicsPathView(); + +private slots: + void initValues(); + void pathview2(); + void pathview3(); +}; + + +tst_QmlGraphicsPathView::tst_QmlGraphicsPathView() +{ +} + +void tst_QmlGraphicsPathView::initValues() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/pathview1.qml")); + QmlGraphicsPathView *obj = qobject_cast(c.create()); + + QVERIFY(obj != 0); + QVERIFY(obj->path() == 0); + QVERIFY(obj->delegate() == 0); + QCOMPARE(obj->model(), QVariant()); + QCOMPARE(obj->currentIndex(), 0); + QCOMPARE(obj->offset(), 0.); + QCOMPARE(obj->snapPosition(), 0.); + QCOMPARE(obj->dragMargin(), 0.); + QCOMPARE(obj->count(), 0); + QCOMPARE(obj->pathItemCount(), -1); +} + +void tst_QmlGraphicsPathView::pathview2() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/pathview2.qml")); + QmlGraphicsPathView *obj = qobject_cast(c.create()); + + QVERIFY(obj != 0); + QVERIFY(obj->path() != 0); + QVERIFY(obj->delegate() != 0); + QVERIFY(obj->model() != QVariant()); + QCOMPARE(obj->currentIndex(), 0); + QCOMPARE(obj->offset(), 0.); + QCOMPARE(obj->snapPosition(), 0.); + QCOMPARE(obj->dragMargin(), 0.); + QCOMPARE(obj->count(), 8); + QCOMPARE(obj->pathItemCount(), 10); +} + +void tst_QmlGraphicsPathView::pathview3() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/pathview3.qml")); + QmlGraphicsPathView *obj = qobject_cast(c.create()); + + QVERIFY(obj != 0); + QVERIFY(obj->path() != 0); + QVERIFY(obj->delegate() != 0); + QVERIFY(obj->model() != QVariant()); + QCOMPARE(obj->currentIndex(), 0); + QCOMPARE(obj->offset(), 50.); // ??? + QCOMPARE(obj->snapPosition(), 0.5); // ??? + QCOMPARE(obj->dragMargin(), 24.); + QCOMPARE(obj->count(), 8); + QCOMPARE(obj->pathItemCount(), 4); +} + +QTEST_MAIN(tst_QmlGraphicsPathView) + +#include "tst_qmlgraphicspathview.moc" -- cgit v0.12 From 66a8b8b7bdb7fb9811cdeccfa7e57c44d8b4fd8c Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 11 Nov 2009 16:51:16 +1000 Subject: forgot this when merging --- .../graphicsitems/qmlgraphicsanimatedimage.cpp | 73 ++++++++++------------ 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp index 2405bde..8c91056 100644 --- a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp @@ -41,20 +41,20 @@ #include #include -#include "qmlgraphicsanimatedimageitem_p.h" -#include "qmlgraphicsanimatedimageitem_p_p.h" +#include "qmlgraphicsanimatedimage_p.h" +#include "qmlgraphicsanimatedimage_p_p.h" #include #include QT_BEGIN_NAMESPACE /*! - \class QmlGraphicsAnimatedImageItem + \class QmlGraphicsAnimatedImage \internal */ /*! - \qmlclass AnimatedImage QFxAnimatedImageItem + \qmlclass AnimatedImage QmlGraphicsAnimatedImage \inherits Image This item provides for playing animations stored as images containing a series of frames, @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE QMovie::supportedFormats(). \table - \row + \row \o \image animatedimageitem.gif \o \qml @@ -76,21 +76,16 @@ Item { \endqml \endtable */ -QML_DEFINE_TYPE(Qt,4,6,AnimatedImage,QmlGraphicsAnimatedImageItem) +QML_DEFINE_TYPE(Qt,4,6,AnimatedImage,QmlGraphicsAnimatedImage) -QmlGraphicsAnimatedImageItem::QmlGraphicsAnimatedImageItem(QmlGraphicsItem *parent) - : QmlGraphicsImage(*(new QmlGraphicsAnimatedImageItemPrivate), parent) +QmlGraphicsAnimatedImage::QmlGraphicsAnimatedImage(QmlGraphicsItem *parent) + : QmlGraphicsImage(*(new QmlGraphicsAnimatedImagePrivate), parent) { } -QmlGraphicsAnimatedImageItem::QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent) - : QmlGraphicsImage(dd, parent) +QmlGraphicsAnimatedImage::~QmlGraphicsAnimatedImage() { -} - -QmlGraphicsAnimatedImageItem::~QmlGraphicsAnimatedImageItem() -{ - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); delete d->_movie; } @@ -100,17 +95,17 @@ QmlGraphicsAnimatedImageItem::~QmlGraphicsAnimatedImageItem() Defaults to false, and can be set to true when you want to pause. */ -bool QmlGraphicsAnimatedImageItem::isPaused() const +bool QmlGraphicsAnimatedImage::isPaused() const { - Q_D(const QmlGraphicsAnimatedImageItem); + Q_D(const QmlGraphicsAnimatedImage); if(!d->_movie) return false; return d->_movie->state()==QMovie::Paused; } -void QmlGraphicsAnimatedImageItem::setPaused(bool pause) +void QmlGraphicsAnimatedImage::setPaused(bool pause) { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); if(pause == d->paused) return; d->paused = pause; @@ -124,17 +119,17 @@ void QmlGraphicsAnimatedImageItem::setPaused(bool pause) Defaults to true, so as to start playing immediately. */ -bool QmlGraphicsAnimatedImageItem::isPlaying() const +bool QmlGraphicsAnimatedImage::isPlaying() const { - Q_D(const QmlGraphicsAnimatedImageItem); + Q_D(const QmlGraphicsAnimatedImage); if (!d->_movie) return false; return d->_movie->state()!=QMovie::NotRunning; } -void QmlGraphicsAnimatedImageItem::setPlaying(bool play) +void QmlGraphicsAnimatedImage::setPlaying(bool play) { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); if(play == d->playing) return; d->playing = play; @@ -154,17 +149,17 @@ void QmlGraphicsAnimatedImageItem::setPlaying(bool play) allow other things to animate at the same time as the image. frameCount is the number of frames in the animation. For some animation formats, frameCount is unknown and set to zero. */ -int QmlGraphicsAnimatedImageItem::currentFrame() const +int QmlGraphicsAnimatedImage::currentFrame() const { - Q_D(const QmlGraphicsAnimatedImageItem); + Q_D(const QmlGraphicsAnimatedImage); if (!d->_movie) return d->preset_currentframe; return d->_movie->currentFrameNumber(); } -void QmlGraphicsAnimatedImageItem::setCurrentFrame(int frame) +void QmlGraphicsAnimatedImage::setCurrentFrame(int frame) { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); if (!d->_movie) { d->preset_currentframe = frame; return; @@ -172,9 +167,9 @@ void QmlGraphicsAnimatedImageItem::setCurrentFrame(int frame) d->_movie->jumpToFrame(frame); } -int QmlGraphicsAnimatedImageItem::frameCount() const +int QmlGraphicsAnimatedImage::frameCount() const { - Q_D(const QmlGraphicsAnimatedImageItem); + Q_D(const QmlGraphicsAnimatedImage); if (!d->_movie) return 0; return d->_movie->frameCount(); @@ -188,9 +183,9 @@ static QString toLocalFileOrQrc(const QUrl& url) return r; } -void QmlGraphicsAnimatedImageItem::setSource(const QUrl &url) +void QmlGraphicsAnimatedImage::setSource(const QUrl &url) { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); if (url == d->url) return; @@ -249,9 +244,9 @@ void QmlGraphicsAnimatedImageItem::setSource(const QUrl &url) emit statusChanged(d->status); } -void QmlGraphicsAnimatedImageItem::movieRequestFinished() +void QmlGraphicsAnimatedImage::movieRequestFinished() { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); d->_movie = new QMovie(d->reply); if (!d->_movie->isValid()){ qWarning() << "Error Reading Animated Image File " << d->url; @@ -275,16 +270,16 @@ void QmlGraphicsAnimatedImageItem::movieRequestFinished() d->setPixmap(d->_movie->currentPixmap()); } -void QmlGraphicsAnimatedImageItem::movieUpdate() +void QmlGraphicsAnimatedImage::movieUpdate() { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); d->setPixmap(d->_movie->currentPixmap()); emit frameChanged(); } -void QmlGraphicsAnimatedImageItem::playingStatusChanged() +void QmlGraphicsAnimatedImage::playingStatusChanged() { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); if((d->_movie->state() != QMovie::NotRunning) != d->playing){ d->playing = (d->_movie->state() != QMovie::NotRunning); emit playingChanged(); @@ -295,9 +290,9 @@ void QmlGraphicsAnimatedImageItem::playingStatusChanged() } } -void QmlGraphicsAnimatedImageItem::componentComplete() +void QmlGraphicsAnimatedImage::componentComplete() { - Q_D(QmlGraphicsAnimatedImageItem); + Q_D(QmlGraphicsAnimatedImage); setCurrentFrame(d->preset_currentframe); d->preset_currentframe = 0; } -- cgit v0.12