aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview
Commit message (Collapse)AuthorAgeFilesLines
* Blacklist tst_QQuickListView::contentHeightWithDelayRemove on macos10.12Ulf Hermann2019-04-161-0/+3
| | | | | | Task-number: QTBUG-75202 Change-Id: I852439cd4d3b7106d018757e6c11c7d455fc9692 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* In response to touch cancel, don't just ungrab, send an ungrab eventShawn Rutledge2019-04-042-0/+63
| | | | | | | | | | | | | | | | | | QQuickWindowPrivate::sendUngrabEvent() sends an UngrabMouse event, and that can be filtered by parent filters. If a touch cancel happens to a MouseArea in a ListView delegate, we need the ListView to filter the UngrabMouse event so that QQuickFlickable::childMouseEventFilter() will call QQuickFlickable::mouseUngrabEvent() and QQuickFlickablePrivate::cancelInteraction() will set pressed to false. The pressed state became true because Flickable filtered the press event; so for symmetry, it also needs to filter the touch cancel (in the form of a mouse ungrab), to avoid being stuck in a state where it can't move programmatically. Fixes: QTBUG-74679 Change-Id: I6c0ed364d2bc1f45c7e7b17846a09f6b53f91d0a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Blacklist tst_QQuickListView::enforceRange_withoutHighlight on opensuseUlf Hermann2019-03-201-0/+2
| | | | | | Task-number: QTBUG-74544 Change-Id: I0a8c54d2a02d959edacd82abcee4553222d575d9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove blacklisting of several tests that are passingShawn Rutledge2019-02-101-2/+0
| | | | | | | | | | | | | ...based on statistics visible in Grafana. Task-number: QTBUG-41895 Task-number: QTBUG-38209 Task-number: QTBUG-65978 Task-number: QTBUG-36804 Task-number: QTBUG-45466 Task-number: QTBUG-29062 Change-Id: If62d2413ede234d33b411e0ecb4f93ec6e0f8062 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* macOS: Remove blacklist entries for no longer supported OS versionsTor Arne Vestbø2018-11-151-2/+0
| | | | | | | Fixes: QTBUG-60518 Change-Id: If41b3c7b3ca4ca9a48692cbb2753b47492693e83 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Make sectionsSnap test more robustMichael Brasser2018-10-221-1/+1
| | | | | | Change-Id: I24beb0bb98f7e67abc4d5c3295376d863bb44892 Task-number: QTBUG-71239 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Improve interaction between snapping and sectionsMichael Brasser2018-10-172-0/+107
| | | | | | | | | | * Use velocity to prefer snapping in the active direction. * Calculate snap based on where the item is, rather than where the section is. Change-Id: I2531501dbe0a58f26f20bc3e719e435185e047a5 Task-number: QTBUG-67051 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Replace obsolete VisualDataModel, *Group and VisualItemModel in testsShawn Rutledge2018-10-058-21/+28
| | | | | | | | | | | | | VisualDataModel, VisualDataGroup, and VisualItemModel are replaced with DelegateModel, DelegateModelGroup, and ObjectModel respectively (since 7cad0e52c5a020bd29635e9912fd8946a6b48124). git grep -l 'VisualDataModel' | xargs sed -i 's/VisualDataModel/DelegateModel/g' git grep -l 'VisualDataGroup' | xargs sed -i 's/VisualDataGroup/DelegateModelGroup/g' git grep -l 'VisualItemModel' | xargs sed -i 's/VisualItemModel/ObjectModel/g' Change-Id: Ie91b37b204f08a5d1f1f38594fb22ed70a6e2080 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickItemView: Don't change the viewport while in layoutUlf Hermann2018-09-272-0/+104
| | | | | | | | | Moving the viewport in the middle of a layout operation is a bad idea as it causes the visible items to change. Task-number: QTBUG-49224 Change-Id: I45a214560e00b65ed53b9385e7a539bb4304b7d9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQmlDelegateModel: don't fall back to use DelegateChooser as delegateRichard Moe Gustavsen2018-09-062-0/+74
| | | | | | | | | | | If the application uses a DelegateChooser, but the chooser fails to resolve a delegate for a certain index, it should not use itself as the delegate instead. This will cause the application to crash. Instead, return nullptr (like we do in the function guard), which will let the item views handle the situation gracefully. Change-Id: I9b3b4aa2626d1f8521b4395096300ac12150c63f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Prevent ListView from jumping horizontally with flick(0,<number>)Michael Brasser2018-08-232-0/+37
| | | | | | | | The internal flick functions were not written to handle empty flicks in invalid directions. Guard our calls accordingly. Change-Id: I34801a7e548160ce4895dd8a2f6c0b17172cd02e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StrictlyEnforceRange should not override valid SnapOne decisionsMichael Brasser2018-06-291-0/+5
| | | | | | | | | | The changes made in 134d980a7fcf61c5440019bcfb3fdfc39c3f5f3c and 2b779fbd25aaf09897ee2cdc4edffd12a980420b were still a bit too broad. Tighten the condition further so original behavior is restored for smaller to medium drags. Change-Id: I9006e9cea80c1ef79e0b8d6a47b2a497532bef57 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix SnapOneItem/Row behavior for mid-range flicksMichael Brasser2018-06-291-11/+21
| | | | | | | | | | Previously small and large flicks would go to the next item, but there was a small range just under halfway where it would snap to the previous position (most easily hit with smaller delegates). Get rid of this blindspot. Change-Id: Ib8d026cad9427b2d209a9646b3ea515f578457ae Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQmlDelegateModel: even for QAIM, only use first column by defaultRichard Moe Gustavsen2018-06-211-0/+33
| | | | | | | | | | | | | | | | | | | In 2f9afadd5d9b4899397dca, we introduced a change in QQmlAdaptorModel so that a QAIM model report that it contains "rows * cols" number of model items, and not just "rows". This was needed, otherwise TableView would only display the first column of such models. It turns out, however, that also ListView will now detect that a QAIM contain more items than just the items in the first column. The result will be that it ends up adding all the other columns underneath the first column in the view. To avoid this unforseen change, this patch will revert this logic, and instead add a private variable that can be set if the new behavior is wanted (e.g by TableView). Change-Id: I8c13da99f05e2f922362e498d1fa1779cdbd0d72 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Tests: Silence Clang warningsFriedemann Kleint2018-04-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | ./stringmodel.h(63,9): warning: 'rowCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] int rowCount(const QModelIndex &) const ^ ./stringmodel.h(73,17): warning: 'columnCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual int columnCount(const QModelIndex &) const ^ ./stringmodel.h(83,25): warning: 'index' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual QModelIndex index(int row, int column, const QModelIndex &parent) const ./stringmodel.h(92,25): warning: 'parent' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual QModelIndex parent(const QModelIndex &) const ^ ./stringmodel.h(97,14): warning: 'data' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] QVariant data (const QModelIndex & index, int role) const ^ tst_qquicklistview.cpp(8695,18): warning: unused variable 'ctxt' [-Wunused-variable] QQmlContext *ctxt = window->rootContext(); Task-number: QTBUG-63512 Change-Id: Ie928981a601d0462cfadd093815d110f6971d7f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix QQuickListViewPrivate::snapItemAt for lists with spacingJohan Klokkhammer Helsing2018-04-252-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If lists had spacing, snapping would have gaps where snapItemAt would return nullptr eventhough there were items above and below in the list. I.e. if we have a list with items of size 100, and a spacing of 100, and scroll to 110 (right below the first item), then the first item would fail because this is false: itemTop+itemSize()/2 >= pos (50 >= 110) And the next item (the one we should have snapped to), would fail because this is false: itemTop-prevItemSize/2 < pos (200-100/2 < 110) The meaning of first part was probably to see if the middle of the current item is inside the view. The meaning of the second part was probably to see if the middle of the previous item is outside the view. This patch refactors the code so it's more visible what's happening and fixes the bug by taking the spacing into account when computing the position of the halfway positions. Task-number: QTBUG-59852 Change-Id: I60eec0d16e91d2f22d70b97d11bcde5d88ac2997 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-234/+234
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tests: Wrap qWaitForWindow{Active,Exposed} in QVERIFYv5.11.0-beta1Kari Oikarinen2018-02-231-5/+5
| | | | | | | | | | | The functions are marked Q_REQUIRED_RESULT, so they give compilation warnings when not handling the bool return value. Failing the test early at an unexpected event is also better behavior anyway. Task-number: QTBUG-66559 Change-Id: I6c4db29379ec01528208c3e4ee54346b4230616c Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-02-022-1/+136
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp src/qml/compiler/qqmlirbuilder.cpp src/qml/compiler/qqmlirbuilder_p.h src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4codegen_p.h src/qml/compiler/qv4compileddata_p.h src/qml/compiler/qv4compiler.cpp src/qml/compiler/qv4compilercontext_p.h src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4jsir.cpp src/qml/compiler/qv4jsir_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4runtimecodegen.cpp src/qml/jsruntime/qv4script.cpp src/qml/jsruntime/qv4script_p.h src/qml/qml/qqmltypeloader.cpp src/quick/items/qquickanimatedimage.cpp src/quick/items/qquickanimatedimage_p_p.h src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp tests/auto/qml/qmlplugindump/qmlplugindump.pro tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp tools/qmlcachegen/qmlcachegen.cpp tools/qmljs/qmljs.cpp Done-with: Shawn Rutledge <shawn.rutledge@qt.io> Done-with: Lars Knoll <lars.knoll@qt.io> Done-with: Ulf Hermann <ulf.hermann@qt.io> Change-Id: I010e6525440a85f3b9a10bb9083f8e4352751b1d
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-242-1/+136
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata_p.h src/qml/debugger/qqmlprofiler_p.h src/qml/jsruntime/qv4engine.cpp src/qml/memory/qv4mm.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlobjectcreator_p.h src/qml/types/qqmldelegatemodel.cpp src/quick/items/qquickitem_p.h src/quick/items/qquickwindow.cpp tests/auto/quick/touchmouse/BLACKLIST tests/benchmarks/qml/holistic/tst_holistic.cpp Change-Id: I520f349ab4b048dd337d9647113564fc257865c2
| | * QQuickItemView: Clear pending changes when refillingUlf Hermann2017-12-182-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally the bufferedChanges are an "extension" of the currentChanges, which can just not be applied at the moment because we are in a layout phase. If we regenerate or clear the whole view in the mean time, the bufferedChanges become just as invalid as the currentChanges. On top of that, refilling can trigger further changes, part of which will be applied during the refilling. As that leaves us in an inconsistent state, we need to loop the refilling until no further changes are generated. As the changes might affect items that are already visible, and therefore not subject to refilling, we need to clear all the items before refilling in this case. In QTBUG-46488 things are added in the onCompleted callback of the delegates (by expanding the tree view, which translates into adding rows to the list view). Depending on where you add the new items, the list view might pick them up when iterating the model on refill() or it might create delegates for the same model entry twice. So, if that happens we need to discard the result and refill again. Task-number: QTBUG-46488 Change-Id: Ie4e0a731f7feda6aa962b6cb9a6cd5c3bf90486e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * QQuickList/GridViewPrivate::fixupPosition: don't set moveReasonShawn Rutledge2017-12-161-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQuickItemViewPrivate::applyModelChanges(), if moveReason = QQuickItemViewPrivate::Other, then QQuickItemView::trackedPositionChanged() will fail to call d->setPosition(pos), which is normally what keeps the Flickable moving for a while. Leave the reason as-is (it will be SetIndex in this case), so as not to forget that we were actually trying to move down when the sequence window->polishItems() -> QQIV::updatePolish() -> layout() -> fixupPosition() did its part of the work of moving down. Task-number: QTBUG-62864 Change-Id: I1021e2ea39265de9e1285e2ee17c5733189ab939 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Blacklist QTBUG_34576_velocityZero ListView test on macOS 10.11Shawn Rutledge2018-01-251-0/+3
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-65964 Change-Id: Ie1ba02a38cbd019077c7a89ed310d79ec28b6bec Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-092-0/+153
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/memory/qv4mm.cpp src/qml/qml/qqmlbinding.cpp Change-Id: I98e51ef5af12691196da5772a07d3d53d213efcc
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-042-0/+153
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/memory/qv4mm.cpp src/qml/memory/qv4mmdefs_p.h src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp Change-Id: I7021fa1edf076627a67048f41f7b201220262b09
| | * QQuickListView/GridView: load items that results from model changes ↵Richard Moe Gustavsen2017-11-302-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | synchronously The current implementation created new items with default incubation mode, which is AsynchronousIfNested. But from reading the code, it seems like changes to the model were really expected to be handled synchronously, since there aren't any sections in the code that will recover from situations were requested items ends up incubating async. This is also backed by the fact that the second argument used to be a bool set to 'synchronous'. The fact that this was translated to AsynchronousIfNested later down the chain didn't seems to be taken into account. A bug with this is found in ListView when it's embedded inside an async Loader. In that case, all list items will be incubating async at startup, which is normally expected and fine. But if the model assigned to the ListView is modified before the loader has finished, async loading will also happen to the items created because of the change. And then the situation described above will occur. This patch will force any items loaded because of a model change to be synchronous. This seems to be in line with the synchronous logic that already exists. And its also quite acceptable, since changing the model before everything is completed is a corner case, and can naturally lead to some stuttering in the list view anyway. A potential for improvement on this logic is to try to recover whenever creating an item fails. But this takes a lot of work because of the way model changes are structured and stored, and can easily cause regressions. Since this is a corner case, it is probably not worth it. [ChangeLog][QtQml][ListView] Fixed a bug in ListView that sometimes make items end up with wrong geometry when changes to its model happens while the ListView is being loaded async (e.g if wrapped inside an async Loader). Task-number: QTBUG-61537 Change-Id: I8d6857beaf8ef98b02bb46282a1312749b0fb801 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-12-204-9/+292
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/pointerhandlers/flickableinterop/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/flickableinterop/data/Slider.qml tests/auto/quick/pointerhandlers/flickableinterop/data/TapHandlerButton.qml tests/auto/quick/pointerhandlers/flickableinterop/data/flickableWithHandlers.qml tests/auto/quick/pointerhandlers/multipointtoucharea_interop/data/pinchDragMPTA.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/DragAnywhereSlider.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/Slider.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/draggables.qml tests/auto/quick/pointerhandlers/qquickdraghandler/data/multipleSliders.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/Button.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/FlashAnimation.qml tests/auto/quick/pointerhandlers/qquicktaphandler/data/buttons.qml tests/manual/pointer/content/FakeFlickable.qml tests/manual/pointer/content/FlashAnimation.qml tests/manual/pointer/content/MomentumAnimation.qml tests/manual/pointer/content/MouseAreaButton.qml tests/manual/pointer/content/MouseAreaSlider.qml tests/manual/pointer/content/MptaButton.qml tests/manual/pointer/content/MultiButton.qml tests/manual/pointer/content/ScrollBar.qml tests/manual/pointer/content/Slider.qml tests/manual/pointer/content/TapHandlerButton.qml tests/manual/pointer/fakeFlickable.qml tests/manual/pointer/flickableWithHandlers.qml tests/manual/pointer/flingAnimation.qml tests/manual/pointer/joystick.qml tests/manual/pointer/main.cpp tests/manual/pointer/main.qml tests/manual/pointer/map.qml tests/manual/pointer/map2.qml tests/manual/pointer/mixer.qml tests/manual/pointer/multibuttons.qml tests/manual/pointer/photosurface.qml tests/manual/pointer/pinchDragFlingMPTA.qml tests/manual/pointer/pinchHandler.qml tests/manual/pointer/singlePointHandlerProperties.qml tests/manual/pointer/tapHandler.qml tests/manual/pointer/tapWithModifiers.qml tests/manual/shapestest/main.cpp Change-Id: I4f233a521305fab1ebfecbac801da192434ed524
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Shawn Rutledge2017-11-132-8/+84
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h tests/auto/quick/quick.pro Change-Id: Ia12f20e95fb151bbbc75dbf187364a924cd0bc7a
| | * stabilize and optimize tst_QQuickListView::QTBUG_34576_velocityZeroShawn Rutledge2017-11-081-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - don't use QTRY_VERIFY or QTRY_COMPARE if there's nothing to wait for, because it will always wait a short time and add needless delay to the test - QVERIFY(QSignalSpy::wait())'s should perhaps not be done in sequence, in case the second signal already happened while we were waiting for the first. QTRY_VERIFY(QSignalSpy::count() > 0) should be more reliable in such a case, as long as we are sure the count started at zero before the behavior which was supposed to make the signal be emitted. - 1000ms is probably not long enough to wait for ListView velocity change on a slow CI system. - according to the comment "verify that currentIndexChanged is triggered" we need another spy for that signal. Change-Id: I99d93a849b674ce6c81acbe91639f03933025117 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | * Fix ListView::positionViewAtIndex with ListView.Contain modeJoni Poikelin2017-11-072-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sticky headers and footers weren't accounted for when calculating new view position causing the requested item to be left behind them. Task-number: QTBUG-63974 Change-Id: Id69579643a942e8558960b2c8b0fee980fa86947 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta4Liang Qi2017-11-063-9/+216
| |\| | | | | | | | | | Change-Id: I8ede7e36592cd21f3e4a0a9b30dbe26bb40fe69b
| | * stabilize tst_QQuickListView::incrementalModelShawn Rutledge2017-11-031-9/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-30716 Change-Id: I0c6829ae496850d6a2cdcc349c496dfbf4e8adbb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| | * Fix providing correct velocity when using index based scrollingPasi Petäjäjärvi2017-11-032-0/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | Index based scrolling does not enable moving and flicking properties. Task-number: QTBUG-34576 Change-Id: Ief06d37115ca389027670c97ce6c0457a74d4872 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * ListView: don't stop moving the highlight because of model updatesShawn Rutledge2017-11-032-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQuickItemViewPrivate::applyModelChanges(), if moveReason = QQuickItemViewPrivate::Other, then QQuickItemView::trackedPositionChanged() will fail to call d->setPosition(pos), which is normally what keeps the Flickable moving for a while. Leave the reason as-is (it will be SetIndex in this case), so as not to forget that we were actually trying to move down. Updating the model was just a side-effect of that: either because some QML code was trying to append to the model or because fetchMore() was called. Task-number: QTBUG-61269 Task-number: QTBUG-62864 Change-Id: I3fd402469950d6c12e6a8d6e42be83ea4f54776a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * | Update to new QRandomGenerator APIThiago Macieira2017-11-031-2/+2
| | | | | | | | | | | | | | | Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Update to new QRandomGenerator APIThiago Macieira2017-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To get latest qtbase dev integrated in qt5 dev again without qtdeclarative 5.10->dev merge. Change-Id: I6905649aca2b06302df8cee2f660f1f92398d36a Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> (cherry picked from commit ee00fa01dc41deaaedfa0d1d5cc6cd750bfe75f4) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Replace remaining Q_NULLPTR with nullptrKevin Funk2017-11-171-1/+1
| | | | | | | | | | | | | | | Change-Id: I28a32af7f1c306a3002d47025a842475f848c1a4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-068-23/+103
|\| | | | | | | | | | | Change-Id: I1ed923d72566af663555898c3ec708191eef8ae9
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-248-23/+103
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmltypenamecache.cpp Done-with: Ulf Hermann<ulf.hermann@qt.io> Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
| | * Fix outdated BSD license headerKai Koehne2017-10-178-23/+103
| | | | | | | | | | | | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | | stabilize tst_QQuickListView::flickBothDirectionsShawn Rutledge2017-10-232-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Setting pixelAligned should make flicking end at a whole-pixel offset. Task-number: QTBUG-63909 Change-Id: I573d0c4f3a3c019169f42c6808e333112dcd6b79 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Blacklist tst_QQuickListView::flickBothDirections() temporarilyLiang Qi2017-10-201-0/+3
|/ / | | | | | | | | | | Task-number: QTBUG-63909 Change-Id: I3a115e86f0395f79443fdba359fa6a92322ae34b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-09-202-0/+49
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4regexpobject_p.h src/qml/types/qqmllistmodel.cpp src/quick/items/qquickanimatedimage_p.h src/quick/scenegraph/qsgrenderloop.cpp tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
| * Fix issue with programmatic flicking at boundsMichael Brasser2017-09-082-0/+49
| | | | | | | | | | | | | | | | | | Ensure that the same flick consistently produces the same results, by making sure we don't use old timestamps from previous flicks. Task-number: QTBUG-62939 Change-Id: Ie738076abba66d38ff505292925e9441c38a3c95 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Use QRandomGenerator instead of q?randThiago Macieira2017-08-231-2/+3
|/ | | | | Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix ListView::StrictlyEnforceRange with resizing delegateMichael Brasser2017-08-092-0/+55
| | | | | | | | | | | When fixupPosition is called for a ListView with StrictlyEnforceRange, the original reason for the move is lost, and the fixup is applied immediately. There are already checks for whether the view is moving, so expand these checks to include movement caused by highlight. Change-Id: I25f771b9a529d31dc28acb9f91fcd2b582428200 Task-number: QTBUG-33568 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* QQuickItemView: fix releaseItem() loopsJ-P Nurmi2017-06-122-0/+25
| | | | | | | | | | | | | | Calling releaseItem() destroys the item, which emits childrenChanged for the contentItem, and if at that point anything calls setFooMargin(), setContentHeight(), returnToBounds(), or many other methods that indirectly access the visibleItems list, it leads to a crash due to read after free. Add a releaseVisibleItems() helper method that makes a copy, clears the original list first, and then releases the items. Task-number: QTBUG-48394 Task-number: QTBUG-61294 Change-Id: I29e4d3870d33549e8bf789de84c67ab1826fca7d Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* ListView: allow flicking to both directionsJ-P Nurmi2017-01-162-0/+149
| | | | | | | | | | | | | | | | Previously flicking was restricted to the orientation of the ListView. [ChangeLog][QtQuick][ListView] Made it possible to enable horizontal flicking in a vertical ListView, and vice versa. The only thing apps must do is to specify the desired flick direction and the content width (vertical ListView) or content height (horizontal ListView), which is not calculated by ListView. Change-Id: Ic370e57f5d18679940d48e7a2c20c200b2ef36d1 Task-number: QTBUG-52553 Task-number: QTBUG-56501 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* ListView, GridView: fix missing keyNavigationEnabled propertyMitch Curtis2016-12-202-1/+15
| | | | | | | | | | | | | | | | | | | | | | | Before this patch, this code: import QtQuick 2.7 ListView { keyNavigationEnabled: true } Would cause this error: "ListView.keyNavigationEnabled" is not available in QtQuick 2.7. This is because ItemView was missing a revision: qmlRegisterUncreatableType<QQuickItemView, 7>( uri, 2, 7, "ItemView", QQuickItemView::tr("ItemView is an abstract base class")); Task-number: QTBUG-57621 Change-Id: Ia00cb7446a0d83278760f3aa361db5a864661bc6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* tst_QQuickPathView, tst_QQuickListView: Fix compiler warningsFriedemann Kleint2016-12-081-82/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings about assignment used as truth value in Q[TRY_]VERIFY by generally pulling out the assignment in case of QVERIFY and adding parentheses in case of QTRY_VERIFY. Also fix 2 cases in which apparently QTRY_VERIFY(find()) was intended. Fixes warnings: tst_qquickpathview.cpp: In member function 'void tst_QQuickPathView::creationContext()': tst_qquickpathview.cpp:1637:100: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquickpathview.cpp: In member function 'void tst_QQuickPathView::currentOffsetOnInsertion()': tst_qquickpathview.cpp:1688:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquickpathview.cpp:1700:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquickpathview.cpp:1712:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::sectionsPositioning()': tst_qquicklistview.cpp:2392:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::itemListFlicker()': tst_qquicklistview.cpp:2979:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2981:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2983:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2988:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2990:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2992:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2997:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:2999:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:3001:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::creationContext()': tst_qquicklistview.cpp:5339:97: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5341:98: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5343:98: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5345:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::unrequestedVisibility()': tst_qquicklistview.cpp:5626:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5628:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5631:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5633:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5636:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5638:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5640:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5642:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5650:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5652:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5663:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5665:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5668:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5670:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5673:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5675:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5677:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5679:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5687:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5690:103: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5692:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5695:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5697:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5699:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5701:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5707:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5709:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5711:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5713:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5719:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5721:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5723:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5725:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5731:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5733:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5735:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5737:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5743:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5745:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5747:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:5749:104: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::displayMargin()': tst_qquicklistview.cpp:7255:100: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7259:102: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp: In member function 'void tst_QQuickListView::negativeDisplayMargin()': tst_qquicklistview.cpp:7292:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7295:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7298:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qquicklistview.cpp:7303:99: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Change-Id: Ic069c8336cf15db75860c6f79dfd215a5592ca79 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>