diff options
Diffstat (limited to 'src/quick')
21 files changed, 75 insertions, 75 deletions
diff --git a/src/quick/doc/snippets/qml/animatedimage.qml b/src/quick/doc/snippets/qml/animatedimage.qml index d2f778e030..f6e8d027ea 100644 --- a/src/quick/doc/snippets/qml/animatedimage.qml +++ b/src/quick/doc/snippets/qml/animatedimage.qml @@ -49,7 +49,7 @@ Rectangle { AnimatedImage { id: animation; source: "animation.gif" } - Rectangle { + Rectangle { property int frames: animation.frameCount width: 4; height: 8 diff --git a/src/quick/doc/snippets/qml/listview/listview.qml b/src/quick/doc/snippets/qml/listview/listview.qml index 41c7f78fbe..868ba4dfc1 100644 --- a/src/quick/doc/snippets/qml/listview/listview.qml +++ b/src/quick/doc/snippets/qml/listview/listview.qml @@ -141,7 +141,7 @@ ListView { } model: ContactModel {} - delegate: contactsDelegate + delegate: contactsDelegate focus: true } //![isCurrentItem] diff --git a/src/quick/doc/snippets/qml/loader/connections.qml b/src/quick/doc/snippets/qml/loader/connections.qml index cc63fad40d..a433f4a40e 100644 --- a/src/quick/doc/snippets/qml/loader/connections.qml +++ b/src/quick/doc/snippets/qml/loader/connections.qml @@ -49,7 +49,7 @@ Item { source: "MyItem.qml" } - Connections { + Connections { target: myLoader.item onMessage: console.log(msg) } diff --git a/src/quick/doc/snippets/qml/loader/simple.qml b/src/quick/doc/snippets/qml/loader/simple.qml index 4a68a3ce53..e9a1940ac6 100644 --- a/src/quick/doc/snippets/qml/loader/simple.qml +++ b/src/quick/doc/snippets/qml/loader/simple.qml @@ -46,7 +46,7 @@ Item { Loader { id: pageLoader } - MouseArea { + MouseArea { anchors.fill: parent onClicked: pageLoader.source = "Page1.qml" } diff --git a/src/quick/doc/snippets/qml/parentanimation.qml b/src/quick/doc/snippets/qml/parentanimation.qml index c5077ba000..6652030e15 100644 --- a/src/quick/doc/snippets/qml/parentanimation.qml +++ b/src/quick/doc/snippets/qml/parentanimation.qml @@ -43,13 +43,13 @@ import QtQuick 2.0 Item { width: 200; height: 100 - Rectangle { + Rectangle { id: redRect width: 100; height: 100 color: "red" } - Rectangle { + Rectangle { id: blueRect x: redRect.width width: 50; height: 50 diff --git a/src/quick/doc/snippets/qml/parentchange.qml b/src/quick/doc/snippets/qml/parentchange.qml index 777fa225eb..4f1fb2a286 100644 --- a/src/quick/doc/snippets/qml/parentchange.qml +++ b/src/quick/doc/snippets/qml/parentchange.qml @@ -43,13 +43,13 @@ import QtQuick 2.0 Item { width: 200; height: 100 - Rectangle { + Rectangle { id: redRect width: 100; height: 100 color: "red" } - Rectangle { + Rectangle { id: blueRect x: redRect.width width: 50; height: 50 diff --git a/src/quick/doc/snippets/qml/propertyanimation.qml b/src/quick/doc/snippets/qml/propertyanimation.qml index 4d7140d406..db589bbc21 100644 --- a/src/quick/doc/snippets/qml/propertyanimation.qml +++ b/src/quick/doc/snippets/qml/propertyanimation.qml @@ -55,8 +55,8 @@ Rectangle { } //! [single state] - transitions: Transition { - PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } + transitions: Transition { + PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } } } //![transition] diff --git a/src/quick/doc/snippets/qml/propertychanges.qml b/src/quick/doc/snippets/qml/propertychanges.qml index b49b9df2eb..f9f1b807e0 100644 --- a/src/quick/doc/snippets/qml/propertychanges.qml +++ b/src/quick/doc/snippets/qml/propertychanges.qml @@ -53,9 +53,9 @@ Item { width: 100; height: 100 color: "red" - MouseArea { + MouseArea { id: mouseArea - anchors.fill: parent + anchors.fill: parent } states: State { diff --git a/src/quick/doc/snippets/qml/repeaters/repeater.qml b/src/quick/doc/snippets/qml/repeaters/repeater.qml index 704bea6bee..3afc8c67c2 100644 --- a/src/quick/doc/snippets/qml/repeaters/repeater.qml +++ b/src/quick/doc/snippets/qml/repeaters/repeater.qml @@ -48,7 +48,7 @@ Row { Row { Repeater { model: 3 - Rectangle { + Rectangle { width: 100; height: 40 border.width: 1 color: "yellow" @@ -60,7 +60,7 @@ Row { //! [index] Column { Repeater { - model: 10 + model: 10 Text { text: "I'm item " + index } } } @@ -79,7 +79,7 @@ Column { Row { Rectangle { width: 10; height: 20; color: "red" } Repeater { - model: 10 + model: 10 Rectangle { width: 20; height: 20; radius: 10; color: "green" } } Rectangle { width: 10; height: 20; color: "blue" } diff --git a/src/quick/doc/snippets/qml/rotationanimation.qml b/src/quick/doc/snippets/qml/rotationanimation.qml index 3924332f86..677c798ce9 100644 --- a/src/quick/doc/snippets/qml/rotationanimation.qml +++ b/src/quick/doc/snippets/qml/rotationanimation.qml @@ -50,9 +50,9 @@ Item { color: "red" antialiasing: true - states: State { + states: State { name: "rotated" - PropertyChanges { target: rect; rotation: 180 } + PropertyChanges { target: rect; rotation: 180 } } transitions: Transition { diff --git a/src/quick/doc/snippets/qml/row.qml b/src/quick/doc/snippets/qml/row.qml index ad8a21326b..88f24c9140 100644 --- a/src/quick/doc/snippets/qml/row.qml +++ b/src/quick/doc/snippets/qml/row.qml @@ -48,7 +48,7 @@ Rectangle { Row { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - + spacing: 5 Rectangle { width: 100; height: 100; radius: 20.0 diff --git a/src/quick/doc/snippets/qml/state.qml b/src/quick/doc/snippets/qml/state.qml index 03475c49ab..09afde4b6f 100644 --- a/src/quick/doc/snippets/qml/state.qml +++ b/src/quick/doc/snippets/qml/state.qml @@ -45,9 +45,9 @@ Rectangle { width: 100; height: 100 color: "black" - MouseArea { + MouseArea { id: mouseArea - anchors.fill: parent + anchors.fill: parent onClicked: myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked'; } diff --git a/src/quick/doc/snippets/qml/transition-from-to.qml b/src/quick/doc/snippets/qml/transition-from-to.qml index 415ab4f41f..7afc097eef 100644 --- a/src/quick/doc/snippets/qml/transition-from-to.qml +++ b/src/quick/doc/snippets/qml/transition-from-to.qml @@ -52,7 +52,7 @@ Rectangle { PropertyChanges { target: rect; color: "yellow" } } - transitions: Transition { + transitions: Transition { ColorAnimation { duration: 1000 } } } diff --git a/src/quick/doc/snippets/qml/transition-reversible.qml b/src/quick/doc/snippets/qml/transition-reversible.qml index 03848a37fa..1bb5a0bc5b 100644 --- a/src/quick/doc/snippets/qml/transition-reversible.qml +++ b/src/quick/doc/snippets/qml/transition-reversible.qml @@ -54,7 +54,7 @@ Rectangle { } //! [sequential animations] - transitions: Transition { + transitions: Transition { SequentialAnimation { PropertyAnimation { property: "x"; duration: 1000 } ColorAnimation { duration: 1000 } diff --git a/src/quick/doc/snippets/qml/transition.qml b/src/quick/doc/snippets/qml/transition.qml index a4189074fa..421149764c 100644 --- a/src/quick/doc/snippets/qml/transition.qml +++ b/src/quick/doc/snippets/qml/transition.qml @@ -55,8 +55,8 @@ Rectangle { PropertyChanges { target: rect; x: 50; y: 50 } } - transitions: Transition { - NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } + transitions: Transition { + NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } } } //![0] diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp index 450238bd41..16c18d2594 100644 --- a/src/quick/util/qquickimageprovider.cpp +++ b/src/quick/util/qquickimageprovider.cpp @@ -147,8 +147,8 @@ QImage QQuickTextureFactory::image() const Image { source: "image://myimageprovider/image.png" } \endqml - This specifies that the image should be loaded by the image provider named - "myimageprovider", and the image to be loaded is named "image.png". The QML engine + This specifies that the image should be loaded by the image provider named + "myimageprovider", and the image to be loaded is named "image.png". The QML engine invokes the appropriate image provider according to the providers that have been registered through QQmlEngine::addImageProvider(). @@ -173,11 +173,11 @@ QImage QQuickTextureFactory::image() const When these images are loaded by QML, it looks for a matching image provider and calls its requestImage() or requestPixmap() method (depending on its - imageType()) to load the image. The method is called with the \c id + imageType()) to load the image. The method is called with the \c id parameter set to "yellow" for the first image, and "red" for the second. - Here is an image provider implementation that can load the images - requested by the above QML. This implementation dynamically + Here is an image provider implementation that can load the images + requested by the above QML. This implementation dynamically generates QPixmap images that are filled with the requested color: \snippet imageprovider/imageprovider.cpp 0 @@ -188,7 +188,7 @@ QImage QQuickTextureFactory::image() const with a "colors" identifier: \code - int main(int argc, char *argv[]) + int main(int argc, char *argv[]) { ... @@ -203,7 +203,7 @@ QImage QQuickTextureFactory::image() const \image imageprovider.png - A complete example is available in Qt's + A complete example is available in Qt's \l {qml/imageprovider}{examples/quick/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. @@ -214,7 +214,7 @@ QImage QQuickTextureFactory::image() const Image providers that support QImage or Texture loading automatically include support for asychronous loading of images. To enable asynchronous loading for an image source, set the \c asynchronous property to \c true for the relevant - \l Image, \l BorderImage or \l AnimatedImage object. When this is enabled, + \l Image, \l BorderImage or \l AnimatedImage object. When this is enabled, the image request to the provider is run in a low priority thread, allowing image loading to be executed in the background, and reducing the performance impact on the user interface. @@ -285,7 +285,7 @@ QQuickImageProvider::Flags QQuickImageProvider::flags() const } /*! - Implement this method to return the image with \a id. The default + Implement this method to return the image with \a id. The default implementation returns an empty image. The \a id is the requested image source, with the "image:" scheme and diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index af66ef26a4..3bff2bb890 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -234,7 +234,7 @@ class QQuickPixmapData { public: QQuickPixmapData(QQuickPixmap *pixmap, const QUrl &u, const QSize &s, const QString &e) - : refCount(1), inCache(false), pixmapStatus(QQuickPixmap::Error), + : refCount(1), inCache(false), pixmapStatus(QQuickPixmap::Error), url(u), errorString(e), requestSize(s), textureFactory(0), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0), nextUnreferenced(0) { @@ -242,7 +242,7 @@ public: } QQuickPixmapData(QQuickPixmap *pixmap, const QUrl &u, const QSize &r) - : refCount(1), inCache(false), pixmapStatus(QQuickPixmap::Loading), + : refCount(1), inCache(false), pixmapStatus(QQuickPixmap::Loading), url(u), requestSize(r), textureFactory(0), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0), nextUnreferenced(0) { @@ -286,7 +286,7 @@ public: uint refCount; bool inCache:1; - + QQuickPixmap::Status pixmapStatus; QUrl url; QString errorString; @@ -337,7 +337,7 @@ QNetworkAccessManager *QQuickPixmapReader::networkAccessManager() return accessManager; } -static bool readImage(const QUrl& url, QIODevice *dev, QImage *image, QString *errorString, QSize *impsize, +static bool readImage(const QUrl& url, QIODevice *dev, QImage *image, QString *errorString, QSize *impsize, const QSize &requestSize) { QImageReader imgio(dev); @@ -469,17 +469,17 @@ QQuickPixmapReaderThreadObject::QQuickPixmapReaderThreadObject(QQuickPixmapReade { } -void QQuickPixmapReaderThreadObject::processJobs() -{ - QCoreApplication::postEvent(this, new QEvent(QEvent::User)); +void QQuickPixmapReaderThreadObject::processJobs() +{ + QCoreApplication::postEvent(this, new QEvent(QEvent::User)); } -bool QQuickPixmapReaderThreadObject::event(QEvent *e) +bool QQuickPixmapReaderThreadObject::event(QEvent *e) { - if (e->type() == QEvent::User) { - reader->processJobs(); - return true; - } else { + if (e->type() == QEvent::User) { + reader->processJobs(); + return true; + } else { return QObject::event(e); } } @@ -495,7 +495,7 @@ void QQuickPixmapReader::processJobs() QMutexLocker locker(&mutex); while (true) { - if (cancelled.isEmpty() && (jobs.isEmpty() || replies.count() >= IMAGEREQUEST_MAX_REQUEST_COUNT)) + if (cancelled.isEmpty() && (jobs.isEmpty() || replies.count() >= IMAGEREQUEST_MAX_REQUEST_COUNT)) return; // Nothing else to do // Clean cancelled jobs @@ -529,7 +529,7 @@ void QQuickPixmapReader::processJobs() } } -void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &url, +void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &url, const QSize &requestSize) { // fetch @@ -649,7 +649,7 @@ QQuickPixmapReply *QQuickPixmapReader::getImage(QQuickPixmapData *data) QQuickPixmapReply *reply = new QQuickPixmapReply(data); reply->engineForReader = engine; jobs.append(reply); - // XXX + // XXX if (threadObject) threadObject->processJobs(); mutex.unlock(); return reply; @@ -661,7 +661,7 @@ void QQuickPixmapReader::cancel(QQuickPixmapReply *reply) if (reply->loading) { cancelled.append(reply); reply->data = 0; - // XXX + // XXX if (threadObject) threadObject->processJobs(); } else { jobs.removeAll(reply); @@ -816,7 +816,7 @@ void QQuickPixmapStore::referencePixmap(QQuickPixmapData *data) Q_ASSERT(data->prevUnreferencedPtr); *data->prevUnreferencedPtr = data->nextUnreferenced; - if (data->nextUnreferenced) { + if (data->nextUnreferenced) { data->nextUnreferenced->prevUnreferencedPtr = data->prevUnreferencedPtr; data->nextUnreferenced->prevUnreferenced = data->prevUnreferenced; } @@ -927,7 +927,7 @@ void QQuickPixmapData::addref() { ++refCount; Q_QML_PROFILE(pixmapCountChanged<QQmlProfilerService::PixmapReferenceCountChanged>(url, refCount)); - if (prevUnreferencedPtr) + if (prevUnreferencedPtr) pixmapStore()->referencePixmap(this); } @@ -1029,7 +1029,7 @@ static QQuickPixmapData* createPixmapDataSync(QQuickPixmap *declarativePixmap, Q } QString localFile = QQmlFile::urlToLocalFileOrQrc(url); - if (localFile.isEmpty()) + if (localFile.isEmpty()) return 0; QFile f(localFile); @@ -1130,7 +1130,7 @@ const QUrl &QQuickPixmap::url() const const QSize &QQuickPixmap::implicitSize() const { - if (d) + if (d) return d->implicitSize; else return nullPixmap()->size; @@ -1252,7 +1252,7 @@ void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &reques Q_QML_PROFILE(pixmapStateChanged<QQmlProfilerService::PixmapLoadingError>(url)); return; } - } + } if (!engine) return; @@ -1283,7 +1283,7 @@ void QQuickPixmap::clear() void QQuickPixmap::clear(QObject *obj) { if (d) { - if (d->reply) + if (d->reply) QObject::disconnect(d->reply, 0, obj, 0); d->declarativePixmaps.remove(this); d->release(); diff --git a/src/quick/util/qquickstate_p_p.h b/src/quick/util/qquickstate_p_p.h index c559c8163c..82e456ed65 100644 --- a/src/quick/util/qquickstate_p_p.h +++ b/src/quick/util/qquickstate_p_p.h @@ -215,7 +215,7 @@ public: struct OperationGuard : public QQmlGuard<QQuickStateOperation> { - OperationGuard(QObject *obj, QList<OperationGuard> *l) : list(l) { + OperationGuard(QObject *obj, QList<OperationGuard> *l) : list(l) { setObject(static_cast<QQuickStateOperation *>(obj)); } QList<OperationGuard> *list; diff --git a/src/quick/util/qquicktimeline.cpp b/src/quick/util/qquicktimeline.cpp index d8cf9bd877..5305537d24 100644 --- a/src/quick/util/qquicktimeline.cpp +++ b/src/quick/util/qquicktimeline.cpp @@ -81,7 +81,7 @@ struct QQuickTimeLinePrivate Execute }; Op() {} - Op(Type t, int l, qreal v, qreal v2, int o, + Op(Type t, int l, qreal v, qreal v2, int o, const QQuickTimeLineCallback &ev = QQuickTimeLineCallback(), const QEasingCurve &es = QEasingCurve()) : type(t), length(l), value(v), value2(v2), order(o), event(ev), easing(es) {} @@ -89,8 +89,8 @@ struct QQuickTimeLinePrivate : type(o.type), length(o.length), value(o.value), value2(o.value2), order(o.order), event(o.event), easing(o.easing) {} Op &operator=(const Op &o) { - type = o.type; length = o.length; value = o.value; - value2 = o.value2; order = o.order; event = o.event; + type = o.type; length = o.length; value = o.value; + value2 = o.value2; order = o.order; event = o.event; easing = o.easing; return *this; } @@ -604,8 +604,8 @@ void QQuickTimeLine::sync(QQuickTimeLineValue &timeLineValue) d->syncPoint = d->length; }*/ -/*! - \internal +/*! + \internal Temporary hack. */ @@ -614,9 +614,9 @@ void QQuickTimeLine::setSyncPoint(int sp) d->syncPoint = sp; } -/*! - \internal - +/*! + \internal + Temporary hack. */ int QQuickTimeLine::syncPoint() const @@ -739,7 +739,7 @@ int QQuickTimeLinePrivate::advance(int t) TimeLine &tl = *iter; Op &op = tl.ops.first(); int length = op.length - tl.consumedOpLength; - + if (length < advanceTime) { advanceTime = length; if (advanceTime == 0) @@ -748,7 +748,7 @@ int QQuickTimeLinePrivate::advance(int t) } t -= advanceTime; - // Process until then. A zero length advance time will only process + // Process until then. A zero length advance time will only process // sets. QList<QPair<int, Update> > updates; @@ -762,8 +762,8 @@ int QQuickTimeLinePrivate::advance(int t) if (advanceTime == 0 && op.length != 0) continue; - if (tl.consumedOpLength == 0 && - op.type != Op::Pause && + if (tl.consumedOpLength == 0 && + op.type != Op::Pause && op.type != Op::Execute) tl.base = v->value(); diff --git a/src/quick/util/qquicktransitionmanager.cpp b/src/quick/util/qquicktransitionmanager.cpp index 769dadc4fc..2821d7628c 100644 --- a/src/quick/util/qquicktransitionmanager.cpp +++ b/src/quick/util/qquicktransitionmanager.cpp @@ -89,7 +89,7 @@ bool QQuickTransitionManager::isRunning() const return d->transitionInstance && d->transitionInstance->isRunning(); } -void QQuickTransitionManager::complete() +void QQuickTransitionManager::complete() { d->applyBindings(); @@ -100,7 +100,7 @@ void QQuickTransitionManager::complete() d->completeList.clear(); - if (d->state) + if (d->state) static_cast<QQuickStatePrivate*>(QObjectPrivate::get(d->state))->complete(); finished(); @@ -228,8 +228,8 @@ void QQuickTransitionManager::transition(const QList<QQuickStateAction> &list, } else { if (touched.contains(action.property)) { - if (action.toValue != action.fromValue) - d->completeList << + if (action.toValue != action.fromValue) + d->completeList << QQuickSimpleAction(action, QQuickSimpleAction::EndState); applyList.removeAt(ii); @@ -242,7 +242,7 @@ void QQuickTransitionManager::transition(const QList<QQuickStateAction> &list, // Any actions remaining have not been handled by the transition and should // be applied immediately. We skip applying bindings, as they are all - // applied at the end in applyBindings() to avoid any nastiness mid + // applied at the end in applyBindings() to avoid any nastiness mid // transition foreach(const QQuickStateAction &action, applyList) { if (action.event && !action.event->changesBindings()) { @@ -261,7 +261,7 @@ void QQuickTransitionManager::transition(const QList<QQuickStateAction> &list, qWarning() << " No transition for event:" << action.event->type(); else qWarning() << " No transition for:" << action.property.object() - << action.property.name() << "From:" << action.fromValue + << action.property.name() << "From:" << action.fromValue << "To:" << action.toValue; } } diff --git a/src/quick/util/qquicktransitionmanager_p_p.h b/src/quick/util/qquicktransitionmanager_p_p.h index 6211b5488c..bf203feaf4 100644 --- a/src/quick/util/qquicktransitionmanager_p_p.h +++ b/src/quick/util/qquicktransitionmanager_p_p.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE class QQuickStatePrivate; class QQuickTransitionManagerPrivate; -class Q_AUTOTEST_EXPORT QQuickTransitionManager +class Q_AUTOTEST_EXPORT QQuickTransitionManager { public: QQuickTransitionManager(); |