Commit Graph

91 Commits

Author SHA1 Message Date
Shawn Rutledge 9eabb32822 Modernize tst_QQuickPathView::treeModel()
- Don't use context properties: a singleton is better
- Use required properties to declare dependendencies

Change-Id: I10a0a301e0a397b1d4fc9edf804eea3499c79025
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-10 18:55:43 +02:00
Shawn Rutledge 2449999ba1 Fix some warnings in tst_qquickpathview
Change-Id: I5c3c6d418fb9f35ee684d6d7c548ba468b7f262c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-10 18:30:08 +02:00
Shawn Rutledge a24a49dfbb Autotests: use std::atomic in incubateWhile()
Followup to a9bf6e652a

Change-Id: Ic010f2610177f93f8fc4e2312d6736c96390e585
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-15 08:48:03 +02:00
Qt Forward Merge Bot 88490da44e Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
	tests/auto/quick/qquicktableview/tst_qquicktableview.cpp

Change-Id: Ib46bc1c717cf524eea2fb3d876810c8d55747c91
2019-12-05 10:09:17 +01:00
Shin-ichi Okada e394979d24 Fix incorrect behavior of PathView with ungrabMouse()
When the grabbed Item is released and then grabbed again,
if ungrabMouse () is called, the animation stops. In order to
avoid this, when ungrabMouse () is called, if offset is different,
it is modified to animate.

Task-number: QTBUG-79592
Change-Id: I61cbd4dad90643722f12480f0dab3859ce116af8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-12-04 14:53:03 +01:00
Qt Forward Merge Bot 66db74e53e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I1359574c7d89aaf3328958e2f667ba1e599ff7f1
2019-10-11 01:00:19 +02:00
Liang Qi aa057451b3 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp
	tests/auto/quick/qquickpathview/tst_qquickpathview.cpp

Change-Id: I117c8d62b21800329d1035021d312d9924f83a1b
2019-10-10 13:59:00 +02:00
Shawn Rutledge 44c51303b6 Add signal spies to tst_QQuickPathView::flickNClick test
QTBUG-78926 is about failing to emit the movingChanged signal.  The
test verifies that e2df4233a7 fixed it.
While we're at it, might as well verify a few more signals in this test
scenario where we flick the PathView at various speeds and then stop
the flick by clicking.

Fixes: QTBUG-78926
Change-Id: I1253dfcd88a63abdbdd280dd9097b484a93cc491
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-09 13:08:23 +02:00
Shawn Rutledge 26e99aeacd PathView: grab mouse on press if already moving
A side effect of 8fd398c9d2 is that it
became possible for the highlight to stop between items, rather than
snapping to a specific item, if the user taps, clicks or drags an
additional time while the movement is ongoing.  That was because it
didn't get a mouse grab, so it missed the release event.
QQuickPathViewPrivate::handleMouseReleaseEvent() needs to take care of
the snapping behavior after the user stops dragging.  This only affects
behavior in the case that the PathView is already moving and the mouse
is pressed again: we assume the user wants to alter the PathView's
velocity, not interact with any delegate inside or with any parent item.

Task-number: QTBUG-77173
Task-number: QTBUG-59620
Change-Id: I7b2f69a6ef8d8022d7c917a5bf9e8fb40c8848db
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit e2df4233a7)
2019-10-09 13:08:17 +02:00
Qt Forward Merge Bot 9c7121df15 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/imports/qtquick2/plugins.qmltypes
	src/quick/items/qquickitemsmodule.cpp

Change-Id: I841c65c9c131354788b4f3fcfe3d7ed27be316d5
2019-10-04 11:29:16 +02:00
Shawn Rutledge e2df4233a7 PathView: grab mouse on press if already moving
A side effect of 8fd398c9d2 is that it
became possible for the highlight to stop between items, rather than
snapping to a specific item, if the user taps, clicks or drags an
additional time while the movement is ongoing.  That was because it
didn't get a mouse grab, so it missed the release event.
QQuickPathViewPrivate::handleMouseReleaseEvent() needs to take care of
the snapping behavior after the user stops dragging.  This only affects
behavior in the case that the PathView is already moving and the mouse
is pressed again: we assume the user wants to alter the PathView's
velocity, not interact with any delegate inside or with any parent item.

Task-number: QTBUG-77173
Task-number: QTBUG-59620
Change-Id: I7b2f69a6ef8d8022d7c917a5bf9e8fb40c8848db
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-09-23 17:56:44 +02:00
Fabian Kosmale 39274b8f60 Required properties: Break binding to model on write
This mirrors the behavior in other parts of QML where writing to a
property in imperative code breaks the binding.

Change-Id: Id19eef17a3c5e77bc4c2772bd749b38c732606a8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-18 11:16:39 +02:00
Fabian Kosmale 0cc6d2a8ac Support required properties in model delegates
If a delegates declares a required property of a given name, and that
name exists as a role in the model, we set the property accordingly.
The same holds true for the special properties that come from the
QQmlDelegateModel like "index" and "model".

All roles are still injected into scope and thus accessible;
changing this in Qt5 would be tedious or even impossible while still
maintaining backwardscompatibility with delegates that do not use
required properties.

Change-Id: I4f388ba549c42f1ff9822bdb3b8357c4d45e4b66
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-09-12 09:19:25 +02:00
Paolo Angelelli ab0583eb43 Expose QQuickPath::pointAtPercent as Q_INVOKABLE
So it can be used in QML. Useful in combination with ShapePath,
in order to add graphics along a Shape.

[ChangeLog][QtQuick][Shapes] Exposed QQuickPath::pointAtPercent
as invokable in QML.

Change-Id: Ia8aeb2b74003410ce16d9d2a0c62d79a021530af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-25 15:35:05 +02:00
Qt Forward Merge Bot 369f3e57b8 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I59cb196ab17ed8504b33db01d827052eb6891efa
2019-06-06 01:00:05 +02:00
Eirik Aavitsland fca76305cb Fix QQuickPathView autotest: update expected warning messages
The wording of the warnings were changed in qtbase.

Fixes: QTBUG-76152
Change-Id: Iae0dfbcbb699b8abff92b5923b0a5627591043c8
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-06-03 11:59:20 +02:00
Qt Forward Merge Bot 10e3b24c02 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/qml/jsruntime/qv4value_p.h
	src/qml/qml/qqmlmetatype.cpp
	src/qml/qml/qqmltypewrapper.cpp
	src/quick/items/qquicktableview.cpp

Change-Id: I684f8e01a711580512848bf1253f39b39fcbf4c7
2019-06-11 11:28:44 +02:00
Ulf Hermann 325e6305b4 Move model types into their own library
The model types are not part of the core QML runtime and should only be
loaded if you explicitly import them. We cannot enforce that in Qt5 as
some of them are available from the QtQml import, but we can change it
in Qt6.

Change-Id: I1e49e84d748e352537ec2d4af901c034c91d038f
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2019-05-02 09:26:04 +00:00
Qt Forward Merge Bot 4407f1f818 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I910618824785f9119b1e1da9a82e998fd645a96f
2019-03-28 01:00:54 +01:00
Shawn Rutledge 1b43149dec Fix incorrect PathView.currentIndex assignment with StrictlyEnforceRange
If currentIndex is quickly assigned a different index and then the
previous current index again, it should not move.

Fixes: QTBUG-74508
Change-Id: I8d610e3fe452c8631e082c648e77d2cb70ae57c5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-03-27 09:04:58 +00:00
Liang Qi 1b4d2741f9 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf
	tests/auto/quick/qquickpathview/tst_qquickpathview.cpp

Change-Id: Ic1f5e219a255d0613f7654368a5ce3eccb8f0ee9
2019-01-22 11:20:29 +01:00
Friedemann Kleint f0a9c1efe3 Stabilize tst_QQuickPathView::package()
Add QQUICK_VERIFY_POLISH.

Fixes: QTBUG-73007
Change-Id: I08d90058770ef496469b917892104c751b5cf9c1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-01-14 13:28:45 +00:00
Mitch Curtis 34577e41b5 tests/auto/quick: remove QQUICK_VERIFY_POLISH macro
QQuickTest::qWaitForItemPolished() can be used instead now.

Change-Id: I5b531d811271024c750c669c4013865514b2ebeb
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-10-31 08:54:31 +00:00
Liang Qi 87662fd1b7 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/quick/items/qquickevents_p_p.h

Change-Id: I8c699aeb46903e2ea80a97a346cb5af460859a98
2018-10-01 11:59:36 +02:00
Chris Adams 8fd398c9d2 Prevent PathView's parent stealing mouse grab during double-flick
This commit fixes an issue where mouse events could be stolen by the
parent of a PathView due to the PathView not correctly setting the
keep-mouse-grab flag in handleMousePressEvent().  This commit ensures
that the flag is correctly set, so that the second flick in a double
flick is handled by the PathView rather than being stolen by the
parent.

Task-number: QTBUG-59620
Change-Id: Iccdfe16e7e80e6d1d31f95c3dba9c8839b20f30f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-09-24 14:41:38 +00:00
Qt Forward Merge Bot dd333172e2 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I800f39ea59efd6049d3226ec27b8ecb3f6e9ae28
2018-06-29 01:02:07 +02:00
Mitch Curtis 49c244e3c5 QQuickPathViewPrivate: fix heap-use-after-free
The TabBar auto tests in Qt Quick Controls 2 repeats the following
process very quickly for several data rows:

1. Creates a TabBar (PathView, when using the Universal style)
2. Moves items in its QQmlObjectModel
3. Deletes the TabBar

When run with ASAN, this test would fail, because the TabButtons
(which are child items of the PathView) would try to access a deleted
QQuickItemChangeListener upon their destruction.

The underlying issue is that QQuickPathView::modelUpdated() is called,
and before a refill() can happen, the view is deleted.
QQuickPathView::refill() was the only execution path that was releasing
the cached items (QQuickPathViewPrivate::itemCache), and since part of
releasing an item involves removing the QQuickPathView as a change
listener from the item, the item would access the deleted view
(listener) when the item was being destroyed.

This patch fixes the issue by also releasing cached items in
QQuickPathViewPrivate::clear(), which is always called by the
destructor.

Task-number: QTBUG-68964
Change-Id: Ic5bf0943be79948c86bf7c07ef13ecd1a7b971ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2018-06-25 08:08:04 +00:00
Liang Qi 2044d0a03b Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/qml/qml/qqmltypeloader.cpp
	src/qml/qml/qqmltypeloader_p.h

Done-with: Simon Hausmann <simon.hausmann@qt.io>
Task-number: QTBUG-68091
Change-Id: I7c0ab3c9446ac50da07b58f54e24eb4587f7f28c
2018-05-04 10:08:56 +02:00
Lars Knoll fc0582b670 Skip test that is currently asserting on macOS
Task-number: QTBUG-68048
Change-Id: If27ba1c003b711599cd8fbbd000514fc7fd5f05f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-02 14:21:08 +00:00
Lars Knoll 93e9bf9ce7 Skip tests that are currently asserting on macOS
Task-number: QTBUG-68047
Change-Id: Ia75d0db01b89fea87ba23a3144d88bef663cd3d6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-02 14:21:04 +00:00
Liang Qi 8f031fe776 test: fix flaky in tst_QQuickPathView::movementDirection()
Due to heavy load in ci test vm, the animation perhaps didn't
start after QTest::qWait(100).

Task-number: QTBUG-67939
Change-Id: I8c786c82ea41c3d3514ab6bddaefb0c584f35fe0
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-04-27 08:34:27 +00:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
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>
2018-02-26 07:13:18 +00:00
Kevin Funk 9880acb424 Replace remaining Q_NULLPTR with nullptr
Change-Id: I28a32af7f1c306a3002d47025a842475f848c1a4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-17 10:05:23 +00:00
Jake Petroules a763d6a88b Add missing math.h include for math functions
On some platforms, math functions in the std namespace don't work even
if cmath is included.

Change-Id: Ia71d22b07f508e0584de5320f376fbf4b3a2887b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-12 03:40:19 +00:00
Oleg Yadrov 0252d05d06 PathView: fix crash on path remove
There was no check if new path is a valid object

Task-number: QTBUG-53917
Change-Id: I2fd9534c1d34633243d16eda56a2b07e18dabe16
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-11 18:19:02 +00:00
Friedemann Kleint 260f45d539 tst_QQuickPathView, tst_QQuickListView: Fix compiler warnings
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>
2016-12-08 16:27:12 +00:00
Liang Qi d54d28981c Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/qml/compiler/qv4isel_moth.cpp
	src/qml/compiler/qv4ssa_p.h
	tests/benchmarks/qml/qqmlimage/qqmlimage.pro
	tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp

Change-Id: Iad11ce7fdf0c6d200fdebc16a94081bd8069a87a
2016-08-13 00:41:58 +02:00
Anton Kudryavtsev 6f15de1d2d PathView: fix infinite construction/destruction loop
... when all (or almost all) items are in the cache.

When all items are in cache, check lower bound is equal
to upper_bound.

In rare cases, especially when almost all items are in cache,
the inserting code was used (not only appending and prepending).
In this code there was not bound check before creation of item
and there was such situation:

1. Create item by inserting code (without bound check)
2. At the next call of refill() remove this item by life cycle
because this item does not meet the conditions. And go to step 1.

In other words at the first call we create some item, at the second
remove this item. And again.

So we had infinite construction/destruction loop. To break it we
should check position of new item before creation in inserting code
too (like we do in appending and prepending code).

Task-number: QTBUG-37815
Change-Id: I015cdeb67ca5fcd06c34b3145b49cbd3e38d4078
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-12 18:50:22 +00:00
Anton Kudryavtsev 273e5b0bdc PathView: fix item creation
First call of QQuickPathView::refill() did not use currentIndex
for item prepending and there was situation when items were
not created, e.g.:

PathView with current item in center and currentIndex was set
so that item with index 0 was after current item and before path
end. The result of this situation: items from path begin to current
item were not created.

The reason was that idx always equaled (modelCount-1) for item
prepending.

Now first filling uses currentIndex to calculate valid idx.

Task-number: QTBUG-53464
Change-Id: I7e343b0712c9c5c5cd56b1d8e020cf8c0f6e6301
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-12 13:18:51 +00:00
Liang Qi 5caa2d03c1 Quick: expose movementDirection of PathView
It is needed by the behavior of TabBar in universal style in QtQC2.

[ChangeLog][QtQuick][PathView] Added movementDirection property

Change-Id: Iedc214a12e7336e52125ec82b9ded45502905978
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-02 13:14:39 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
J-P Nurmi 9880e74a0c Fix QQuickPathViewPrivate::snapToIndex()
QQuickPathView::setCurrentIndex() set moveReason to "SetIndex", but
snapToIndex() overrode it to "Other". This caused updateCurrent() to
change the current index during snap animation and caused binding
loops in Qt Quick Controls 2.

Change-Id: I6c5f34c69886cb5c234ed78535bb356fbb38b3a6
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-10-22 09:44:55 +00:00
Friedemann Kleint e6846850a5 tests/quick: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: Ib9f4c2486af23c47990be4b9e004b965de226dcc
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-27 18:45:21 +00:00
Friedemann Kleint 0959281be2 Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).
Preparing the replacement of Q[TRY]_VERIFY(a == b) by
Q[TRY]_COMPARE(a, b) for non-boolean types.

Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-27 12:32:49 +00:00
Dmitry Volosnykh 5c90bf6777 Clear stringCache explicitly instead of asserting its emptiness.
This assumption does not hold when PathView's path.pathElements list is
updated with new contents at runtime.

Task-number: QTBUG-46255
Change-Id: I6b0d7ee8ee2d67ca0138eacdf0ad221338f788e4
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-06-25 21:51:21 +00:00
Alan Alpert fa785edbec Remove ordered list assumptions in PathView
When flicking fast or jumping around on paths with some items not seen,
the current algorithm makes assumptions about list ordering which are
hard to maintain. Specifically that it has the index of the first item
in the list cached and that all changed will be to either prepend or
append an item to the current ordered set.

This patch removes that assumption, leading to a little more work each
time to identify where new elements will go. There is still a slightly
faster path for the common case of adding elements to the beginning or
end of the path.

Task-number: QTBUG-42716
Change-Id: Ief76c93967d254d405e6656ef27d06b4ecc470c8
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-05-18 16:16:44 +00:00
Friedemann Kleint a99707bcbe tst_QQuickPathView::mouseDrag(): Skip on Windows if drag fails to start.
The test can be thrown off by external mouse move events which
influence the calculation of the drag distances. It is not clear where
they originate from on the CI.

FAIL!  : tst_QQuickPathView::mouseDrag() 'pathview->isMoving()' returned FALSE. ()
tst_qquickpathview.cpp(1506) : failure location

Change-Id: I398304b5597579033df81e1d0d32b2a3ab5516d6
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-11 21:08:41 +00:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Lars Knoll 2a375c3f54 Stabilize the drag related autotests for higher dpi displays
Higher DPI displays might have a larger StartDragDistance (at
least on X11), breaking the autotest on these displays.

Change-Id: I9768a245a7654665dd9f718100289e9416d8c855
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-09 11:22:28 +01:00
J-P Nurmi cf959b4b4e Repeater & itemviews: fix setModel() JS array handling
QVariant comparison in setModel() started failing because
JS arrays are now passed as a QJSValue. Re-assigning the
same array content should not trigger a model change.

This change restores the old behavior it had before, when
JS arrays were passed as QVariantLists.

Change-Id: I1882b3531f2893b116dbd817edeecab1ae812ce8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-29 21:50:12 +01:00