Commit Graph

2209 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt a43a0cf5e6 Make Font.weight an integer instead of enumeration
The weight in QFont is an integer, allowing you to request a font
of any weight given the predefined scale. In Qt Quick, however, you
were limited to the predefined values.

This is done in Qt 6 because it breaks conversions from string to
weight, as the change in the autotest illustrates.

[ChangeLog][Font] Made Font.weight an integer value rather than limit
it to a predefined set of weights. As a side effect, conversion from
strings to font weights are no longer supported.

Fixes: QTBUG-80402
Change-Id: Ifbe9a0e608b63bfa93bb54999b0b3c1851ccfa88
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-21 07:27:49 +01:00
Eskil Abrahamsen Blomfeldt 15ea475b40 Make FontLoader.name read-only
Being able to set the name of a FontLoader seems to have been made to
allow for some alternative coding patterns, but it doesn't really
provide any convenience over other ways of customizing font names,
and it definitely adds confusion for users, as well as as a possible
race condition if both the source and name of the same FontLoader is
set at unpredictable times.

[ChangeLog][QtQuick] FontLoader.name property has been made read-only
to reduce confusion about its use and precedence over conflicting
properties.

Fixes: QTBUG-80031
Change-Id: I0dd0e76ff376402c0b458ed7e5c57ec017bbc92d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-21 07:27:30 +01:00
Qt Forward Merge Bot 9aceff567c Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ic2cea85917751b89c34768fd80d8b11f5706dd62
2020-01-21 01:00:14 +01:00
Qt Forward Merge Bot 67ac9dead8 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/quick/items/qquickitemview.cpp

Change-Id: Ib9faebdbef5eebb80f4e6aeb5b15b5df7494b157
2020-01-20 09:37:57 +01:00
Qt Forward Merge Bot b9519d9630 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/qml/qml/qqmlvaluetype.cpp
	tests/auto/qml/qml.pro

Change-Id: I78f992f83212bb9fd5e09b64163f15f046185224
2020-01-20 07:04:47 +00:00
Leander Beernaert 1d333d3375 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
2020-01-16 16:25:06 +01:00
Wang Chuan 7b4275b541 QQuickTextNodeEngine: reduce redundant rendering of glyphs
The glyphs between two text blocks that have different text format
will be rendered twice, and in this case the rich text will be display
incorrectly.(e.g., the first text block is a superscript and the
second is a normal text)

Fixes this by reduce the redundant rendering of glyphs between two
differently formatted text blocks

Fixes: QTBUG-80759
Change-Id: I51ca3f7df1ad368d28df9beb6124a87bf50f0e01
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-01-16 15:00:39 +08:00
Ulf Hermann 3f8bcced67 Blacklist tst_TouchMouse::touchButtonOnFlickable() on mingw
Task-number: QTBUG-74517
Change-Id: I9733fe53f65d107c830b2fe47a475b2159a70540
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-15 14:09:29 +01:00
Qt Forward Merge Bot 499c6ed78d Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I3058a6b9347d7ca2a0c04a58cb030ae5c47de415
2020-01-15 12:18:57 +01:00
Wang Chuan a20132c326 QQuickItemView: fix crash when changing model
When visible items become invisible, ListView will try to cache
them and redisplay these items if necessary. However, we can't
cache items when changing to a new model, since the old one will
be deleted later

Fix by adding a flag to let ListView know we are clearing items
and prevent cache unnecessary items

Fixes: QTBUG-80203
Change-Id: I50dcd3f0586c93496b143bdad0e59751360501a8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-15 10:25:21 +08:00
Qt Forward Merge Bot 8a22c92b55 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/imports/folderlistmodel/plugin.cpp
	src/imports/layouts/plugin.cpp
	src/imports/localstorage/plugin.cpp
	src/imports/models/plugin.cpp
	src/imports/particles/plugin.cpp
	src/imports/qtqml/plugin.cpp
	src/imports/qtquick2/plugin.cpp
	src/imports/shapes/plugin.cpp
	src/imports/statemachine/plugin.cpp
	src/imports/testlib/main.cpp
	src/imports/wavefrontmesh/plugin.cpp
	src/imports/window/plugin.cpp
	src/imports/workerscript/plugin.cpp
	src/qml/jsruntime/qv4sequenceobject.cpp
	src/qml/qml/qqmlengine.cpp
	src/qmlmodels/qqmlmodelsmodule.cpp
	src/qmlmodels/qqmlmodelsmodule_p.h
	src/qmlworkerscript/qqmlworkerscriptmodule.cpp
	src/qmlworkerscript/qqmlworkerscriptmodule_p.h
	src/quick/items/qquickitemsmodule.cpp

Change-Id: I5f1fbc3d00e8f583d2c89afc5389de84d68633a7
2020-01-14 11:24:11 +01:00
Qt Forward Merge Bot 51311db1b3 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/quick/items/qquickitemsmodule.cpp
	src/quick/items/qquickitemview.cpp

Change-Id: I02191959a5023c4320f5487a7fb3a71f8711195f
2020-01-14 09:33:22 +01:00
Ulf Hermann 08e0742699 Blacklist touchAndDragHandlerOnFlickable() on OpenSuse 15.0
Task-number: QTBUG-81290
Change-Id: I58f64f5eabdb72f2f01bf72e988941521a89d331
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-10 13:03:13 +01:00
Ulf Hermann 6567ac4362 tst_qquickanimations: Avoid memory leaks
Change-Id: Idc44c6ef91417ec0fe24ec95023f52c8ed61ece0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-10 12:04:01 +01:00
Liang Qi e7650520ef Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	src/qml/jsruntime/qv4engine.cpp
	src/qml/parser/qqmljs.g

Change-Id: I5f89199ef7a846032a3118cba1298de992c22f8f
2019-12-17 07:25:13 +01:00
Qt Forward Merge Bot 67cb80db8e Merge remote-tracking branch 'origin/5.14.0' into 5.14
Change-Id: Ibd935bf31aa2bcb2e4051c865ab946daeeeecddb
2019-12-13 12:46:38 +01:00
Qt Forward Merge Bot 1196b1ef6c Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/qml/types/qqmlbind.cpp

Change-Id: Ib992d1a7ac6c1a96d39819be6f23955dc31b44b2
2019-12-12 10:06:06 +01:00
Ulf Hermann 4720def60d QQuickTextInput: Fix validators test
The behavior of QDoubleValidator has changed in qtbase, in commit
3359b29c99581f52acf033489ad35884a01ccac8.

"12," is not an acceptable input anymore. Adapt the test to
reflect this.

Change-Id: I0daaae2f84325b911263ee0545523ce3cc322049
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-12-11 11:13:30 +00:00
Eirik Aavitsland f372438840 Make inputmask 'X' mask character require non-blank input
The implementation for the X mask would accept any printable
character. Since that includes the blank character, there was no
difference in behavior between the requiring X and optional x: both
would allow the input to be unset, i.e. blank.

This change should be seen in conjunction with the doc improvement
qtbase:da0af1e and the corresponding change to the QLineEdit widget,
where the same input mask handling code is duplicated.

This patch series also concludes the old task questioning whether
text() should strip blanks even when they are valid input (answer:
yes, continue to do that), and so a couple of XFAILS was removed from
the autotest.

[ChangeLog][QtQuick][TextInput] Inputmask X character now requires non-blank input.

Task-number: QTBUG-76320
Change-Id: I606ae04259f29f748b3ce604048c6eb6f10c2ff9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-10 14:43:38 +01:00
Qt Forward Merge Bot 9dee7b331c Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iadbdd0fb63ca2a9e0b186343f8b730e4114cd71b
2019-12-10 01:01:06 +01:00
Richard Moe Gustavsen e1cc06972a QQuickTableView: set empty content size when table is empty
From before we would bail out early from the rebuild process if we
detected an empty table. A result from this is that we left
both contentWidth and contentHeight unchanged.

This patch will set an empty content size when the table is
empty. The effect will be that the user cannot flick the view
around based on the old size.

Fixes: QTBUG-80505
Change-Id: I3ac080476269fd5906ce79fa007eabb59b5ff4b1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-12-09 14:16:07 +01:00
Richard Moe Gustavsen f60f2aaa51 QQuickTableView: ensure we release items in the old model and not the new
As it stood, we would wait to release loaded items until we started the
rebuild process, if the old model was a DelegateModel. But at that time,
the model would alread have been changed, so we would release the items
by calling out to the wrong model.

This patch will ensure that we always release the items immediately when
syncing the model, which will also cover the case when the model is a
DelegateModel.

Fixes: QTBUG-80570
Change-Id: I1b06011f4795727d04d9cd8c20381f65552b8fe8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-12-09 14:16:07 +01:00
Richard Moe Gustavsen 6bc4d55fe1 QQuickTableView: support assigning a DelegateModel
Normally you either assign a model to TableView that
already has a delegate (or don't need one), like
DelegateModel or ObjectModel. Or instead you assign
a QAIM model and a delegate directly. But if you
assign both a delegate and an ObjectModel, TableView
would be confused, and ignore the assigned model
and instead create an internal wrapper model that
ends up empty.

This patch will ensure that we don't create a wrapper
model in such cases, but instead forward the
delegate to whichever model is assigned, even
if it ends up as a no-op for models that don't
use one.

Task-number: QTBUG-80534
Change-Id: Idd220df08617c379dc7808ee1f41c862b78cc201
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-12-09 14:16:07 +01:00
Richard Moe Gustavsen 3770696ce5 tst_qquicktableview: ensure test checks for correct error message
Change 631ef67458 fixed a bug that wrote a wrong error message
to the console. But there is a test that checks for that message
that was also wrong (but for some reason the test passed in the CI,
but it has started to fail locally).

This patch will ensure that the test don't fail because we check
for a wrong error message.

Change-Id: I27e16b0f4aa6a0ffeb8c42f846c344436a41ad3c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-09 14:16:07 +01:00
Qt Forward Merge Bot 8182a8044f Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/qml/common/qv4compileddata_p.h

Change-Id: I1150c8cd0161f0e22137d383013751394ae64e18
2019-12-09 12:22:24 +00:00
Shawn Rutledge 51e02fdc02 Stabilize tst_qquickmousearea::nestedStopAtBounds()
Fixes: QTBUG-78153
Change-Id: Ib8ab2ace4e43f5020059b964951ed11c0f7fc4bd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-08 12:56:06 +01:00
Shawn Rutledge 090f404cf8 Don't let PointerHandler steal touch grab from preventStealing MouseArea
The scenario:
- mouse press: MouseArea grabs; DragHandler gets a passive grab
- drag a little: DragHandler's drag threshold is exceeded
- drag some more: DragHandler tries to take the exclusive grab
This grab takeover succeeded before, because although MA has
keepMouseGrab(), the event being delivered is a touch event,
and MA does not have keepTouchGrab().

If this happens while QQuickWindowPrivate::touchMouseId is the
same touchpoint that the DragHandler is trying to grab, it should
not succeed, because we honor the keepMouseGrab() flag.  I.e.
keepMouseGrab() implies keepTouchGrab() whenever the touchpoint
under consideration is currently the touch-mouse.

On the other hand, if a DragHandler is used on some item inside
a Flickable: on press, the Flickable grabs right away (it has a
bad case of FOMO), but the DragHandler just gets a passive grab.
When the drag threshold is exceeded, DragHandler must be able to
steal the grab from Flickable, because Flickable was just being too
aggressive.  So now we have the rule that if the Item it wants to steal
the grab from is a parent of the type that filters all events,
it's OK to ignore the keepMouseGrab() flag and steal anyway
(as it did before this patch).

Fixes: QTBUG-79163
Change-Id: I2b3f175bea867cb737357857657653b0a7b83995
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-12-06 16:57:40 +01:00
Shawn Rutledge 7cdc3727a2 TapHandler: don't reject stationary touchpoints
Multiple TapHandlers must be able to react to multiple touchpoints.
Often when multiple touchpoints are in contact, some of them will be
stationary.  In that case TapHandler should not give up its active
state, which is the result of returning false from wantsEventPoint().

This partially reverts commit dcc7367997.

Fixes: QTBUG-76954
Change-Id: I836baf771f09d48be8d032472b0c3143e8f7f723
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-12-06 13:46:10 +01:00
Fabian Kosmale db321e7441 QQuickItemView: Emit correct change signal on model reset
As the variable was manually set to -1 beforehand, we would never emit
the change signal, leaving bindings stale. However, simply removing the
assignment would lead to not triggering the signal when currentIndex was
0. So now we set it to -2, which cannot happen in any other place.

Note that QTBUG-64998 was already mostly fixed due to earlier changes
fixing the currentItem part, only currentIndex was still broken

Fixes: QTBUG-68232
Fixes: QTBUG-64998
Fixes: QTBUG-63422
Change-Id: I885e06f1e258e67c3368d017bf79bff760440863
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-12-05 14:09:39 +01:00
Fabian Kosmale 290251541e QQuickPixmapCache: Don't dereference nullptr
Consistently check that job->data is not null before derefencing it.

Fixes: QTBUG-80510
Fixes: QTBUG-79937
Change-Id: I894503ddd2254814463073cc12f8365641efc689
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-05 11:23:52 +01: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
Shawn Rutledge 6ad3445f1e Don't allow dragging a ListView through a floating header or footer
If the header or footer positioning is Overlay or PullBack, the list
delegates appear to scroll underneath it.  The header or footer can
contain interactive content.  If a mouse or touch press happens to
"fall through" that, it should not be possible to drag the ListView
contents from there.

[ChangeLog][QtQuick][ListView] ListView no longer allows the user to
press on an Overlay or PullBack header or footer and start scrolling,
but only on the content delegates.

Fixes: QTBUG-74046
Change-Id: I4d06c789286be2691d098aeebb10a57b2a335744
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-12-04 15:14:04 +01:00
Mitch Curtis e2af7c3b37 Fix ObjectModel item not being rendered when moved between models
When moving an item from ObjectModel A to ObjectModel B, polishes are
scheduled for the respective ListViews in order: the ListView for A
first, and then the ListView for B. However, when it comes time to
do the actual polishing via updatePolish(), the list of items is
traversed backwards. This means that the following calls

    var item = objectModelA.get(0)
    objectModelA.remove(0, 1)
    objectModelB.insert(0, item)

will result in updatePolish() being called for ListView B first, and
then ListView A. As a result of this, setCulled(false) will be called
by ListView B (since the item is now visible within it), followed by
ListView A calling setCulled(true) (since the item is now no longer in
it).

As there is no way for these models to know about each other (and it's
not feasible to store refcounts in QQuickItemPrivate::extraData, since
ObjectModel is in QtQml.Models, which can't know about QtQuick), this
patch makes ListView check if the item is parented to its contentItem
before culling it. This prevents it from hiding items which are no
longer shown in its view.

Change-Id: If50614ebc269fae875195bbc63c0c04dab237775
Fixes: QTBUG-67986
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-12-04 15:00:25 +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
Ulf Hermann 41dd68344c QQuickTableView: Clear items before deleting the model
Fixes: QTBUG-71374
Change-Id: I534b7612268bb9407844961267865f490d7ff7b2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-04 14:08:47 +01:00
Richard Moe Gustavsen c28ec259b7 tst_qquicktableview: fix warning about missing JS function
Change 35fdf3a7b7 added a binding to a function in one of
the QML files used for testing (plaintableview.qml). The
problem is that this file is also used from other places
where we wrap a QSharedPointer that points to the model
inside a QVariant. And when assigning that variant to
a TableView, the QML binding will see the QSharedPointer, and
not the model it points to. And hence complain that the
model doesn't have the API that is exported from the
model.

The easy fix is to just create a new QML file for the
new test added, that has the binding, but assigns
a QVariant that wraps the model directly without
usign a QSharedPointer.

Change-Id: Ic2b77426c2d700479a9b5f4007384661e2ca0801
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-04 13:55:31 +01:00
Richard Moe Gustavsen 1841a9e41d QQuickListView: implement support for reusing items
This patch will implement delegate item recycling in
ListView. The API will be the same as used in TableView, except
that it will be off by default since the behavior of a delegate
that is reused is not compatible with legacy applications
which were not written with this in mind.

Most importantly:

- Component.onCompleted will only be called on a delegate the
first time it's created, and never when it's reused.

- Any user-declared properties in the delegate (that is, not
model roles, index, etc) will not be cleared or updated when an
item is reused. The application must do this manually upon
receiving the pooled or reused signal in the item.

[ChangeLog][ListView] ListView now has support for reusing delegate
items. This can be switched on by setting the reuseItems property of
ListView to true.

Task-number: QTBUG-80507
Change-Id: I68cc8300b050e4a1f89feebb1d31a2fd9189c793
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-04 01:35:02 +01:00
Qt Forward Merge Bot af9a96ca10 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4e4464d785c8c4a0d06ffaaff3e1cdd94e1c179a
2019-12-04 01:00:41 +01:00
Fabian Kosmale 705e80b702 QQuickItemView: Set moveReason to other on model change
This implements Michael Brasser's suggestion in the bug report.
As there do not seem to be other bug reports related to the
fixupPosition change, this might already be enough.

Fixes: QTBUG-66163
Change-Id: Iee45621ff7081b280626f4a81dab9bd36a7ea6b7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-03 15:42:22 +01:00
Ulf Hermann a2f7de70d6 QQmlDelegateModel: Read values from the correct object
If we have a proxyObject, we need to use that one for reading proxy
values. Otherwise the read operation will crash.

Fixes: QTBUG-80420
Change-Id: I88cd5499802bff1aea2e43da9ab61d6565ab7ede
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-12-03 10:03:52 +01:00
Jan Arve Sæther bd7ce75f26 Do not emit inputMaskChanged when setting the same input mask
If you did not specify a blank character (e.g. "; " as suffix) it would
internally add that suffix to the property, resulting in that the
property itself actually got a "; " suffix even when not specified.

So when setting the same input mask again, it wouldn't match the
existing inputMask property, and it would emit inputMaskChanged again.

Change-Id: Ia47d63d56c640b4be9d6d0a704ddfaff01befbdb
Fixes: QTBUG-80190
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-02 15:43:01 +01:00
Shawn Rutledge 23df1603f5 MouseArea: react to touch ungrab
If an event handler (such as DragHandler) takes the exclusive grab
of a touchpoint that MouseArea had already grabbed as a synth-mouse,
it should react in the same way as if its grab of the actual mouse was
stolen: release the pressed state, etc.

Fixes: QTBUG-77624
Change-Id: I51f4fb253f7d0377be421c23e617942507616e72
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-12-02 16:34:34 +02:00
Qt Forward Merge Bot 2a809ef657 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic754916ddc223c6ce20f0298eec02a3513fc0222
2019-11-29 01:00:06 +01:00
Shawn Rutledge 0012f8bd15 MultiPointTouchArea: stop ignoring Qt-synthesized mouse events
We ignored them because we assume that if a touch event is sent first,
the MultiPointTouchArea will handle it; and then if a synth-mouse event
is sent afterwards for some reason, it's irrelevant to MPTA.  However:
1) A synth-mouse event should not actually be sent, because MPTA accepts
the touch event. 2) If Flickable is used with pressDelay set, Flickable
will send the delayed press in the form of a mouse event (it does not
know how to replay a touch event at all). So if MPTA is used in a
ListView delegate for example, it's necessary for MPTA to react to a
synth-mouse event during replay. In both the press delay replay
and QTabletEvent scenarios, the mouse event has source() set to
MouseEventSynthesizedByQt, so MPTA needs to handle those events.

After a synth-mouse event during replay, MPTA can still receive an
actual touch release, which thoroughly confuses its pre-existing logic.
In that case it helps to check whether the touchpoint ID is the same as
QQuickWindowPrivate::touchMouseId, handle the release of that point, and
also release the internal synthetic _mouseQpaTouchPoint which was
remembered from the mouse press.

Fixes: QTBUG-75750
Fixes: QTBUG-78818
Change-Id: I8149f8b05f00677eb07a2f09b725b1db5f95b122
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-11-26 11:24:22 +01:00
Qt Forward Merge Bot e80067f265 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/qml/qmldirparser/qqmldirparser.cpp
	src/qml/qmldirparser/qqmldirparser_p.h

Change-Id: Ia68a8d4f345e6e456eebc3f215fc90d3819ddd70
2019-11-26 09:11:06 +01:00
Leander Beernaert f1f395b37d Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I48b9c2e4f3a75c18470c55f73f2089dc1401de54
2019-11-25 15:34:40 +01:00
Friedemann Kleint c0a8c84eb4 Avoid initializing QFlags with 0 or nullptr in further cases
Amends 744e77b841.

Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-25 13:35:32 +01:00
Ulf Hermann b7030c2efb QQmlDelegateModel: Use cache item's index for resolving delegates
The raw index doesn't take the filter group into account.

Fixes: QTBUG-78297
Change-Id: Ie6514c8acdc380fe3f8f267d02335afc357abd17
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Joshua GPBeta <studiocghibli@gmail.com>
2019-11-23 17:19:59 +01:00
Ulf Hermann 662ab7ebda QQmlDelegateModel: Set extraObject only if required properties given
Otherwise we would set the same object as extraObject and as
contextObject. That spells trouble when tearing down the context.

Fixes: QTBUG-79958
Change-Id: I97fd0bf111304d06cff35eda46d4b4c6eefdaccc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-11-22 12:15:15 +01:00
Liang Qi aa3813366a Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/qml/qml/qqmlextensionplugin.cpp
	tests/auto/quick/qquicktableview/tst_qquicktableview.cpp

Change-Id: Ic58d36a8532015bae30f2690063db9829b3bf372
2019-11-22 09:50:11 +01:00
Kari Hormi acb6ed0815 TableView: use fetchMore() when scrolling to the end of the table
QQmlTableInstanceModel implements canFetchMore and fetchMore functions,
but these are not called at any point in QQuickTableView. This change
checks if additional data can be fetched when atYEndChanged signal is
emitted.

Fixes: QTBUG-78273
Change-Id: I49b41b09d9a218826b34f32cd9fe4724a6097b52
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-20 12:45:34 +02:00
Alexandru Croitor ba494aaa24 Regenerate all projects with new CMake API version
Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:51 +00:00
Qt Forward Merge Bot 0ee087f5a5 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ibb3be39cbdaf363f017fdfd62e4647acbc3443cb
2019-11-15 01:02:20 +01:00
Alexandru Croitor 387f360b3b Regenerate tests
Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:22:34 +00:00
Richard Moe Gustavsen 35fdf3a7b7 QQmlTableInstanceModel: always emit index changed when an item is reused
When reusing a delegate item, it can sometimes happen that the item
ends up being reused at the same location in the table as it had
before it was pooled. And in that case, we don't emit changes to
index, row and column since they technically didn't change.

The problem is that the model might have changed in-between, e.g if
a row has been removed. And in that case, row and column will, even
when unchanged, point to other parts of the model. So all bindings
needs to be reevaluated to ensure that the values they use are
refreshed.

This patch will therefore ensure that we always emit changes to
the mentioned properties when an item is reused, regardless if
they change or not.

Fixes: QTBUG-79209
Change-Id: Icec201a43a30b9f677303fbf652baf6487621deb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-14 11:19:26 +01:00
Qt Forward Merge Bot 1619b7d207 Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: I06578422b4558feabf7a77426b01e77953ab60e2
2019-11-14 09:50:24 +01:00
Michael Brasser 2c6966c775 Allow AnimatedSprite to finish on the last frame
[ChangeLog][AnimatedSprite] Add finishBehavior to allow a sprite to
finish on the last frame.

Task-number: QTBUG-59090
Change-Id: Id45e879cdc4905f43e2ac3cb2529181390d47aab
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-13 12:03:53 -06:00
Jan Arve Sæther 554309a1c1 Qt Quick Layouts: Do not assert when specifying an invalid row/column
We now print a warning and try to gracefully handle it

Change-Id: I66e79fe918808f5fede78a23df50e9e95b7b832d
Fixes: QTBUG-67204
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-13 15:11:13 +01:00
Richard Moe Gustavsen 91eb02eca2 autotest, tableview: silence compiler warning
Change-Id: I311f0c21baa73521717ad98b2398d5469b9ac208
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-12 14:46:54 +01:00
Richard Moe Gustavsen 8952800c68 QQuickTableView::forceLayout(): rebuild table if the size of the model has changed
An assert will trigger if forceLayout() is called while the model is
being reset. The reason is that the forceLayout() schedules a relayout
which assumes that the size of the model hasn't changed. But while
layouting, it will try to fetch data from the model according to the
old size, which will trigger an assert.

This patch will add an extra path to forceLayout() that checks if the
size of the model has changed, and if so, schedule a complete
rebuild instead of just a relayout.

Fixes: QTBUG-79395
Change-Id: If61658912d9e90c1a5aef9bc28083da20fa6ec76
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-12 14:46:41 +01:00
Qt Forward Merge Bot 53db1ef8d6 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp

Change-Id: I1c0c7c44053bf3d5f8f9723662bd0fe67253c8ae
2019-11-08 08:16:27 +01:00
Ulf Hermann b7c2d5dfa6 Blacklist tst_qquicktextedit::mouseSelectionMode on OpenSuse 15
Task-number: QTBUG-78846
Change-Id: I74d0f35b5ee1d22b10564c28edeb833689bbc6d9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-07 12:21:24 +02:00
Liang Qi 50bce248ab Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
	tests/auto/quick/qquickloader/tst_qquickloader.cpp

Change-Id: I85fd38cfa00cd60197a1c981bfcc16fcb896cfe9
2019-11-07 07:17:40 +01:00
Mitch Curtis b802031e2d QQuickAccessibleAttached: keep track of name being explicitly set
This allows types to attach an accessible name to an item, so long as
the user hasn't done so themselves.

Task-number: QTBUG-66583
Change-Id: I04f26815ffeaf1198fee25dc414253de8b8dfabe
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-11-06 13:43:50 +01:00
Timur Kristóf b25c27d37a Add API to get more information for each line in a QML Text element
Previously there was no way to know what area is occupied by each line
in a QML Text element.

This commit adds new API to expose implicitWidth and isLast
on QQuickTextLine for use in the lineLaidOut signal.
It also adds improved documentation to the lineLaidOut signal and
an example usage of the new API to the text layout example.

An example use case of the new API is eg. to allow embedding
timestamps and indicators within a text paragraph, to enable
creating more efficient layouts.

[ChangeLog][QtQuick][Text] Added new API that exposes implicitWidth,
and isLast on the QQuickTextLine for use in the lineLaidOut signal.
This allows the user to layout other items relative to the lines
of text.

Fixes: QTBUG-78277
Change-Id: Ibc754db17c78efb01468106aba32e30d70d2f4df
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-04 09:39:10 +02:00
Michael Brasser bd62eff7ca Cleanup and document AnimatedSprite::start()/stop()
Change-Id: I3acbff54ca7b2131b84ab739f99ac982ebda65ea
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-11-01 10:26:42 -05:00
Qt Forward Merge Bot 9c050d4529 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	.qmake.conf
	src/qml/common/qv4compileddata_p.h
	src/qml/types/qqmlbind.cpp
	tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp

Change-Id: I6a137907e63445f17a3d6181b832a6bd76135bb2
2019-10-31 09:44:09 +01:00
Fabian Kosmale 234dbbf255 QML Drag: Prevent crash when using image provider url
For attached property objects, qmlEngine will not return an engine.
However, QQuickDragAttached's parent is the object to which it is
attached, and from that one we can get the engine.

Fixes: QTBUG-72045
Change-Id: I40748dd11ea3eb4604c37e932b2cfd3baad6fd1f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-30 09:17:36 +01:00
Fabian Kosmale 73ad6e87bb QQuickItem::setParentItem: add child earlier
Calling (de)refWindow can trigger QQuickItem::windowChanged, which in turn
can call a user defined windowChanged handler. If that signal handler
were to call setParentItem, we would encounter an inconsistent state:
The item already has its parent set, but that parent would lack the item
in its children list (as we would only call refWindow at a later point).

Fixes: QTBUG-79573
Fixes: QTBUG-73439
Change-Id: I46adaa54a0521b5cd7f37810b3dd1a206e6a09c6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-29 07:00:49 +00:00
Jan Arve Sæther 032c356ec9 Add missing emits from various property setters in {Grid,Row}Layout
Change-Id: I3ac473b3d46ff1f898c1607deb6ad3d586753244
Fixes: QTBUG-79359
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-25 14:37:21 +00:00
Fabian Kosmale b6d88c73c4 Loader: Actually clear initial properties when changing source
Fixes: QTBUG-79435
Change-Id: Ic99a3b1a9d64426a64117b90a3e11fe99af0d260
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-24 13:24:55 +02:00
Simon Hausmann a0053574de Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Id367db23bce79e0db92c35fa672c0d5c06887fef
2019-10-18 22:03:00 +02:00
Friedemann Kleint 164a890573 Handle -no-feature-shortcut
Preparing for the extraction of QGuiShortcut, the shortcut
feature will changed to follow the convention of using
QT_REQUIRE_CONFIG(shortcut) in the affected class headers.

Add the required exclusions to prevent compile errors
when disabling shortcuts.

Task-number: QTBUG-76493
Change-Id: Icad95584ae12aa97a56b56ef27206cef1b1ba48f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-10-18 13:55:02 +02:00
Qt Forward Merge Bot a298b4dc5f Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I0376b25557ba633e5b148c6e9c467d88fae1778f
2019-10-17 01:00:10 +02:00
Qt Forward Merge Bot 67481cae7e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I6e69a235f50472b8f7ac19e133a3c071ea8c4d7a
2019-10-16 01:01:37 +02:00
Qt Forward Merge Bot b08809b521 Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: I7759f6b60f8fda6525b239c7ee2e034194d4ab85
2019-10-15 01:00:06 +02:00
Alexandru Croitor 30917cd20c Regenerate required projects after dev -> wip/cmake merge
Change-Id: Ic5f1909731ec11b4fb6bc8823506d272c529ecfb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-14 19:01:42 +00:00
Alexandru Croitor c2f8b9535d Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml because we don't use it yet in wip/cmake.
Fixed conflict in qmlcachegen.cpp.

Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
2019-10-14 19:02:37 +02:00
Qt Forward Merge Bot d6cbf42e37 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I3a13e84b77e1c6c3a85ef000d2bfbadbc72651bb
2019-10-12 01:00:20 +02:00
Fabian Kosmale 0d403890a4 ParentChange: Restore old position correctly
ParentChange does floating point math in doChange to calculate the
correct position. Unfortunately, while doing the conversion, we
accumulate rounding errors in the presence of rotations.

Those can lead to visual glitches, as observed in QTBUG-68176.

This patch avoids the issue by storing the old values and resetting to
them in restore.

Fixes: QTBUG-68176
Change-Id: I6ebe1ccbc601838aa664cdc723e0cd58c95e785a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-11 16:51:49 +02:00
Alexandru Croitor 6a0bb9a7d6 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
2019-10-11 16:21:42 +02:00
Fabian Kosmale 04b0d1b217 QQuickTextInput::remove: Fix selection logic
Fixes: QTBUG-77814
Change-Id: I96b8990656117430eb12fc4b294a8ece612d3a4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-11 15:48:50 +02:00
Qt Forward Merge Bot 5bb77e39c7 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ib623d34a523b3f2956561f583e19c92f34ab21b4
2019-10-11 01:00:32 +02: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
Qt Forward Merge Bot 1bddf29287 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I2835748c27616103f275849141fbe5a93e3dfd8c
2019-10-10 01:00:21 +02:00
Stephen D'Angelo 3fde977a81 QQuickWindow: Higher z-order items now steal drop target
Previously, an active drop target would remain the drop target until the
drag left it's area, or entered a child item that accepted a
DragEnterEvent, even if the drag entered a drop target with a globally
higher z-order from a different subtree.

When moving to an item with a higher z-order, the DragEnterEvent is
now sent to the new drop target before DragLeaveEvent is sent to the old
drop target.  There can now only be one drop target.  If an item is the
current drop target and a higher z-order child accepts the DragEnterEvent,
the parent is no longer a drop target.

Fixes: QTBUG-30305
Change-Id: I7b985d6317be70867e7727222a4cd44ace7559e6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-09 19:23:31 +00:00
Teemu Holappa 6b6ef3a841 Send ShortcutOverride event when receiving a non-spontaneous key press
This is a very similar fix what's been done to the widgets to fix
QTBUG-48325. In QQuickWindow there is added the sending of
a ShortCutOverride even when a non-spontaneous KeyPress event
is received.

Task-number: QTBUG-78304
Change-Id: Icb267e611248460533f20e84deef71da6b481cd2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-09 20:02:05 +03:00
Shawn Rutledge 2d9cf3ef0f When a DelegateModel delegate changes, refill the view
It looked a bit odd that the DelegateModel delegate property was not a
notifying property.  Adding the delegateChanged signal makes it easier
to update the view when this happens.  The previous approach of removing
all delegates and adding all new ones resulted in the view losing its
currentIndex and often scrolling to a different place.  It's also nice
to reduce the number of d-> indirections by adding the
QQuickItemViewPrivate::applyDelegateChange() function, so that we just
need one indirection to call it, and then it updates all the internal
stuff in one place.

Done-with: Frederik Gladhorn
Done-with: Joni Poikelin
Fixes: QTBUG-63477
Change-Id: I2d17fd11ff4a2fcb20968a7182dd2c403abb715a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-10-09 18:58:18 +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 1b71204d81 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I68014bc552793b6dea930744325876a8863aaef3
2019-10-09 01:01:34 +02:00
Fabian Kosmale a02b5d48cf tst_qquickmousearea: avoid calling setContextProperty
Change-Id: I0ee4506d58afa5f12455410904275089638e26c0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-08 12:50:10 +02:00
Jan Arve Sæther 8b9a67dd7b Fix bug when highlight was not respected after currentIndex changed
QQuickListViewPrivate::fixup() seems to only do "fixup" if

  moveReason != QQuickListViewPrivate::SetIndex

By default, moveReason is set to Other. In the snippet given in
QTBUG-77418, this is why the highlight was respected when resizing the
ListView initially. However, after the currentIndex was changed,
moveReason was changed to SetIndex. When we then resized the ListView, it
still had the value SetIndex, and would fail to "fixup" properly.

Since the ListView preferredHighlightBegin is bound to width, we should
set moveReason to Other in the property setters that are related to
highlight. This is then consistent with how setCurrentIndex() does it (it
similarly sets d->moveReason = QQuickItemViewPrivate::SetIndex;)

Change-Id: I7edf77fc977e8c7e3fc656ff5bb22b4dd01afbe4
Task-number: QTBUG-77418
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-10-08 11:07:42 +02:00
Liang Qi 7e17fb2ded Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp

Change-Id: Id2e81000bcbd4de18fe22b085fdf5eed42c02516
2019-10-07 13:10:18 +02:00
Fabian Kosmale 52d93254e7 tst_qquickpositioners: avoid setContextProperty
Change-Id: I181914d2534f3eff90acaed6163b0f11c37302c8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-07 07:51:36 +02:00
Fabian Kosmale 0bbd52ac6f tst_qquickflickable: avoid setContextProperty
Change-Id: Iaf123e647143275cfc9efcd39a1cd5944d599972
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-07 07:51:29 +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
Qt Forward Merge Bot a6f389bd7a Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ie250bf60cc934de765b105b477c2cc7ebcb3380d
2019-10-02 01:01:02 +02:00
Ulf Hermann 201ea73049 Quick: Move BoundaryRule into labsanimation
We don't want to mix multiple modules in the same library anymore.
QtQuick should only contain types to be registered under QtQuick.
Otherwise we cannot automatically generate the type registrations.

Change-Id: I6a8e20fe8f7d01600232439a10168ef4298fc6b4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-27 09:07:22 +02:00
Shawn Rutledge ae346195ef Handle "interesting" stationary touchpoints as if they moved
Qt Quick will not receive "uninteresting" stationary touchpoints, but
only those in which some property has changed. So MultiPointTouchArea
should react to stationary touchpoints in the same way as if they moved,
so that UIs can react to changes in touchpoint velocity, pressure etc.
And QQuickWindow has to be willing to delivery stationary touchpoints
to make this possible. However when a QTouchEvent is customized for
delivery to a specific Item, by including only the touchpoints that
are inside the Item, then if those touchpoints are all stationary,
the event only needs to be delivered if at least one of them is
an "interesting" stationary touchpoint. So we need to depend on
a new per-touchpoint flag that QGuiApplication will set when it
discovers that some property of the touchpoint has changed. That is
QTouchEventTouchPointPrivate::stationaryWithModifiedProperty.

Fixes: QTBUG-77142
Change-Id: I763d56ff55c048b258dca40d88283ed016447c35
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-09-24 16:33:56 +02:00
Shawn Rutledge a439a25f46 Ensure AnimatedImage currentFrame/onCurrentFrameChanged 2.0 compatibility
Change 5d995ae122 did not make the actual
QQuickImageBase::currentFrameChanged signal accessible to the Qt Quick
2.0 revision. Normally the QML engine would implement a JS
onCurrentFrameChanged handler by connecting to the currentFrame
property's frameChanged notifier signal; but in this case it tried to
connect to the explicit QQuickImageBase::currentFrameChanged signal
instead (because the name is a better match), and failed because of the
revision. So we need another duplicate unrevisioned signal
QQuickAnimatedImage::currentFrameChanged for use when the import is less
than Qt Quick 2.14.

As pointed out during review, an autotest for the revisioning is good to
have anyway.

Fixes: QTBUG-78713
Task-number: QTBUG-77506
Change-Id: I121508acac81d47e3c0a4c0ed12257c10b30970b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-09-24 10:13:40 +02:00
Wang Chuan 8f1857f907 QQuickMouseArea: fix containsMouse when mousearea become visible
If enabled is false, then containsMouse will not become true when
hovering on mousearea, even if hoverEnabled is true. However when an
invisible mousearea become visible, the value of enabled isn't
checked. In this case, the value of containsMouse is not affected by
enabled.

[ChangeLog][QtQuick][QQuickMouseArea] containsMouse property will
not become true when the an invisible mousearea become visible, if
the enabled property is false or its parent item is not enabled

Fixes: QTBUG-77983
Change-Id: I923bdcf3eda813aea51a04515d530093d6eb77b2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-09-23 20:07:46 +00: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
Qt Forward Merge Bot a510c9c9f4 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I801567c11fcc3244a1ee7dabeb5079d49fc5c3a1
2019-09-22 22:29:02 +02:00
Shawn Rutledge ab5df626be Add dragThreshold property to Event Handlers
We need drag threshold to be adjustable on each handler instance instead
of relying only on the system default drag threshold. For example in
some use cases DragHandler needs to work with a threshold of 0 or 1 to
start dragging as soon as the point is pressed or as soon as the point
is moved, with no "jump", to enable fine adjustment of a value on some
control such as a Slider.

This involves moving the dragOverThreshold() functions that handlers are
using from QQuickWindowPrivate to QQuickPointerHandlerPrivate, so that
they can use the adjustable threshold value.

Task-number: QTBUG-68075
Change-Id: Ie720cbbf9f30abb40d1731d92f8e7f1e6534eeb5
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-09-19 15:37:11 +02:00
Simon Hausmann 83be211744 Merge remote-tracking branch 'origin/wip/qt6' into dev
Change-Id: I10c4b7fcfa0397d999d45e310c2f8f051d57d4d2
2019-09-19 08:53:00 +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
Qt Forward Merge Bot cd9c5c2bf9 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/qml/jit/qv4baselinejit.cpp
	src/qml/jsruntime/qv4vme_moth.cpp
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

Change-Id: Iec7cd27ddad0281bd3b7833fb6b252f66a6ae5d6
2019-09-17 09:58:09 +02:00
Mitch Curtis 69f62dc8ef tst_gridlayout.qml: use createTemporaryObject()
Ensures that items created in a function are destroyed upon failures
in that function, and results in less code.

Change-Id: I62b3b7c3a19dbb2128c5c45bdc7adf4fe80df70d
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-09-12 21:30:04 +02:00
Mitch Curtis b1b284e3ce tst_gridlayout.qml: convert to a proper data-driven test
Change-Id: I9f2ccd3d4e6933d68b03d82c2c319aa2e8951e78
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-09-12 21:29:58 +02:00
Qt Forward Merge Bot 9a1e4ffa66 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I6472cd72b27c69257efe54376e428274ebf68050
2019-09-12 19:49:23 +02:00
Fabian Kosmale ba30971c7e qquicklistview: support required properties in sectionDelegate
This changes the accessibile properties in the sectionDelegate:
If the sectionDelegate contains requiredProperties, "section" will not
be injected into a newly created parent scope.
Instead, the section property of the delegate will be set if it exists.

Change-Id: I34b04d08d2f80af7ea53fd722f08be0f9aea6e72
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-09-12 17:41:17 +02:00
Ulf Hermann c950ce0daf Blacklist tst_qquickmousearea::nestedStopAtBounds on opensuse 15.0
Task-number: QTBUG-78153
Change-Id: Ifdca53d4eed452067ba7f75ae0b3e74cf2027895
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-09-12 15:45:09 +02:00
Ulf Hermann a852ec4fd0 Blacklist tst_qquicktextinput::mouseSelectionMode on OpenSuse 15.0
Task-number: QTBUG-78162
Change-Id: I8b4f536583afba889a9225d257900031c21ba9e0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-09-12 15:45:01 +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
Liang Qi c80eb38354 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/qml/jsruntime/qv4engine.cpp
	src/quick/handlers/qquicktaphandler.cpp
	src/quick/items/qquicktableview.cpp

Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Done-With: Ulf Hermann <ulf.hermann@qt.io>
Done-With: Shawn Rutledge <shawn.rutledge@qt.io>
Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
2019-09-12 08:01:21 +02:00
Fabian Kosmale 2f3b4ec528 Introduce required properties to QML
[ChangeLog][QtQml]
"required" is now a (contextual) keyword in QML, and users can
mark properties with it to specify that those properties must be set
when the component gets instantiated.
This can be done either declaratively via standard property
bindings from QML, or imperatively by using the functions to set initial
properties (QQmlCompoent::setInitalProperties and related functions in
C++, Qt.createObject, Loader.setSource,... in QML/JS).
Logic has been added to QQmlComponent::create and the various QQmlIncubator
classes to verify that the required properties were set. If properties
marked as required are not set, a warning will be printed at runtime,
and the component will not be created.

Change-Id: I8e38227fc8f173b053b689c1597dc7fd40e835e7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-09 09:21:23 +00:00
Ulf Hermann 2746518c76 Merge remote-tracking branch 'origin/dev' into wip/qt6
Conflicts:
	.qmake.conf
	src/qml/qml/qqmlengine.cpp
	src/qmlmodels/qqmlmodelsmodule.cpp

Change-Id: Id60420f8250a9c97fcfe56d4eea19b62c6870404
2019-09-05 11:08:59 +02:00
Qt Forward Merge Bot 7d96bae85e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Icc46cb06ac1dbe7097d11bc0db5813eb39fbf758
2019-09-05 08:58:55 +02:00
Shawn Rutledge e81ff5732f PathMultiline: handle directly-bound QVector<QPolygonF>
The autotest in 811b15bd16 only tested
what happens if the vector of polygons is passed via a QVariant to the
PathMultiline paths property.  But the intention (as documented) was to
literally support an object with Q_PROPERTY(QVector<QPolygonF> paths ...)
and binding that paths property to PathMultiline.paths.  In that case
it appears in QQuickPathMultiline::setPaths() as a QVariant<QJSValue>,
canConvert<QVector<QPolygonF>>() returns false, then
canConvert<QVariantList>() returns true.  Nevertheless each variant
in the QVariantList is a QPolygonF, as expected.  So we need another
check to detect this case.  Also added a test specifically for that.

Fixes: QTBUG-77929
Change-Id: I84d0a45326d5f007b8ba3cc9bb1fbccf0345d812
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
2019-09-03 17:33:32 +02:00
Shawn Rutledge 811b15bd16 PathMultiline: allow lists/vectors of polygons or point lists/vectors
If a C++ model object can make a vector of vectors of points available
directly, and it is bound to a PathMultiline's paths property to provide
the view layer, it's a waste of time to convert it to a QVariantList of
QVariantLists and back again.  Changing the type of the property to
QVariant instead of QVariantList enables an extensible set of supported
types: all those that make sense.

Fixes: QTBUG-77929
Change-Id: If749c2171173e7b9933fc9ecdf6d2741dc1c7500
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
2019-09-02 22:23:03 +02:00
Shawn Rutledge 6dc319155a Enable PathPolyline to take a QPolygonF or QVector<QPointF> path
If a C++ model object can make a vector of points available directly,
and it is bound to a PathPolyline's path to provide the view layer, it's
a waste of time to convert it to a QVariantList and back again. Changing
the type of the property to QVariant instead of QVariantList enables an
extensible set of supported types.

Task-number: QTBUG-77929
Change-Id: I2453b59e047ec3310070e943f6934c9ddcd1ffaa
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
2019-09-02 22:22:35 +02:00
Wang Chuan 35acc9fc3c QQuickTextNodeEngine: don't create background when its alpha is 0
If the alpha value for the background color of a text element is 0,
we don't need to create a rectangle node to represent it, as the
rectangle will be invisible anyway.

[ChangeLog][QtQuick][QQuickTextNodeEngine] don't create a new
rectangle node as the background of text, when the alpha of it is
0

Fixes: QTBUG-76137
Change-Id: I40c624ee8f61740fd07e7d3751a78b6224882913
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-29 07:25:45 +08:00
Richard Moe Gustavsen da04b1d716 QQuickTableView: always relayout after a rebuild
The current logic was based on the idea that if both rowHeight-, and
columnWidthProveders were set, we didn't have to relayout the items
at the end of a rebuild. Because in that case, the row and column sizes
would already be correct after the initial load.

This assumption turns out to be false, because the providers are
allowed to return -1 to signal that the size of a row or column should
use default values (meaning, calculated by TableView). And for those
cases, we need to do a relayout at the end of a rebuild.

Fixes: QTBUG-77074
Change-Id: I0e0f2fdca1cfa9e98f2a0a2b227c3715c16a70f9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-08-28 10:53:07 +02:00
Jan Arve Sæther cfa2c53bc0 Make mouseSelection test more stable
QTestLib assumes that the double click interval is below 500ms. Therefore
it adds a 500ms delay after all synthesized single- and doubleclick
releases to prevent unintentional synthesizing of double click events.

This has two unfortunate side-effects:

1. If the double click interval is smaller than 500 ms, it is not possible
to synthesize a triple click. (Triple clicks are used for selecting
paragraphs in text). This is why the workaround in the block (if clicks
==2) was needed.

2. If the double click interval is bigger than 500ms we might still
accidentally trigger a double click event with two successive single click
events, so it doesn't even work reliably for that case (!). Therefore, the
hardcoded 500ms in QTestLib should probably be revisited.

Anyway, to fix this test we therefore have to cancel the 500ms delta
QTestLib adds in order to properly synthesize the triple click by
adjusting the internal QTest::lastMouseTimestamp.

Task-number: QTBUG-77389
Change-Id: Ic738f51b294270ddf99b6d91d256f6ec4b34d039
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-28 09:35:12 +02:00
Ulf Hermann 76282f480e Use qmlRegisterAnonymousType in examples and tests
Change-Id: I511d18ad8f73ea77a208e4448a8f86e5be5facc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-27 16:20:55 +02:00
Shawn Rutledge 826177ecca Stabilize image and borderimage multiFrame tests
There are various problems on QEMU: color depth may not be 32-bit,
and for some reason grabWindow isn't always working.

Task-number: QTBUG-77817
Change-Id: I10db56e93643722d1d6a85e66b9dd552ee654432
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-24 12:26:31 +02:00
Shawn Rutledge 5d995ae122 Move currentFrame and frameCount properties up to QQuickImageBase
AnimatedImage already had these properties, but some typically non-animated
image formats such as PDF, TIFF and ICO can also support multiple pages.
In either case, the currentFrame property can be used to select a specific
frame or page.  However an AnimatedImage uses a QMovie to do that, whereas
a plain Image uses QQuickPixmap.  So the accessors need to be virtual in
order to have these different implementations.

[ChangeLog][QtQuick][Image] Image and BorderImage now have currentFrame
and frameCount properties which can be used to step through the frames of
multi-page image formats such as TIFF, WEBP and ICO.

Task-number: QTBUG-77506
Change-Id: Id4d95a99a26a862957e44b1bd8ffe06d7eababef
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-24 12:26:20 +02:00
Sona Kurazyan 506b4093b4 Remove usages of deprecated APIs of QWheelEvent
Task-number: QTBUG-76491
Change-Id: I69b0c4ec7c03f9421b18828516e064eff2b45518
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-23 22:42:35 +02:00
Jan Arve Sæther 9655f7fdc9 Fix flakiness in QQuickTextEdit::mouseSelection
Avoid that the last click from the previous test data and the first
click in the current test data happens so close in time that they are
interpreted as a double click.

Task-number: QTBUG-77389
Change-Id: Ia2d159452dcdb58cacccf7101cc3360175b39594
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-21 08:20:01 +00:00
Qt Forward Merge Bot b94b547ad2 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I9ce3eee3d6f88783b9e20110a2814bee805291a4
2019-08-20 01:00:07 +02:00
Fabian Kosmale 1c59558b03 Introduce functions to set properties during creation
Change-Id: Idd4c8ab9e34b9bc3e00f21d7cf1e4f1a70586e7f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-19 11:38:24 +00:00
Alexandru Croitor 2be575b4b1 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I6f2152aeecaeb8e63fdbc1cdf1444132a054b6f5
2019-08-15 18:44:54 +02:00
Leander Beernaert 4e14f6e70a Add QtDeclarative Test Coverage
All tests compile and run on a developer build.

These tests are failing:
tst_qqmlsqldatabase Fails due to missing sql driver
tst_qqmlsqldatabase Fails in wip/qt6
tst_ququicklayouts Fails in wip/qt6
tst_flickableinterop Fails in wip/qt6
tst_qquickpinchandler Fails in wip/qt6
tst_qquickflickable Fails in wip/qt6
tst_qquickgridview Fails in wip/qt6
tst_qquickimage Fails due to missing jpeg plugin
tst_qquicklistview Fails in wip/qt6
tst_qquicktext Fails in wip/qt6
tst_qquickcanvasitem Fails in wip/qt6
tst_scenegraph Fails due to missing jpeg plugin
tst_TestFiltering Fails in wip/qt6

Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-14 14:01:58 +00:00
Fabian Kosmale bef4800768 Blacklist tst_qquicktextedit::mouseSelection in openSuse leap
This autotest is blacklisted as it is deemed flaky.

Task-number: QTBUG-77389
Change-Id: I3561c98f0248507755f99fd7b6fe24c3d24cb522
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-08-12 11:15:53 +00:00
Alexandru Croitor 36990a732e Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I507e252f9cb11b75dd9f7f409c39d93094e8c3ef
2019-08-09 16:20:22 +02:00
Alexandru Croitor cb37a1d0c3 Fix the blacklisting of tst_qquicktext::contentSize
The correct keyword set for blacklisting a test on mingw is
"windows gcc" not "win32 gcc".

Amends db8fc6e854

Change-Id: Idad4c9370b7d4c09acde160e6053191df7ee1aad
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-09 11:04:47 +02:00
Alexandru Croitor db8fc6e854 Blacklist a failing test on MinGW 7.3 configuration and Qt 6.0
It's something to do with calling
QQuickText::setElideMode(QQuickText::ElideRight) not causing a width
change which the spy object expects to happen.

I don't know why it happens, but it's the last thing preventing me
from getting a working wip/qt6 branch, so I'm gonna blacklist the
test on MinGW.

Task-number: QTBUG-77394
Change-Id: Ia01e24f4e133c84ff44ce365595ad10292e845f9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-08 18:09:59 +02:00
Fabian Kosmale ffda7180f3 tst_qquicklistview: make addOnCompleted more robust + sanity check
Check that after we could not find an element, we do not suddenly find
one afterwards.

Moreover, disable the cacheBuffer as the asynchronous creation might
cause issues, leading to the flakyness observed in QTBUG-77330

Task-number: QTBUG-77330
Change-Id: I444eede16a99a75340a0b7ccf17193298730a675
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-07 12:43:35 +02:00
Liang Qi 28ce9711b2 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I042df89ddd381c7fbb944b7ff49d5b45b764fd47
2019-08-05 13:47:15 +02:00
Eskil Abrahamsen Blomfeldt dfc6dc1d94 Fix possible crash with top/bottom aligned images
An image inside at the end of a text block which did not start at text
position 0 would resolve to an invalid QTextLine, since we passed
the document position to lineForTextPosition(), which expects the
relative block position. If the image was aligned to top or
bottom, so that the extracted QTextLine was actually accessed,
this would cause a crash.

[ChangeLog][QtQuick][Text] Fixed a bug where aligning an image
to "top" or "bottom" could cause a crash under certain circumstances.

Task-number: QTBUG-77217
Change-Id: Iaa239ba482f2a765703656e4116cbebb8435a66e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-30 17:30:57 +02:00
Liang Qi d526a72c44 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/quick/handlers/qquickpointerdevicehandler.cpp
	src/quick/scenegraph/qsgdefaultglyphnode.cpp
	src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
	src/quick/scenegraph/qsgdefaultglyphnode_p_p.h
	tests/auto/qml/qjsengine/tst_qjsengine.cpp

Done-With: Jan Arve Sæther <jan-arve.saether@qt.io>
Done-With: Laszlo Agocs <laszlo.agocs@qt.io>
Change-Id: I35749152f8dce44b9af8d52b1283629879010f11
2019-07-26 17:05:34 +02:00
Qt Forward Merge Bot 45023ae342 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I081bcb9cc238e6cff5f8a23b684c5d6f76dba047
2019-07-24 01:00:27 +02:00
Dimitrios Apostolou 1dad2029a5 Always waitForWindow after centerOnScreen()
Because centerOnScreen asks the window manager to move the window, but
does not wait for it.

This is applied in the same spirit as this change in qtquickcontrols2:

https://codereview.qt-project.org/c/qt/qtquickcontrols2/+/268200

These tests appear slightly flaky on the Grafana dashboard, this commit
might help.

Change-Id: I30d3f4717aca435c94fb1a447c4b5c51021da3be
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-07-22 12:07:51 +02:00
Paolo Angelelli 4a7f21da6e Add QQuickPathMultiLine
And show our users even more love.
This path element allows to specify a list of
polylines as a single list of lists of points.

[ChangeLog][QtQuick][Path] Added QQuickPathMultiLine.

Change-Id: Idf1d1dcd928bb19b9ad995322f86822448811537
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-07-18 11:54:20 +02:00
Edward Welbourne 4129028e25 Merge remote-tracking branch 'origin/5.12' into 5.12-merge-5.13
Change-Id: I9b1cfefda23febfb24282bc30bc38865499ec2f4
2019-07-17 12:30:37 +02:00
Wang Chuan f806d64249 QQuickItemView: refill itself before populate transition
The view uses a visible items list, which is maintained by the refill()
method, to determine which items should be triggered to do the populate
transition.  The refill() was only invoked when component completed
before doing the populate transition; but if the size of the view
depends on the size of window (for example, using anchors.fill), more
delegates could become visible after component completed. In such a
case, part of visible items were not be triggered to do the transition.

[ChangeLog][QtQuick][Item Views] Item views such as ListView now properly
populate delegates with a populate transition when the view is resized
after componentComplete.

Fixes: QTBUG-76487
Change-Id: Id90c3f73d9911c8a1d6d8b1ea0c51f6c27d0ed5b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-07-16 06:56:34 +00:00
Simon Hausmann 880a143eb5 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I4476733af61fcf3a2af1d121a4585c3fae1c240e
2019-07-12 20:36:48 +02:00
Friedemann Kleint 83f8d886ce Fix some compiler warnings in tests
- Signedness of integer comparison
- Unused parameters and variables
- Ignored return values of QTest::qWaitForWindowExposed() (nodiscard)
- float to int conversions

Change-Id: Ibece620d3c980a5af3b7717486c841d8072ed8af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-12 16:00:51 +02:00
Qt Forward Merge Bot b0a4c4808f Merge remote-tracking branch 'origin/5.12' into 5.13
Required a change to a #include; qquicksinglepointhandler.cpp was (at
least on Android) only seeing QQuickSinglePointHandler as a forward
declaration, so dereferencing it was a problem.  The header that
defines it does #include the one it replaces here.

Change-Id: I6bc30ff9a91f55350172e4a4bcaaa7f99a2ffb28
2019-07-12 12:00:31 +02:00
Alexandru Croitor c0987d3923 Fix Qt6 builds after dev -> wip/qt6 merge
Change-Id: I56b9d3abdbc6663a2d514f12aa20f2f574042bc1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-09 21:27:24 +02:00
Shawn Rutledge 1982d1b1aa Move Event Handler acceptedButtons check back up to QQPDeviceHandler
Reverts what's left of e535109441
(amends 73258eca7a):
MultiPointHandler is not only for touch handling anymore.
DragHandler in particular needs to respect the acceptedButtons property.

Fixes: QTBUG-76875
Fixes: QTBUG-76582
Change-Id: I414e785dd09b297c93e5e9f162be23e4a44eca54
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-07-05 17:07:59 +02:00
Shawn Rutledge 9b01e2e5d4 TapHandler: wait until after tapped is emitted to reset point.position
We don't want it to hold its position indefinitely after the button is
released.  But in practice, reset() gets called again anyway in
QQuickSinglePointHandler::handlePointerEventImpl(), _after_
handleEventPoint(), which means after tapped() is emitted.  Having the
point hold its position that much longer is convenient for applications
and more consistent with the state expressed by the release event.
Also amend the documentation.
Partially reverts 17237efaef

[ChangeLog][Event Handlers][Important Behavior Changes] TapHandler.point now
holds the release position while the tapped() signal is emitted.

Fixes: QTBUG-76871
Task-number: QTBUG-64847
Change-Id: I621a2eba4507a498788e9384344e8b4b7da32403
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-07-05 15:02:56 +02:00
Shawn Rutledge 42e403a51d Notify QQItem::mouseUngrabEvent() when an Event Handler steals grab
We already took care of cases when the handler is a child of the Item,
grab transitions involving Flickable etc.; but the bug is about a simpler
case when the handler is in the parent of the item that has the grab,
and steals from it.  Amends 38a016c7b1

Fixes: QTBUG-71218
Fixes: QTBUG-75025
Change-Id: Id1d6d370e0db75c59ec7dce4a8e545701c501827
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-07-05 15:02:17 +02:00
Qt Forward Merge Bot 07205972ca Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf

Change-Id: I20ad6f8a260f387a3b73566a32c35a5772b401a5
2019-07-04 13:32:18 +02:00
Laszlo Agocs 341ab77080 Add the graphics api independent scenegraph port
Opt in via environment variables:
QSG_RHI=1 -> enable using QRhi instead of GL
QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default
(the default is d3d11 on Windows, metal on Mac, gl elsewhere)

Or force a given rhi backend via the existing
QQuickWindow::setSceneGraphBackend().

Otherwise the default behavior is the same as before, the rhi code path
is never active by default.

-no-opengl builds are supported in the sense that they work and default
to the software backend. However, the rhi code path cannot currently be
used in such builds, even though QRhi from qtbase is fully functional
with Vulkan, D3D, or Metal even when qtbase was configured with
-no-opengl. This cannot be utilized by Quick atm due to OpenGL usage
being all over the place in the sources corresponding to the default
backend, and those host the rhi code path as well. This will be cleaned up
hopefully in Qt 6, with the removal all direct OpenGL usage.

Other env.vars.:
QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer
(assuming the system is set up for this)
QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect
QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too)
QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index
QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index
QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both
merged/unmerged, convert when needed - with some rhi backends this is
implicit)
QSG_RENDER_LOOP -> to override the render loop as usual. The default
with RHI is threaded for Metal, threaded for Vulkan on Windows, basic
for Vulkan on Linux and Android (to be checked later), while the existing
rules apply for OpenGL.

Not supported when running with QRhi:
  - particles
  - compressed atlases (though this is transparent to the apps)
  - QSGRenderNode
  - QQuickRenderControl
  - QQuickFramebufferObject
  - certain QQuickWindow functionality that depends directly on OpenGL
  - anisotropic filtering for textures
  - native text may lack some gamma correction
  - QSGEngine applicability unclear
  - some QML profiler logs may be incorrect or irrelevant

Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-04 10:44:26 +02:00
Fabian Kosmale 2149842f7b Intercept image source url
Fixes: QTBUG-55027
Task-number: QTBUG-76879
Change-Id: Id0c7b33cf22827ebc984c4ee848ef4f63c359b20
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-03 15:18:01 +02:00
Qt Forward Merge Bot 97aa001da9 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf

Change-Id: Icd05d016de5b4cf9af5234cb47b5c3fd0f6a053e
2019-07-03 06:11:21 +00:00
Fabian Kosmale 64c1fbe96c use boolean for when property
QQuickState used to store "when" as a QQmlBinding to reduce state
oscillation.

It is unclear whether this is still an issue, but it breaks if a user
sets "when" to a primitive value like "true" or "1".

Fixes: QTBUG-76838
Change-Id: If400e5b1283687838ed252be2dfa52067f44564e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-07-02 15:32:03 +02:00
Tom Scheler 29c61f83c9 Fix read access violation when using KeyNavigation attached property
Setting the KeyNavigation.up property of an item to another item will
implicitly set the reverse (KeyNavigation.down) property on that other
item pointing back to the item. Once the item is destroyed, you will
have an invalid pointer stored in the other item pointing to the
destroyed item.

Using QPointer<> instead of raw pointers fixes that issue, because
they will become null on QObject's destruction.

Added QQuickItem test that verifies the issue is solved.

Fixes: QTBUG-75399
Change-Id: Ibb3e976c4eb9fcd81604bcc2eb757257d3653930
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-07-02 08:58:27 +00:00
Qt Forward Merge Bot e6c6cc8fde Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/imports/imports.pro
	src/qml/qml/qqmlmetatype.cpp

Change-Id: I308436caf55402cb2246cb591c6ac8f83e1febf8
2019-07-01 10:29:06 +02:00
Qt Forward Merge Bot 63398defdb Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I59343fe228ca6b823b61577e5a0907e7381899c2
2019-06-28 13:28:10 +02:00
Eirik Aavitsland 692b2da774 Fix: ListView footer positioned wrong after last item removed
The refill() method would bail out early on an empty model. Make sure
that it at least updates the header and footer in such situations.

Fixes: QTBUG-31677
Change-Id: I1f3a1848ff263a8f7f9ccfc3b20f16b61348f57b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-06-28 09:46:11 +02:00
Daniel Smith 08a83f41ed unblacklist passing tests
These tests have not failed on the removed platforms for at least 60 days

Task-number: QTBUG-76608
Change-Id: Ifad6dfed42ad5a832f50b705a0e9312413c0eb61
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-06-27 14:25:17 +00:00
Fabian Kosmale 732b63ed0c Check that animation still exists
Fixes: QTBUG-76749
Change-Id: Ie5eed240e8190a7297f71f5e40870a007e737d1d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-06-27 09:36:10 +00:00
Yulong Bai b8a85408d9 QQuickItemView: fix crash while doing fast flicking in transitions
The cause was that fast flicking kicked items in and out of viewport,
while in transition, they would abruptly having tracking data structure
, i.e. releasePendingTransition of QQuickItemViewPrivate, got iterator
invalidated. This also helps to resolve QTBUG-44308.

Fixes: QTBUG-76433
Fixes: QTBUG-44308
Change-Id: If14533d3f6b1acd7b6ca0c5c723347c0cb3f54dc
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-06-26 12:37:29 +00: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
Ulf Hermann cff8d9f1d2 Blacklist tst_qquicklistview::currentIndex() on linux
Task-number: QTBUG-76652
Change-Id: I46cd17a925f61585c65199f88342ea872a4a371a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-25 11:15:45 +00:00
Liang Qi a2d36c9ef5 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf
	src/imports/sharedimage/qsharedimageloader.cpp
	src/quick/items/qquickitemviewfxitem_p_p.h

Change-Id: I12ce7c32788f4a394188a934e689b4ebac78138b
2019-06-19 13:05:12 +02:00
Yulong Bai e9520ec84c Fix crash caused by objects self-destructions during displacement animations
The root cause was that the QAbstractAnimationJob::finished() might delegate its
destruction to change.listener->animationFinished(this), and the original author
was aware of that and provided a RETURN_IF_DELETE macro to return early if itself
got deleted. In the bug's case, change.listener->animationFinished(this)
dispatched to QQuickItemViewPrivate::animationFinished() which called
QQuickItemViewPrivate::release() and deleted the QAbstractAnimationJob object
itself in the end.

However, any objects derived from QAbstractAnimationJob, or holding a pointer
to a QAbstractAnimationJob, may potentially fall into the code path calling
QAbstractAnimationJob::finished(). Any QAnimationJobChangeListener that directly
or indirectly deletes QAbstractAnimationJob should be very suspicious to this
kind of "heap-use-after-free" bug. Should ensure that the QAbstractAnimationJob
won't be referenced after deletion.

In the bug's case, within the code path triggered by ListView displacement
animation, the other affected classes by QAbstractAnimationJob are:
QQuickItemViewFxItem, QQuickItemViewTransitionableItem, QQuickTransitionManager.

To fix this, a new SelfDeletable class is factored out to simplify the self-deletion
test logic. Any affected classes are made to have a public member m_selfDeletable.
Any code paths that finally reach QAbstractAnimationJob::finished() are
wrapped with related util macro.

Change-Id: Idd33fc3f2d529fd7d8bb088c329101b1e70dd6c0
Task-number: QTBUG-44308
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-17 16:19:15 +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
Fabian Kosmale c8827b444c QQmlEngine: keep ImageProvider alive while in use
Fixes: QTBUG-76527
Change-Id: I4044ae833eff61a3f06c2366597c1623b26794b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-25 08:06:28 +02:00
Paolo Angelelli 1404009264 Add QQuickPathPolyline
And show our users some love.

[ChangeLog][QtQuick][Path] Added QQuickPathPolyline.

Change-Id: I0fb78ae3e4e7c65e81e100595dc1eb16f88a68ed
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-28 10:02:45 +02:00
Giuseppe D'Angelo 5b96f81fa3 QQuickRectangle: do not pass invalid presets onto QGradient
QGradient isn't meant to have a wide contract and filter out
garbage. Since we're parsing ints / strings as gradients, do
the validation at this level.

Change-Id: I271b5ed1b908d698a2d2c871abf5e61d1e565451
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-24 15:14:56 +02:00
Qt Forward Merge Bot 4050d0eddd Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I71b1212085da85f03f4ff0e3ee5cb56a401998ae
2019-06-20 01:00:05 +02:00
Wang Chuan 8068e7b98c QQuickMouseArea: synchronize relative position after dragging
[ChangeLog][QtQuick][QQuickMouseArea] mouseX and mouseY will now
be synchronized after dragging the target item

Fixes: QTBUG-75993
Change-Id: I0b56f6bd494791f9e2fe55a0cf059a7bad2d63dc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-29 23:13:59 +08: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
Paolo Angelelli 3961cf124a Add scale property to QQuickPath
With this property, Paths and ShapePaths become scalable.

[ChangeLog][QQuick][Path] Added scale property to scale
a path before sending it in to PathView/Shape.

Change-Id: Id9ce7d1247d55e2cdb0d27a19c86fe0970e66268
Fixes: QTBUG-74456
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-04 20:52:01 +02:00
Friedemann Kleint 0f035c0ad7 Fix deprecation warnings in 5.14
Libraries:
scenegraph/util/qsgdepthstencilbuffer.cpp:186:57: warning: 'T* QWeakPointer<T>::data() const [with T = QSGDepthStencilBuffer]' is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations]
scenegraph/qsgdefaultcontext.cpp:163:89: warning: 'QList<T> QSet<T>::toList() const [with T = QByteArray]' is deprecated: Use values() instead. [-Wdeprecated-declarations]
util/qquickpath.cpp:573:40: warning: 'QList<T> QSet<T>::toList() const [with T = QString]' is deprecated: Use values() instead. [-Wdeprecated-declarations]
util/qquickpath.cpp:606:29: warning: 'QList<T> QSet<T>::toList() const [with T = QString]' is deprecated: Use values() instead. [-Wdeprecated-declarations]
quicktest.cpp:562:73: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
quicktest.cpp:604:77: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
qquickitemparticle.cpp:233:49: warning: 'static QSet<T> QSet<T>::fromList(const QList<T>&) [with T = QQuickItem*]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
qquickitemparticle.cpp:239:37: warning: 'QList<T> QSet<T>::toList() const [with T = QQuickItem*]' is deprecated: Use values() instead. [-Wdeprecated-declarations]

Tests:
tst_propertyrequirements.cpp:123:58: warning: 'QList<T> QSet<T>::toList() const [with T = QString]' is deprecated: Use values() instead. [-Wdeprecated-declarations]
tst_propertyrequirements.cpp:161:40: warning: 'static QSet<T> QSet<T>::fromList(const QList<T>&) [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_propertyrequirements.cpp:161:77: warning: 'static QSet<T> QSet<T>::fromList(const QList<T>&) [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
/data1/frkleint/qt-dev/qtbase/include/QtCore/../../src/corelib/tools/qset.h:400:23: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
../shared/viewtestutil.cpp:331:26: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
...
tst_qmldiskcache.cpp:651:81: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qmldiskcache.cpp:663:81: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qmldiskcache.cpp:693:85: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qmldiskcache.cpp:918:81: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qmldiskcache.cpp:940:69: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquickgridview.cpp:6437:70: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquickgridview.cpp:6438:46: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquickgridview.cpp:6440:66: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquicktableview.cpp:53:20: warning: 'kTableViewPropName' defined but not used [-Wunused-variable]
tst_qquicklistview.cpp:7269:70: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquicklistview.cpp:7270:46: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquicklistview.cpp:7272:66: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquickpositioners.cpp:4033:70: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquickpositioners.cpp:4034:46: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
tst_qquickpositioners.cpp:4036:66: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]

Change-Id: I9a177f83f07ae5162f7cc231a8c164ba32ffa5bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-29 23:47:31 +02:00
Qt Forward Merge Bot f8aae9006f Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I73d323b65c628166ac2d422f7e8af2062200d53c
2019-05-26 23:05:16 +02:00
Ulf Hermann fb4c12a9db Blacklist tst_QQuickListView::currentIndex() on macOS 10.12
Task-number: QTBUG-75960
Change-Id: I3321bf54a11c1daf8d4e1818c5b860359c34fdec
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-22 10:57:55 +02:00
Qt Forward Merge Bot 039071ea5e Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ia93dc734ce25b3134b0f905f473a0c30777ceaf1
2019-05-16 01:00:46 +02:00
Jan Arve Sæther 56fbc277a1 Do not synthesize a double click event if the event point moved too far
We need to respect QPlatformTheme::TouchDoubleTapDistance

Fixes: QTBUG-75770
Change-Id: I2adc7097bb29cb93beb2609a8a806a666856a0c8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-15 14:43:42 +00:00
Shawn Rutledge 23f78b6b76 TextEdit: use I-beam cursor by default, pointing cursor for links
But do not interfere with any custom cursor that user code sets:
remember and restore it when the mouse is no longer hovering a link.

Task-number: QTBUG-14769
Fixes: QTBUG-50482
Change-Id: Ia4633c22d0ad42d07203d4dc3e330b90a5f94a7c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-05-15 11:25:45 +00:00
Richard Moe Gustavsen e9852df2d7 QQuickTableView: don't recalculate content width while flicking
There are now three mechanisms in TableView that works together to
ensure that the table ends up edge-to-edge with the content view. They
are applied in the following order:

1. Adjust the content size, based on the predicted size of the table.
2. Adjust the origin and endExtend on the fly, if the content size is wrong.
3. Move the table directly to where it should be, in case we don't have
    time to wait for the origin to change.

We could have, strictly speaking, setteled with just one of them, but choose
to use them all at the same time for best flicking experience. Still, 1. and
2. sometimes step on each others feet when they both detect that something is
a bit off, and adjust.

So rather than adjusting the size of the content view every time we load a
new row or column, we just keep the first prediction. And then we leave all
later ajustments to 2. and 3. This turns out to be a more stable, and will
avoid some glitches that occur when flicking using a scrollbar, if several
mechanisms kick in at the same time.

Change-Id: Ib551a0bf8f6ee59ac9b3556b9462c91adb9cc80b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-05-15 11:14:09 +02:00
Jan Arve Sæther f228af06c2 Add snapMode to DragHandler
This changes snap behavior slightly. Basically, it does not snap
anymore if the target() item is an ancestor of the parentItem().

In addition, we add a property that enables users to change the behavior.
(SnapIfPressedOutsideTarget has the old behavior)

[ChangeLog][QtQuick][Event Handlers] Added DragHandler.snapMode which can
be used to configure under which conditions the dragged item is snapped
to be below the cursor. The default mode is SnapAuto. The old behavior
can be obtained through the SnapIfPressedOutsideTarget mode.

Fixes: QTBUG-75661
Change-Id: Ibc00e8fbe31b779f8e817af1505e76425467d27a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-16 15:29:41 +00:00
Qt Forward Merge Bot cf2bf011ae Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I192cb06f3b92869699cb3e072f2c6c1e8dbb1ef4
2019-05-16 10:35:21 +02:00
Richard Moe Gustavsen 3fff03048a QQuickTableView: change implementation of enforceTableAtOrigin()
We set the size of the content view to be the size of the complete
table. The problem is that the exact size will always be just
a prediction, since we would otherwise need to iterate over all rows
and column up front, to be able calculate the exact size.
This is not acceptable when using non-trival table models.

A side effect of this, is that is will be possible to flick the
viewport further out than the actual end of the table, if the
content view turns out to be larger than the table itself. From
before we used to just move the whole table back into the viewport
when that happened, which could be seen as a sudden jump of the
table to a new position.

This change will improve this logic so that we can avoid most
visual jumps. Instead of moving the table around, QQuickFlickable
supports moving the origin instead. So when we see that the
table is not in sync with the content view, we simple move the
origin to the edge of the table. The effect is that any flicking
or ongoing momentum animation in QQuickFlickable will continue as
if nothing happened. This is also the same logic used by QQuickListView.

Change-Id: I6060b7e84b9489c8fa569e6ff41b958e3871f8e7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-05-11 09:47:36 +00:00
Richard Moe Gustavsen dafdc9d701 QQuickTableView: sync viewport rect with syncView when rebuilding
When moving contentX/Y, we also need to ensure that the viewport rect
reflects the change. Otherwise we'll end up loading rows and columns
somewhere else then under the viewport.

Change-Id: Ifbd3d66b9b3a822414aefde9b5bd088274dfa2ad
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-05-09 13:25:23 +00:00
Qt Forward Merge Bot 90f85482bb Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/qml/compiler/qqmlirbuilder.cpp

Change-Id: I2cfda470515e2df778ad3c89105c07344af07c6d
2019-05-09 09:31:24 +02:00
Jan Arve Sæther d12cc4f6b5 Don't overwrite states if role is assigned after a state
We therefore need to keep track of which states have been explicitly set
or not in order to know which ones should get initialized with their
defaults.

Change-Id: I49fdae82288f04ea4f50d45735a93434ac02abec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-05-09 06:56:35 +00:00
Qt Forward Merge Bot 0a775ded35 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I3eb5d1affe64b6ae709d1154cc37de91db3816b6
2019-05-08 01:00:51 +02:00
Frederik Gladhorn 4a4842118d Accessibility: Make sure StaticText is marked read-only
Test more of the text properties. This is still very incomplete, but a
small step forward.
Also make sure that editable text reports the editable state.

Fixes: QTBUG-75002
Change-Id: I9e43c980d8fa91671acb4e40e5d9162854884ee7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-05-07 12:53:25 +00:00
Richard Moe Gustavsen fee256e641 Autotest: add syncView tests for QQuickTableView
Change-Id: I0c311a4cc7d0765e234739c005cb68a60cfee129
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-05-03 07:39:06 +00: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 23f988fe48 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/qml/compiler/qv4compilercontext.cpp
	src/qml/qml/qqmlmetatype.cpp

Change-Id: I02e0216961b92ff68a3f91a70edc33fe9e8db147
2019-04-29 09:12:31 +02:00
Shawn Rutledge 3ef2b2727d Stabilize tst_QQuickWheelHandler's activeChangedSpy checks
Change-Id: I9fa36d12347f0311728dc14ab4b8405bf0550505
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-04-27 05:41:35 +00:00
Shawn Rutledge 5d45aa1a64 Add WheelHandler
It can be used to change any qreal property of its target Item in
response to wheel rotation, or it can be used in other ways that involve
bindings but without a target item.

[ChangeLog][QtQuick][Event Handlers] Added WheelHandler, which handles
mouse wheel rotation by modifying arbitrary Item properties.

Fixes: QTBUG-68119
Change-Id: I247e2325ee993cc1b91a47fbd6c4ba0ffde7ad49
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-04-27 05:41:21 +00:00