diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-24 10:30:20 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-24 10:30:20 +0100 |
commit | d588ec795bf905d6d4a4827ad74f3d01315e40bf (patch) | |
tree | 67227f80379d77962602b758093251b593ee0c08 | |
parent | 13e88fe2b9b1680cb161a249289c3ba998f08c0c (diff) | |
parent | fdc18a5f25ba1c4cf35e1fa6f21272167bde36a9 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/quick/items/qquickrectangle.cpp
Change-Id: Ia40bc0f2f08b5be68e32eb1e1f118445d20e44fc
44 files changed, 175 insertions, 118 deletions
diff --git a/examples/quick/dialogs/systemdialogs/FileDialogs.qml b/examples/quick/dialogs/systemdialogs/FileDialogs.qml index bfc160fa45..d6ee1a13ca 100644 --- a/examples/quick/dialogs/systemdialogs/FileDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/FileDialogs.qml @@ -173,7 +173,7 @@ Rectangle { text: "go to /tmp" anchors.verticalCenter: parent.verticalCenter // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet. - onClicked: fileDialog.folder = "/tmp" // file:///tmp would also be OK + onClicked: fileDialog.folder = (Qt.platform.os === "windows" ? "/c:/temp" : "/tmp") } } } diff --git a/examples/quick/text/imgtag/imgtag.qml b/examples/quick/text/imgtag/imgtag.qml index 892933cab0..8cb85ba86d 100644 --- a/examples/quick/text/imgtag/imgtag.qml +++ b/examples/quick/text/imgtag/imgtag.qml @@ -78,10 +78,10 @@ Rectangle { text: "Some hearts<img src=\"images/heart200.png\" width=\"20\" height=\"20\" align=\"bottom\"><img src=\"images/heart200.png\" width=\"30\" height=\"30\" align=\"bottom\"> <img src=\"images/heart200.png\" width=\"40\" height=\"40\"><img src=\"images/heart200.png\" width=\"50\" height=\"50\" align=\"bottom\">with different sizes." } TextWithImage { - text: "Resized image<img width=\"80\" height=\"76\" align=\"middle\" src=\"http://files.app4mobile.com/wp-content/uploads/2011/08/nokia-n9-price-specification-features-us-europe-india.jpg\">from the internet." + text: "Resized image<img width=\"48\" height=\"48\" align=\"middle\" src=\"http://qt-project.org/images/qt13a/Qt-logo.png\">from the internet." } TextWithImage { - text: "Image<img align=\"middle\" src=\"http://qt.gitorious.org/images/sites/qt/logo.png\">from the internet." + text: "Image<img align=\"middle\" src=\"http://qt-project.org/images/qt13a/Qt-logo.png\">from the internet." } TextWithImage { height: 120 diff --git a/examples/quick/window/ScreenInfo.qml b/examples/quick/window/ScreenInfo.qml index e422a51a71..73700720d8 100644 --- a/examples/quick/window/ScreenInfo.qml +++ b/examples/quick/window/ScreenInfo.qml @@ -80,10 +80,10 @@ Item { Text { text: Screen.width + "x" + Screen.height } Text { text: "pixel density" } - Text { text: Screen.pixelDensity.toFixed(2) + " dots/mm" } + Text { text: Screen.pixelDensity.toFixed(2) + " dots/mm (" + (Screen.pixelDensity * 25.4).toFixed(2) + " dots/inch)" } Text { text: "logical pixel density" } - Text { text: Screen.logicalPixelDensity.toFixed(2) + " dots/mm" } + Text { text: Screen.logicalPixelDensity.toFixed(2) + " dots/mm (" + (Screen.logicalPixelDensity * 25.4).toFixed(2) + " dots/inch)" } Text { text: "available virtual desktop" } Text { text: Screen.desktopAvailableWidth + "x" + Screen.desktopAvailableHeight } diff --git a/examples/quick/window/window.qml b/examples/quick/window/window.qml index 00daec7ff1..7bb2ce6cac 100644 --- a/examples/quick/window/window.qml +++ b/examples/quick/window/window.qml @@ -47,7 +47,7 @@ QtObject { property SystemPalette palette: SystemPalette { } property var controlWindow: Window { - width: 400 + width: visibilityLabel.implicitWidth * 1.2 height: col.implicitHeight + defaultSpacing * 2 color: palette.window title: "Control Window" @@ -122,6 +122,7 @@ QtObject { return "unknown"; } Text { + id: visibilityLabel text: "second window is " + (testWindow.visible ? "visible" : "invisible") + " and has visibility " + parent.visibilityToString(testWindow.visibility) } diff --git a/src/3rdparty/masm/wtf/MathExtras.h b/src/3rdparty/masm/wtf/MathExtras.h index 600a9c7148..5b12157148 100644 --- a/src/3rdparty/masm/wtf/MathExtras.h +++ b/src/3rdparty/masm/wtf/MathExtras.h @@ -267,7 +267,7 @@ template<typename T> inline T clampTo(double value, T min = defaultMinimumForCla return min; return static_cast<T>(value); } -template<> inline long long int clampTo(double, long long int, long long int); // clampTo does not support long long ints. +template<> long long int clampTo(double, long long int, long long int); // clampTo does not support long long ints. inline int clampToInteger(double value) { diff --git a/src/imports/dialogs/qquickabstractdialog.cpp b/src/imports/dialogs/qquickabstractdialog.cpp index 633e5b7269..9bb2388741 100644 --- a/src/imports/dialogs/qquickabstractdialog.cpp +++ b/src/imports/dialogs/qquickabstractdialog.cpp @@ -62,7 +62,9 @@ QQuickAbstractDialog::QQuickAbstractDialog(QObject *parent) , m_contentItem(0) , m_windowDecoration(0) , m_hasNativeWindows(QGuiApplicationPrivate::platformIntegration()-> - hasCapability(QPlatformIntegration::MultipleWindows)) + hasCapability(QPlatformIntegration::MultipleWindows) && + QGuiApplicationPrivate::platformIntegration()-> + hasCapability(QPlatformIntegration::WindowManagement)) , m_hasAspiredPosition(false) { } diff --git a/src/particles/particles.pro b/src/particles/particles.pro index 71be71ae25..ba65ee3002 100644 --- a/src/particles/particles.pro +++ b/src/particles/particles.pro @@ -10,27 +10,10 @@ solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 exists("qqml_enable_gcov") { QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors - LIBS += -lgcov + LIBS_PRIVATE += -lgcov } MODULE = quickparticles load(qt_module) include(particles.pri) - -mac { - # FIXME: this is a workaround for broken qmake logic in qtAddModule() - # This function refuses to use frameworks unless the framework exists on - # the filesystem at the time qmake is run, resulting in a build failure - # if QtQuick is qmaked before QtQml is built and frameworks are - # in use. qtAddLibrary() contains correct logic to deal with this, so - # we'll explicitly call that for now. - load(qt) - LIBS -= -lQtQml # in non-framework builds, these should be re-added - LIBS -= -lQtQml_debug # within the qtAddLibrary if appropriate, so no - qtAddLibrary(QtQml) # harm done :) - LIBS -= -lQtQuick - LIBS -= -lQtQuick_debug - qtAddLibrary(QtQuick) -} - diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index b3eb6835df..eccdfff623 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -2330,7 +2330,7 @@ void splitCriticalEdges(Function *f) // (see for example section 4 (Lifetime Analysis) of [Wimmer1]). This algorithm makes sure that the // blocks of a group are scheduled together, with no non-loop blocks in between. This applies // recursively for nested loops. It also schedules groups of if-then-else-endif blocks together for -// the smae reason. +// the same reason. class BlockScheduler { Function *function; @@ -2357,15 +2357,15 @@ class BlockScheduler if (emitted.alreadyProcessed(in)) continue; - // this is a loop, where there in -> candidate edge is the jump back to the top of the loop. if (dominatorTree.dominates(candidate, in)) + // this is a loop, where there in -> candidate edge is the jump back to the top of the loop. continue; return false; // an incoming edge that is not yet emitted, and is not a back-edge } - // postpone everything, and schedule the loop first. if (candidate->isGroupStart()) { + // postpone everything, and schedule the loop first. postponedGroups.push(currentGroup); currentGroup = WorkForGroup(candidate); } @@ -2389,6 +2389,7 @@ class BlockScheduler return next; } + Q_UNREACHABLE(); return 0; } @@ -3476,11 +3477,11 @@ void Optimizer::run(QQmlEnginePrivate *qmlEngine) // block scheduling, so remove those now. // qout << "Cleaning up unreachable basic blocks..." << endl; cleanupBasicBlocks(function, false); - showMeTheCode(function); +// showMeTheCode(function); // qout << "Doing block scheduling..." << endl; startEndLoops = BlockScheduler(function, df).go(); - showMeTheCode(function); +// showMeTheCode(function); #ifndef QT_NO_DEBUG checkCriticalEdges(function->basicBlocks); @@ -3750,3 +3751,10 @@ MoveMapping::Action MoveMapping::schedule(const Move &m, QList<Move> &todo, QLis // References: // [Wimmer1] C. Wimmer and M. Franz. Linear Scan Register Allocation on SSA Form. In Proceedings of // CGO’10, ACM Press, 2010 +// [Wimmer2] C. Wimmer and H. Mossenbock. Optimized Interval Splitting in a Linear Scan Register +// Allocator. In Proceedings of the ACM/USENIX International Conference on Virtual +// Execution Environments, pages 132–141. ACM Press, 2005. +// [Briggs] P. Briggs, K.D. Cooper, T.J. Harvey, and L.T. Simpson. Practical Improvements to the +// Construction and Destruction of Static Single Assignment Form. +// [Appel] A.W. Appel. Modern Compiler Implementation in Java. Second edition, Cambridge +// University Press. diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index dc8c0da321..539bc5ddd6 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -76,6 +76,7 @@ #if USE(PTHREADS) # include <pthread.h> +# include <sys/resource.h> #endif QT_BEGIN_NAMESPACE @@ -113,6 +114,15 @@ quintptr getStackLimit() pthread_attr_getstack(&attr, &stackBottom, &stackSize); pthread_attr_destroy(&attr); +# if defined(Q_OS_ANDROID) + // Bionic pretends that the main thread has a tiny stack; work around it + if (gettid() == getpid()) { + rlimit limit; + getrlimit(RLIMIT_STACK, &limit); + stackBottom = reinterpret_cast<void*>(reinterpret_cast<quintptr>(stackBottom) + stackSize - limit.rlim_cur); + } +# endif + stackLimit = reinterpret_cast<quintptr>(stackBottom); # endif // This is wrong. StackLimit is the currently committed stack size, not the real end. diff --git a/src/qml/qml.pro b/src/qml/qml.pro index b0ea93e9fb..d060b2d8c8 100644 --- a/src/qml/qml.pro +++ b/src/qml/qml.pro @@ -13,7 +13,7 @@ MODULE_PLUGIN_TYPES = \ exists("qqml_enable_gcov") { QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors - LIBS += -lgcov + LIBS_PRIVATE += -lgcov } QMAKE_DOCS = $$PWD/doc/qtqml.qdocconf diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp index 3accb9dce5..1ea3f25405 100644 --- a/src/qml/qml/ftw/qqmlthread.cpp +++ b/src/qml/qml/ftw/qqmlthread.cpp @@ -179,15 +179,17 @@ void QQmlThreadPrivate::threadEvent() { lock(); - if (m_shutdown) { - quit(); - wakeOne(); - unlock(); - q->shutdownThread(); - } else { - m_threadProcessing = true; + for (;;) { + if (m_shutdown) { + quit(); + wakeOne(); + unlock(); + q->shutdownThread(); + + return; + } else if (!threadList.isEmpty()) { + m_threadProcessing = true; - while (!threadList.isEmpty()) { QQmlThread::Message *message = threadList.first(); unlock(); @@ -197,13 +199,15 @@ void QQmlThreadPrivate::threadEvent() lock(); delete threadList.takeFirst(); - } + } else { + wakeOne(); - wakeOne(); + m_threadProcessing = false; - m_threadProcessing = false; + unlock(); - unlock(); + return; + } } } @@ -228,8 +232,11 @@ void QQmlThread::shutdown() d->lock(); Q_ASSERT(!d->m_shutdown); d->m_shutdown = true; - if (d->threadList.isEmpty() && d->m_threadProcessing == false) + if (d->threadList.isEmpty() && d->m_threadProcessing == false) { d->triggerThreadEvent(); + } else if (d->mainSync) { + d->wakeOne(); + } d->wait(); d->unlock(); d->QThread::wait(); @@ -333,8 +340,14 @@ void QQmlThread::internalCallMethodInMain(Message *message) d->triggerMainEvent(); } - while (d->mainSync && !d->m_shutdown) + while (d->mainSync) { + if (d->m_shutdown) { + delete d->mainSync; + d->mainSync = 0; + break; + } d->wait(); + } d->unlock(); } diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index d6d3de8af3..7e441023c9 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -1508,11 +1508,11 @@ QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instru Here is an example that uses WorkerScript to periodically append the current time to a list model: - \snippet quick/threading/threadedlistmodel/timedisplay.qml 0 + \snippet ../quick/threading/threadedlistmodel/timedisplay.qml 0 The included file, \tt dataloader.js, looks like this: - \snippet quick/threading/threadedlistmodel/dataloader.js 0 + \snippet ../quick/threading/threadedlistmodel/dataloader.js 0 The timer in the main example sends messages to the worker script by calling \l WorkerScript::sendMessage(). When this message is received, diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro index 952ef24922..4b4c06b27e 100644 --- a/src/qmltest/qmltest.pro +++ b/src/qmltest/qmltest.pro @@ -4,6 +4,10 @@ DEFINES += QT_NO_URL_CAST_FROM_STRING QT = core QT_PRIVATE = testlib-private quick qml-private gui core-private +# Testlib is only a private dependency, which results in our users not +# inheriting CONFIG+=console transitively. Make it explicit. +MODULE_CONFIG = console + !contains(QT_CONFIG, no-widgets) { QT += widgets DEFINES += QT_QMLTEST_WITH_WIDGETS diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index cf40fbe37c..0155ee4e2d 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -246,8 +246,8 @@ QML Lists and Models The \l{Qt QML Models QML Types}{Qt QML Models} submodule provides the types for structuring data with models and lists. \list -\li \l ListModel - Defines a list of data -\li \l ListElement - Defines a data item in a \l ListModel +\li \l{ListModel} - Defines a list of data +\li \l{ListElement} - Defines a data item in a \l{ListModel} \endlist These QML types are part of Qt Quick for backwards compatibility, but for diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp index 0bed5e96a2..8ecf473d85 100644 --- a/src/quick/items/qquickborderimage.cpp +++ b/src/quick/items/qquickborderimage.cpp @@ -350,6 +350,7 @@ void QQuickBorderImage::load() } /*! + \qmlpropertygroup QtQuick::BorderImage::border \qmlproperty int QtQuick::BorderImage::border.left \qmlproperty int QtQuick::BorderImage::border.right \qmlproperty int QtQuick::BorderImage::border.top diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index ea130968ca..ed9d1838b8 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -507,24 +507,23 @@ void QQuickDragAttached::setProposedAction(Qt::DropAction action) } /*! - \qmlattachedproperty enumeration QtQuick::Drag::dragType - \since 5.2 - - This property indicates whether to automatically start drags, do nothing, or - to use backwards compatible internal drags. The default is to use backwards - compatible internal drags. + \qmlattachedproperty enumeration QtQuick::Drag::dragType + \since 5.2 - A drag can also be started manually using \l startDrag. + This property indicates whether to automatically start drags, do nothing, or + to use backwards compatible internal drags. The default is to use backwards + compatible internal drags. - \list - \li Drag.None - do not start drags automatically - \li Drag.Automatic - start drags automatically - \li Drag.Internal (default) - start backwards compatible drags automatically - \endlist + A drag can also be started manually using \l startDrag. - When using \l Drag.Automatic you should also define \l mimeData and bind the - \active property to the active property of \l MouseArea.drag. + \list + \li Drag.None - do not start drags automatically + \li Drag.Automatic - start drags automatically + \li Drag.Internal (default) - start backwards compatible drags automatically + \endlist + When using \l Drag.Automatic you should also define \l mimeData and bind the + \active property to the active property of \l MouseArea.drag. */ QQuickDrag::DragType QQuickDragAttached::dragType() const @@ -622,7 +621,6 @@ void QQuickDragAttached::start(QQmlV4Function *args) \li Qt.LinkAction Create a link from the source to the target. \li Qt.IgnoreAction Ignore the action (do nothing with the data). \endlist - */ int QQuickDragAttached::drop() @@ -696,17 +694,17 @@ void QQuickDragAttached::cancel() } /*! - \qmlsignal QtQuick::DropArea::onDragStarted() + \qmlattachedsignal QtQuick::Drag::onDragStarted() - This handler is called when a drag is started with the \l startDrag method - or when it is started automatically using the \l dragType property. + This handler is called when a drag is started with the \l startDrag method + or when it is started automatically using the \l dragType property. */ /*! - \qmlsignal QtQuick::DropArea::onDragFinished(DropAction action) + \qmlattachedsignal QtQuick::Drag::onDragFinished(DropAction action) - This handler is called when a drag finishes and the drag was started with the - \l startDrag method or started automatically using the \l dragType property. + This handler is called when a drag finishes and the drag was started with the + \l startDrag method or started automatically using the \l dragType property. */ Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedActions) diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp index 405e8f8c90..01166ab121 100644 --- a/src/quick/items/qquickdroparea.cpp +++ b/src/quick/items/qquickdroparea.cpp @@ -193,6 +193,7 @@ QObject *QQuickDropAreaDrag::source() const } /*! + \qmlpropertygroup QtQuick::DropArea::drag \qmlproperty qreal QtQuick::DropArea::drag.x \qmlproperty qreal QtQuick::DropArea::drag.y diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index fa18d4aa30..3b592004c9 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -646,6 +646,7 @@ is finished. */ /*! + \qmlpropertygroup QtQuick::Flickable::visibleArea \qmlproperty real QtQuick::Flickable::visibleArea.xPosition \qmlproperty real QtQuick::Flickable::visibleArea.widthRatio \qmlproperty real QtQuick::Flickable::visibleArea.yPosition diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index d6dd7cb61a..8c94b9dd5b 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -3052,6 +3052,7 @@ void QQuickItemPrivate::_q_resourceObjectDeleted(QObject *object) } /*! + \qmlpropertygroup QtQuick::Item::anchors \qmlproperty AnchorLine QtQuick::Item::anchors.top \qmlproperty AnchorLine QtQuick::Item::anchors.bottom \qmlproperty AnchorLine QtQuick::Item::anchors.left @@ -3175,6 +3176,7 @@ QQmlListProperty<QObject> QQuickItemPrivate::data() } /*! + \qmlpropertygroup QtQuick::Item::childrenRect \qmlproperty real QtQuick::Item::childrenRect.x \qmlproperty real QtQuick::Item::childrenRect.y \qmlproperty real QtQuick::Item::childrenRect.width diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp index b840ee421c..1d1ea97925 100644 --- a/src/quick/items/qquickitemanimation.cpp +++ b/src/quick/items/qquickitemanimation.cpp @@ -486,6 +486,7 @@ void QQuickAnchorAnimation::setDuration(int duration) } /*! + \qmlpropertygroup QtQuick::AnchorAnimation::easing \qmlproperty enumeration QtQuick::AnchorAnimation::easing.type \qmlproperty real QtQuick::AnchorAnimation::easing.amplitude \qmlproperty real QtQuick::AnchorAnimation::easing.overshoot @@ -622,6 +623,7 @@ void QQuickPathAnimation::setDuration(int duration) } /*! + \qmlpropertygroup QtQuick::PathAnimation::easing \qmlproperty enumeration QtQuick::PathAnimation::easing.type \qmlproperty real QtQuick::PathAnimation::easing.amplitude \qmlproperty list<real> QtQuick::PathAnimation::easing.bezierCurve diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 6d4c2e7877..f5c0e3b8d2 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -2101,7 +2101,7 @@ void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQmlChangeSet::Re { if (removeResult->visiblePos.isValid()) { if (item->position() < removeResult->visiblePos) - removeResult->sizeChangesBeforeVisiblePos += item->size(); + updateSizeChangesBeforeVisiblePos(item, removeResult); else removeResult->sizeChangesAfterVisiblePos += item->size(); } @@ -2116,6 +2116,11 @@ void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQmlChangeSet::Re removeResult->changedFirstItem = true; } +void QQuickItemViewPrivate::updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult) +{ + removeResult->sizeChangesBeforeVisiblePos += item->size(); +} + void QQuickItemViewPrivate::repositionFirstItem(FxViewItem *prevVisibleItemsFirst, qreal prevVisibleItemsFirstPos, FxViewItem *prevFirstVisible, diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index bb1b7927c2..af7c23c02e 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -211,6 +211,7 @@ public: bool applyModelChanges(ChangeResult *insertionResult, ChangeResult *removalResult); bool applyRemovalChange(const QQmlChangeSet::Remove &removal, ChangeResult *changeResult, int *removedCount); void removeItem(FxViewItem *item, const QQmlChangeSet::Remove &removal, ChangeResult *removeResult); + virtual void updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult); void repositionFirstItem(FxViewItem *prevVisibleItemsFirst, qreal prevVisibleItemsFirstPos, FxViewItem *prevFirstVisible, ChangeResult *insertionResult, ChangeResult *removalResult); diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 6324d7960a..94222693b5 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -98,6 +98,7 @@ public: virtual void repositionPackageItemAt(QQuickItem *item, int index); virtual void resetFirstItemPosition(qreal pos = 0.0); virtual void adjustFirstItem(qreal forwards, qreal backwards, int); + virtual void updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult); virtual void createHighlight(); virtual void updateHighlight(); @@ -846,6 +847,12 @@ void QQuickListViewPrivate::adjustFirstItem(qreal forwards, qreal backwards, int static_cast<FxListItemSG*>(visibleItems.first())->setPosition(visibleItems.first()->position() + diff); } +void QQuickListViewPrivate::updateSizeChangesBeforeVisiblePos(FxViewItem *item, ChangeResult *removeResult) +{ + if (item != visibleItems.first()) + QQuickItemViewPrivate::updateSizeChangesBeforeVisiblePos(item, removeResult); +} + void QQuickListViewPrivate::createHighlight() { Q_Q(QQuickListView); @@ -2167,6 +2174,7 @@ void QQuickListView::setOrientation(QQuickListView::Orientation orientation) */ /*! + \qmlpropertygroup QtQuick::ListView::section \qmlproperty string QtQuick::ListView::section.property \qmlproperty enumeration QtQuick::ListView::section.criteria \qmlproperty Component QtQuick::ListView::section.delegate diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index 438ec29fd0..f07571d3cc 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -1183,6 +1183,7 @@ void QQuickMouseArea::setCursorShape(Qt::CursorShape shape) #endif /*! + \qmlpropertygroup QtQuick::MouseArea::drag \qmlproperty Item QtQuick::MouseArea::drag.target \qmlproperty bool QtQuick::MouseArea::drag.active \qmlproperty enumeration QtQuick::MouseArea::drag.axis diff --git a/src/quick/items/qquickpincharea.cpp b/src/quick/items/qquickpincharea.cpp index eadf82f888..419792aaa5 100644 --- a/src/quick/items/qquickpincharea.cpp +++ b/src/quick/items/qquickpincharea.cpp @@ -221,6 +221,7 @@ QQuickPinchAreaPrivate::~QQuickPinchAreaPrivate() /*! + \qmlpropertygroup QtQuick::PinchArea::pinch \qmlproperty Item QtQuick::PinchArea::pinch.target \qmlproperty bool QtQuick::PinchArea::pinch.active \qmlproperty real QtQuick::PinchArea::pinch.minimumScale diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp index d6323026e7..ee1b66f2b5 100644 --- a/src/quick/items/qquickrectangle.cpp +++ b/src/quick/items/qquickrectangle.cpp @@ -331,6 +331,7 @@ void QQuickRectangle::doUpdate() */ /*! + \qmlpropertygroup QtQuick::Rectangle::border \qmlproperty int QtQuick::Rectangle::border.width \qmlproperty color QtQuick::Rectangle::border.color diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index 00c2103289..a05b4f38ff 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -954,6 +954,7 @@ void QQuickAnchorChanges::setObject(QQuickItem *target) } /*! + \qmlpropertygroup QtQuick::AnchorChanges::anchors \qmlproperty AnchorLine QtQuick::AnchorChanges::anchors.left \qmlproperty AnchorLine QtQuick::AnchorChanges::anchors.right \qmlproperty AnchorLine QtQuick::AnchorChanges::anchors.horizontalCenter diff --git a/src/quick/items/qquicktranslate.cpp b/src/quick/items/qquicktranslate.cpp index 93104ffa7a..f1b716cf5b 100644 --- a/src/quick/items/qquicktranslate.cpp +++ b/src/quick/items/qquicktranslate.cpp @@ -198,6 +198,7 @@ QQuickScale::~QQuickScale() } /*! + \qmlpropertygroup QtQuick::Scale::origin \qmlproperty real QtQuick::Scale::origin.x \qmlproperty real QtQuick::Scale::origin.y @@ -347,6 +348,7 @@ QQuickRotation::~QQuickRotation() } /*! + \qmlpropertygroup QtQuick::Rotation::origin \qmlproperty real QtQuick::Rotation::origin.x \qmlproperty real QtQuick::Rotation::origin.y @@ -391,6 +393,7 @@ void QQuickRotation::setAngle(qreal angle) } /*! + \qmlpropertygroup QtQuick::Rotation::axis \qmlproperty real QtQuick::Rotation::axis.x \qmlproperty real QtQuick::Rotation::axis.y \qmlproperty real QtQuick::Rotation::axis.z diff --git a/src/quick/quick.pro b/src/quick/quick.pro index 7c540591ab..5168ec2c24 100644 --- a/src/quick/quick.pro +++ b/src/quick/quick.pro @@ -9,7 +9,7 @@ solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 exists("qqml_enable_gcov") { QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors - LIBS += -lgcov + LIBS_PRIVATE += -lgcov } QMAKE_DOCS = $$PWD/doc/qtquick.qdocconf @@ -40,17 +40,3 @@ SOURCES += qtquick2.cpp # To make #include "qquickcontext2d_jsclass.cpp" work INCLUDEPATH += $$PWD - -mac { - # FIXME: this is a workaround for broken qmake logic in qtAddModule() - # This function refuses to use frameworks unless the framework exists on - # the filesystem at the time qmake is run, resulting in a build failure - # if QtQuick is qmaked before QtQml is built and frameworks are - # in use. qtAddLibrary() contains correct logic to deal with this, so - # we'll explicitly call that for now. - load(qt) - LIBS -= -lQtQml # in non-framework builds, these should be re-added - LIBS -= -lQtQml_debug # within the qtAddLibrary if appropriate, so no - qtAddLibrary(QtQml) # harm done :) -} - diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index f743acc249..ad9cf06d5c 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -2083,6 +2083,7 @@ void QQuickPropertyAnimation::setTo(const QVariant &t) } /*! + \qmlpropertygroup QtQuick::PropertyAnimation::easing \qmlproperty enumeration QtQuick::PropertyAnimation::easing.type \qmlproperty real QtQuick::PropertyAnimation::easing.amplitude \qmlproperty real QtQuick::PropertyAnimation::easing.overshoot diff --git a/tests/auto/quick/qquicklistview/data/addTransitions.qml b/tests/auto/quick/qquicklistview/data/addTransitions.qml index 69e6ba1eea..88db36760f 100644 --- a/tests/auto/quick/qquicklistview/data/addTransitions.qml +++ b/tests/auto/quick/qquicklistview/data/addTransitions.qml @@ -62,7 +62,7 @@ Rectangle { anchors.centerIn: parent width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/data/displacedTransitions.qml b/tests/auto/quick/qquicklistview/data/displacedTransitions.qml index d83ccfedf4..37c9e1e588 100644 --- a/tests/auto/quick/qquicklistview/data/displacedTransitions.qml +++ b/tests/auto/quick/qquicklistview/data/displacedTransitions.qml @@ -69,7 +69,7 @@ Rectangle { anchors.centerIn: parent width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/data/header.qml b/tests/auto/quick/qquicklistview/data/header.qml index 076bf9cb97..1cc4ae09ee 100644 --- a/tests/auto/quick/qquicklistview/data/header.qml +++ b/tests/auto/quick/qquicklistview/data/header.qml @@ -26,7 +26,6 @@ Rectangle { focus: true width: initialViewWidth height: initialViewHeight - cacheBuffer: 0 snapMode: ListView.SnapToItem model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/data/listview-enforcerange.qml b/tests/auto/quick/qquicklistview/data/listview-enforcerange.qml index f1052b1482..4ccf3088b0 100644 --- a/tests/auto/quick/qquicklistview/data/listview-enforcerange.qml +++ b/tests/auto/quick/qquicklistview/data/listview-enforcerange.qml @@ -45,7 +45,7 @@ Rectangle { objectName: "list" width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate highlight: myHighlight diff --git a/tests/auto/quick/qquicklistview/data/listview-noCurrent.qml b/tests/auto/quick/qquicklistview/data/listview-noCurrent.qml index fa7430c4cb..e094b888ab 100644 --- a/tests/auto/quick/qquicklistview/data/listview-noCurrent.qml +++ b/tests/auto/quick/qquicklistview/data/listview-noCurrent.qml @@ -43,7 +43,7 @@ Rectangle { currentIndex: -1 width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 delegate: myDelegate highlightMoveVelocity: 1000 model: testModel diff --git a/tests/auto/quick/qquicklistview/data/listview-sections-package.qml b/tests/auto/quick/qquicklistview/data/listview-sections-package.qml index e0daf50b32..8bad73b5f6 100644 --- a/tests/auto/quick/qquicklistview/data/listview-sections-package.qml +++ b/tests/auto/quick/qquicklistview/data/listview-sections-package.qml @@ -68,6 +68,6 @@ Rectangle { height: 320 model: visualModel.parts.package section.property: "number" - cacheBuffer: 0 + cacheBuffer: 60 } } diff --git a/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml b/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml index d82ff4c63a..7245025bac 100644 --- a/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml +++ b/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml @@ -56,7 +56,7 @@ Rectangle { objectName: "list" width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate section.property: sectionProperty diff --git a/tests/auto/quick/qquicklistview/data/margins.qml b/tests/auto/quick/qquicklistview/data/margins.qml index cf6a56c720..3e4defaffb 100644 --- a/tests/auto/quick/qquicklistview/data/margins.qml +++ b/tests/auto/quick/qquicklistview/data/margins.qml @@ -42,7 +42,7 @@ Rectangle { topMargin: 30 bottomMargin: 50 highlightMoveVelocity: 100000 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate } diff --git a/tests/auto/quick/qquicklistview/data/moveTransitions.qml b/tests/auto/quick/qquicklistview/data/moveTransitions.qml index c4dce99208..dbbb4ebe75 100644 --- a/tests/auto/quick/qquicklistview/data/moveTransitions.qml +++ b/tests/auto/quick/qquicklistview/data/moveTransitions.qml @@ -62,7 +62,7 @@ Rectangle { anchors.centerIn: parent width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/data/multipleDisplaced.qml b/tests/auto/quick/qquicklistview/data/multipleDisplaced.qml index 5893c30447..e036822980 100644 --- a/tests/auto/quick/qquicklistview/data/multipleDisplaced.qml +++ b/tests/auto/quick/qquicklistview/data/multipleDisplaced.qml @@ -44,7 +44,7 @@ Rectangle { anchors.centerIn: parent width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/data/multipleTransitions.qml b/tests/auto/quick/qquicklistview/data/multipleTransitions.qml index 4fcc80be2d..c0e888c6c6 100644 --- a/tests/auto/quick/qquicklistview/data/multipleTransitions.qml +++ b/tests/auto/quick/qquicklistview/data/multipleTransitions.qml @@ -53,7 +53,6 @@ Rectangle { anchors.centerIn: parent width: 240 height: 320 - cacheBuffer: 0 model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/data/populateTransitions.qml b/tests/auto/quick/qquicklistview/data/populateTransitions.qml index 84b5b6bc1f..735314524f 100644 --- a/tests/auto/quick/qquicklistview/data/populateTransitions.qml +++ b/tests/auto/quick/qquicklistview/data/populateTransitions.qml @@ -52,7 +52,7 @@ Rectangle { anchors.centerIn: parent width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/data/removeTransitions.qml b/tests/auto/quick/qquicklistview/data/removeTransitions.qml index 861cf42d94..4a34d4b585 100644 --- a/tests/auto/quick/qquicklistview/data/removeTransitions.qml +++ b/tests/auto/quick/qquicklistview/data/removeTransitions.qml @@ -64,7 +64,7 @@ Rectangle { anchors.centerIn: parent width: 240 height: 320 - cacheBuffer: 0 + cacheBuffer: 60 model: testModel delegate: myDelegate diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index c3f42d393e..f741fec159 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -737,6 +737,8 @@ void tst_QQuickListView::insertBeforeVisible() { QFETCH(int, insertIndex); QFETCH(int, insertCount); + QFETCH(int, removeIndex); + QFETCH(int, removeCount); QFETCH(int, cacheBuffer); QQuickText *name; @@ -776,14 +778,19 @@ void tst_QQuickListView::insertBeforeVisible() QVERIFY(item); QCOMPARE(item->y(), listview->contentY()); - QList<QPair<QString, QString> > newData; - for (int i=0; i<insertCount; i++) - newData << qMakePair(QString("value %1").arg(i), QString::number(i)); - model.insertItems(insertIndex, newData); - QTRY_COMPARE(listview->property("count").toInt(), model.count()); + if (removeCount > 0) + model.removeItems(removeIndex, removeCount); + + if (insertCount > 0) { + QList<QPair<QString, QString> > newData; + for (int i=0; i<insertCount; i++) + newData << qMakePair(QString("value %1").arg(i), QString::number(i)); + model.insertItems(insertIndex, newData); + QTRY_COMPARE(listview->property("count").toInt(), model.count()); + } // now, moving to the top of the view should position the inserted items correctly - int itemsOffsetAfterMove = -(insertCount * 20); + int itemsOffsetAfterMove = (removeCount - insertCount) * 20; listview->setCurrentIndex(0); QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); QTRY_COMPARE(listview->currentIndex(), 0); @@ -808,23 +815,41 @@ void tst_QQuickListView::insertBeforeVisible_data() { QTest::addColumn<int>("insertIndex"); QTest::addColumn<int>("insertCount"); + QTest::addColumn<int>("removeIndex"); + QTest::addColumn<int>("removeCount"); QTest::addColumn<int>("cacheBuffer"); - QTest::newRow("insert 1 at 0, 0 buffer") << 0 << 1 << 0; - QTest::newRow("insert 1 at 0, 100 buffer") << 0 << 1 << 100; - QTest::newRow("insert 1 at 0, 500 buffer") << 0 << 1 << 500; + QTest::newRow("insert 1 at 0, 0 buffer") << 0 << 1 << 0 << 0 << 0; + QTest::newRow("insert 1 at 0, 100 buffer") << 0 << 1 << 0 << 0 << 100; + QTest::newRow("insert 1 at 0, 500 buffer") << 0 << 1 << 0 << 0 << 500; + + QTest::newRow("insert 1 at 1, 0 buffer") << 1 << 1 << 0 << 0 << 0; + QTest::newRow("insert 1 at 1, 100 buffer") << 1 << 1 << 0 << 0 << 100; + QTest::newRow("insert 1 at 1, 500 buffer") << 1 << 1 << 0 << 0 << 500; + + QTest::newRow("insert multiple at 0, 0 buffer") << 0 << 3 << 0 << 0 << 0; + QTest::newRow("insert multiple at 0, 100 buffer") << 0 << 3 << 0 << 0 << 100; + QTest::newRow("insert multiple at 0, 500 buffer") << 0 << 3 << 0 << 0 << 500; + + QTest::newRow("insert multiple at 1, 0 buffer") << 1 << 3 << 0 << 0 << 0; + QTest::newRow("insert multiple at 1, 100 buffer") << 1 << 3 << 0 << 0 << 100; + QTest::newRow("insert multiple at 1, 500 buffer") << 1 << 3 << 0 << 0 << 500; + + QTest::newRow("remove 1 at 0, 0 buffer") << 0 << 0 << 0 << 1 << 0; + QTest::newRow("remove 1 at 0, 100 buffer") << 0 << 0 << 0 << 1 << 100; + QTest::newRow("remove 1 at 0, 500 buffer") << 0 << 0 << 0 << 1 << 500; - QTest::newRow("insert 1 at 1, 0 buffer") << 1 << 1 << 0; - QTest::newRow("insert 1 at 1, 100 buffer") << 1 << 1 << 100; - QTest::newRow("insert 1 at 1, 500 buffer") << 1 << 1 << 500; + QTest::newRow("remove 1 at 1, 0 buffer") << 0 << 0 << 1 << 1 << 0; + QTest::newRow("remove 1 at 1, 100 buffer") << 0 << 0 << 1 << 1 << 100; + QTest::newRow("remove 1 at 1, 500 buffer") << 0 << 0 << 1 << 1 << 500; - QTest::newRow("insert multiple at 0, 0 buffer") << 0 << 3 << 0; - QTest::newRow("insert multiple at 0, 100 buffer") << 0 << 3 << 100; - QTest::newRow("insert multiple at 0, 500 buffer") << 0 << 3 << 500; + QTest::newRow("remove multiple at 0, 0 buffer") << 0 << 0 << 0 << 3 << 0; + QTest::newRow("remove multiple at 0, 100 buffer") << 0 << 0 << 0 << 3 << 100; + QTest::newRow("remove multiple at 0, 500 buffer") << 0 << 0 << 0 << 3 << 500; - QTest::newRow("insert multiple at 1, 0 buffer") << 1 << 3 << 0; - QTest::newRow("insert multiple at 1, 100 buffer") << 1 << 3 << 100; - QTest::newRow("insert multiple at 1, 500 buffer") << 1 << 3 << 500; + QTest::newRow("remove multiple at 1, 0 buffer") << 0 << 0 << 1 << 3 << 0; + QTest::newRow("remove multiple at 1, 100 buffer") << 0 << 0 << 1 << 3 << 100; + QTest::newRow("remove multiple at 1, 500 buffer") << 0 << 0 << 1 << 3 << 500; } template <class T> |