Commit Graph

30784 Commits

Author SHA1 Message Date
Qt Submodule Update Bot 651262a685 Update dependencies on '6.5' in qt/qtdeclarative
Change-Id: I9cd57ae06e4ba73b4f132039bc300270be89fec9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-14 04:18:44 +00:00
Ulf Hermann d999fec589 QtTest: Do not verify() before logging starts
Rather, print an error in the impossible case that tests run
interleaved.

Fixes: QTBUG-115951
Change-Id: I168ba88fef2d9c181db3b975317cb3a99dc05083
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: André Klitzing <aklitzing@gmail.com>
(cherry picked from commit 5fd2223d44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-12 01:19:59 +00:00
Andreas Eliasson 5fe25ef5b4 Doc: Fix Shortcut's sequences code snippet
The sequences property expects an array.

Task-number: QTBUG-115947
Change-Id: Ia70f31548a457aee477c153426b81563f6ca86ab
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit fea552c9b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-11 21:36:31 +00:00
Joshua Goins 0ecf823b94 qmlformat: Don't add unnecessary space in target bindings
qmlformat was erroneously adding an extra space in target bindings like
"Behavior on opacity {". The extra space is removed, and the tests are
updated to prevent regression for this behavior.

Fixes: QTBUG-114801
Change-Id: I79f563e40c75a325ab13f1fbffd73daa71fe1ec9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 08667fa4af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-11 17:29:24 +00:00
Edward Welbourne 443e55895a Clear out some locale-dependencies from XHR unit test
None of these tests care about Accept-Language, which
QHttpNetworkConnection sets automatically based on the system locale,
so testing for it (by including a line for it in .expect files),
setting it and skipping tests due to its "locale-dependence" were all
unnecessary. Just tell the test-server to {{Ignore}} the value of the
header.

This failed on Android due to one of the data files being unfound, so
fix access to that file. At 6.5, the responseURL test hadn't yet been
added, so exclude its change from the pick.

Change-Id: I560ead8b3ace6a5df173d96aea10f8dac3ed1124
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit d0a2f511f3)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-11 17:00:07 +02:00
Andreas Eliasson 3f9478ca2a Doc: Add note to the QML Shortcut sequence property
When using a standard key for the sequence property, the key may resolve
to multiple sequences, depending on the platform. This results in a
warning, which tells us that only the first sequence gets assigned
to the shortcut and that one should use the sequences property
instead. Add a note about this in the documentation as well.

Also, change the top-most example to use sequences instead sequence.

Fixes: QTBUG-115947
Change-Id: I9f65e0e9ac9473f536616fc3979965bc4702f6b8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 5c402af75f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-11 14:16:19 +00:00
Qt Submodule Update Bot cb653b5792 Update dependencies on '6.5' in qt/qtdeclarative
Change-Id: I9ca341d27d01bb89150e5d4b8097f41fea1ecc5f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-11 11:09:59 +00:00
Mitch Curtis 42dcda6bea SwipeView: reposition items that aren't visible after startup too
7a5bbc2315 repositioned items upon
startup, but didn't account for items added afterwards. Do that here
so that semi-transparent pages don't show pages beneath them.

Fixes: QTBUG-115468
Change-Id: If5ca587a6c14ddae5108c0a45d13fa2d290d1865
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 2cf897f2a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-10 13:14:59 +00:00
Mitch Curtis 067637de14 SwipeView: ensure items fill the bounds
Taking the translucentPages component from
SwipeView::test_initialPositions into a Qt Quick app and running it
showed that the Text items weren't actually filling the SwipeView. The
documentation states:

"SwipeView is populated with a set of pages. One page is visible at a
time."

The implication here being that each item fills the SwipeView, hence only
one being visible at a time.

It also states that SwipeView manages the geometry of items:

"Note: SwipeView takes over the geometry management of items added to
the view. Using anchors on the items is not supported, and any width or
height assignment will be overridden by the view. Notice that this only
applies to the root of the item. Specifying width and height, or using
anchors for its children works as expected."

So, this patch corrects the behavior and updates the test.

Change-Id: I3425d4d028743f440f003e86ba009a2da7cca9cb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 08b2302310)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-10 13:14:50 +00:00
Richard Moe Gustavsen 9acf0e519e ListView: add extra note about reusing items
The current documentation leads the reader to think
that all items are always pooled as soon as they
are flicked out the viewport. Add a small note that
explains that this is not always the case.

Task-number: QTBUG-115317
Change-Id: I31bc7920ae7fa2477764f1f2ce33a29ef6825a3f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit c0ab315b85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-09 16:56:12 +00:00
Santhosh Kumar 8edbce2866 Fix scroll wheel issue for top item with overlay as parent
The overlay filters wheel event for the popup item as part of patch set
caca7d7d4f. These events are consumed by
modal popup when the top level item is not its child. In a case, where
top level item is a child of overlay and stacked higher than popup, the
wheel event should be delivered to the top level item.

This patch set validates item at the top is child of overlay or popup
item and deliver wheel events accordingly.

Fixes: QTBUG-113842
Change-Id: I2d27c09738742ef5ae25e42eca3747f1631baa6c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 5ebed8ff9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-09 16:56:11 +00:00
Mitch Curtis 629ff1723e Allow customization of native Dialog and DialogButtonBox
There's no harm in customizing these, and especially the contentItem
and footer need to be customizable, as that's where the content and
any customized OK/Cancel/etc. buttons go.

This fixes warnings in the testbench manual test.

Currently only the macOS styles has implementations of these
controls.

Change-Id: I09678c777088786961583724d68dc2c3f6d90895
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 15894c3ca7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-09 13:38:03 +00:00
Olivier De Cannière 3a511f56fa QQuickAnimation: Check animationInstance for null in animationGroupDirty
On this line group->currentTime() defaults to 0 if animationInstance of
group is null. This happens to be the value the condition is checking
for and leads to a failed Q_ASSERT(animationInstance) in
animGroupPriv->restartFromCurrentLoop(). Add a check for nullptr to
cover this case.

Amends 0e69268b49

Task-number: QTBUG-68404
Change-Id: I12236be3b42fc6bd2d185943f9e0474655d8a4c9
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Inho Lee <inho.lee@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 07ca60dcc5)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-09 15:37:57 +02:00
Ulf Hermann 5dc4a90e35 QML: Allow conversion from JS Array to QByteArray
Since QByteArray is sequentially iterable and we allow any sequentially
iterable type to be constructed from a JS array, we also need to allow
this.

Fixes: QTBUG-115733
Change-Id: I6ffd5eaad0e587ea1cafbe0c1b0179202f3f28cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 9599f4c553)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-08 22:20:02 +00:00
Safiyyah Moosa e14bca57d7 Doc: Move GridView.isCurrentItem example
Currently, GridView.isCurrentItem example is located under the
GridView.view : GridView header. Moved this example to the
GridView.view : GridView header.

Task-number: QTBUG-61646
Change-Id: I45c95e13afac6c95d621cee9643868f7da38cb8a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 0a9bcd8951)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-08 14:19:41 +00:00
Inho Lee 3f862f7368 Make a group animation dirty when a member changed
Some properties of one of the member animations in a group
animation can be changed after the group animation initialized.
1. If the group animation is already proceeding, they will
affect the next loop.
2. If the group animation started but does not proceed, they
will affect the current loop

Fixes: QTBUG-110589
Fixes: QTBUG-61282
Fixes: QTBUG-95840
Change-Id: I018105bdd75dd5bd7c24e9126853cd79c8f0123b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0e69268b49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-08 11:14:40 +00:00
Marc Mutz a64d6e0b9a Port some trivial Q_FOREACH users to ranged for loops
The common theme amongst these is that this author detected in split
seconds that fixing the loop was easier than performing the #undef
QT_NO_FOREACH dance.

Naturally, all these fall into the category "loop over (readily made)
const local variables", which cannot possibly require the safety copy
that Q_FOREACH unconditionally performs.

Task-number: QTBUG-115808
Change-Id: I652562711ae43e8bb36493ea990114d91c5b7d5d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 49e5532463)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-07 22:37:08 +00:00
Qt Submodule Update Bot 131a09b132 Update dependencies on '6.5' in qt/qtdeclarative
Change-Id: I6e94f9fa43e614d5b05b09b71203b12b1b1ff6fa
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-07 04:14:29 +00:00
Qt Submodule Update Bot 12cd715c12 Update dependencies on '6.5' in qt/qtdeclarative
Change-Id: I2188339e22c7514720aefeee240c6ab1cf583fbb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-04 04:17:52 +00:00
Santhosh Kumar b3b88f7da3 Fix mouse event delivery issue for items within SwipeDelegate
Swipe items that are direct visual child of SwipeDelegate control can
consume mouse events. But, if its configured within non-visual item
(such as row or column layout), the mouse events are not being
propagated.

This patch set fixes this issue by identifying visual child that can
consume mouse events at the event position through
QQuickSwipeDelegatePrivate::getPressedItem() and propagate it
accordingly.

Fixes: QTBUG-104904
Change-Id: Ie7458db26d0d5fe1dd767326bb84605d06ba2ae8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 85633bb9fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-03 11:02:15 +00:00
Andreas Eliasson 9ff4900abd Doc: Add \br between \value and \table
Whenever a \table follows a \value, the contents of the two commands
merge, which breaks the table formatting. Fix this by adding a \br
before the \table.

Fixes: QTBUG-115537
Change-Id: I8e5836a8fc82dc9e59eb5fe210da9996d4f66d95
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit e80921b01f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-03 07:21:00 +00:00
Marc Mutz 53e10b8bf1 qmltc: fix GCC13 warnings "class X is implicitly friend with itself"
This happens because the generated code contains

    class X {
        ~~~~
    private:
        friend class X; // warning here
    };

Says GCC13 (e.g.):

    tests/auto/qml/qmltc/QmltcTests/.qmltc/qmltc_test_module/inlinecomponents.h:421:18: warning: class ‘QmltcTests::inlineComponents_IC0’ is implicitly friends with itself
      421 |     friend class inlineComponents_IC0;
          |                  ^~~~~~~~~~~~~~~~~~~~

It seems the intended check for documentRoot doesn't work in all
cases, so do the check on the class-name level.

There appears to be no -W flag to control this warning, therefore no
apparent way to suppress it, so we need to fix it.

Amends either b89a92053e or
0990b892ca. I didn't dig into it
further.

Change-Id: I3fe653a398ea5b7a3e045fd3ea8dfb5d5c0f2e5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit a5377f32e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-02 18:02:48 +00:00
Qt Submodule Update Bot 53472eb8d5 Update dependencies on '6.5' in qt/qtdeclarative
Change-Id: I6e014166b8d96c4f5c89330fb4db60d2b2afca69
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-02 15:03:23 +00:00
Olivier De Cannière a26913086e UndefinedBehavior: fix some things found with -sanitize undefined
-cherry-pick to 6.5: only the first point was kept. QQmlSA didn't exist
yet in 6.5 and the other change would require changes to the public API.

Here are the sorts of things that were found:
- Uninitialized variables containing garbage.
- Calling member function through nullptr (where this is not actually
  used inside the function because that would trigger a segfault).
- static_cast'ing double to int where the double is either +/-infinity
  or is outside the range of min and max values for int.

Additionally, the uses of QJSNumberCoercion::isInteger() in the code
generator have been replaced by QJSNumberCoercion::isArrayIndex() and
the former was deprecated as it is no longer being used.

Change-Id: I9318671ccbda37e5519f4fcb84a1537585c2103f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9df4293adf)
2023-08-02 14:18:49 +02:00
Mitch Curtis 36e1d7e67d Fix wrong property name in customization warning
Amends e592a2ad31.

Change-Id: I3a327003eb31cc2ddeb9703e5f0276e8f3eef1ce
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 64298d1ddd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-02 02:44:01 +00:00
Qt Submodule Update Bot 62a17d36d4 Update dependencies on '6.5' in qt/qtdeclarative
Change-Id: I917baa361066ae1823b281b56e118e13d2b4b83e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-01 05:33:56 +00:00
Fabian Kosmale c7d518ca7c ItemDelegate: Use required properties in example code
Change-Id: I11d7c35beb966b1d99909c32365939d97b5672a6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f4776d4d7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-31 21:16:53 +00:00
Mitch Curtis ce77d45d89 Fix attached property propagation when accessed on QQuickPopupItem
As mentioned in the comments of QTBUG-68434, popups always inherit
their attributes from the parent window (unless they are explicitly
bound like in ComboBox). However, ComboBox was made an exception,
because the popup is an integral part of the control.

This means that although the following snippet shouldn't change the
background color of a Popup, it should do so for ComboBox's popup:

    Rectangle {
        Material.theme: Material.Dark

        ComboBox {
            model: 5
        }
    }

However, this didn't work.
Before 3ec6d04d97, material/ComboBox.qml
had the following binding in the popup's background Rectangle:

    color: control.popup.Material.dialogColor

That patch changed it in order to get deferred execution working:

    color: parent.Material.dialogColor

This causes the color to come from the window rather than the popup.
This would have almost been caught in test_comboBox, had we checked the
actual color when setting the theme.

To fix the bug without reverting to the previous QML and breaking
deferred execution, we modify findAttachedParent to return the popup's
attached object if the item passed to it is a QQuickPopupItem.

Doing this causes test_inheritance_popup to fail, so we fix that by
passing the attached object target (which can be a popup) to
findAttachedParent, rather than the item whose parent or window changed
(which is coincidentally what was already being done in initialize()).

The patch also adds categorised logging to help debug such issues in
the future. Conveniently, this will also help users who want to debug
their own QQuickAttachedPropertyPropagator subclasses, without them
needing to modify Qt itself.

Fixes: QTBUG-115322
Change-Id: Idc0495023a058bcb033c4002fb6ad233bae9feae
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c6b401a31a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-31 15:51:59 +00:00
Laszlo Agocs 7434dcf618 doc: Note in QQuickGr.Conf. that pipl.cache is disabled on Metal
Follow the qtbase change that, for now, makes the Metal backend of
QRhi never initialize an MTLBinaryArchive, meaning the pipeline
cache will be completely empty. (from Qt's perspective, the OS
will likely do its own persistent caching regardless)

Task-number: QTBUG-114338
Change-Id: Ic2c2488029d77c23f1183b36248aaaa15dd275ad
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ea63dbfa19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-31 13:14:00 +00:00
Laszlo Agocs 24fb595ca4 sg: Fix dirty bit when changing mirror for QSGSimpleTextureNode
Not setting DirtyGeometry leads to subtle update problems in
scenes where the value is dynamically toggled. Most commonly the
changed mirroring value does not always take effect, but rather
only when something else triggers something geometry-related.

Change-Id: I6a00e1399ebeec3120b0f695cf0e10507f0ad807
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 45baa640b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-31 13:13:52 +00:00
Fabian Kosmale 1b8c6d9596 Context properties: Don't trigger an assert for numeric names
The logic in our IdentifierHash assumes that every entry is a
StringOrSymbol; however, IdentifierTable::asProperyKey will convert keys
that look like numbers to ArrayIndex instead.
This is noramlly what we want, and not an issue, except for
setContextPropery where the user can pass an arbitrary string that is
not necessarily a valid identifier. In an ideal world, we would just
disallow such identifiers, but for backward compatibility change the
code to handle this case (avoiding a Qt internal assert).
We only need to modify the QString overloads, as those are the only ones
that interact with unsanitized user input.
A later commit will modify setContextPropery to warn if the key is
numeric.

Fixes: QTBUG-115319
Change-Id: Ifc4e4d2bc99321836e6976c4cbd0c5ff687b430c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit b2b90c7cf5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-31 10:10:03 +00:00
Fabian Kosmale 869d1b9c55 QQmlPropertyBinding: Correctly link observers after undefined valued binding
Calling both setObservers and prependObservers doesn't make sense:
setObservers is for the case where we don't have a binding, but
obviously we do have one here.

Note that the test case still passes even without the fix - it will
however cause a memory leak which can be detected by ASAN. The leak is
fixed by this patch.

Fixes: QTBUG-115251
Change-Id: I4b420e05f49acf764da6a05af522390005276f49
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 366fee74fc)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-31 09:21:59 +02:00
Shawn Rutledge 5f2fdfc640 QQuickWidget: give each mapped mouse event the same QEventPoint
Counter-intuitively, this is done by setting the timestamp. Every time
you construct a new mouse event, you always need to call setTimestamp()
for the obvious reason: the timestamp is not a ctor argument, but it's
important for some event receivers. But the non-obvious reason is that
QMutableEventPoint::setTimestamp() has other useful side effects:
the velocity calculation is done there, sensibly enough. But to make
that possible, it also looks up the persistent QEventPoint with the same
ID as the one in the QMouseEvent, and that's the most important to fix
QTBUG-114258 specifically.

QQuickFlickablePrivate::handleMoveEvent() calculates delta as
QEventPoint::position() - mapFromGlobal(globalPressPosition())
and then QQuickFlickablePrivate::drag() does the drag threshold check.
If globalPressPosition() is 0,0 because the persistent QEventPoint
was not passed along in the mapped QMouseEvent, that delta is nearly
always over the drag threshold. So Flickable took the exclusive grab
at the first possible opportunity: the second move after press.

Fixes: QTBUG-114258
Change-Id: Icaf7fb8fde0ef01b486ccf16852ef0f6cfb6a64c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7ae07f49c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-28 20:26:14 +00:00
Shawn Rutledge 795686be3f SwipeDelegate: use QEventPoint's pressed pos for drag distance
QQuickAbstractButtonPrivate::pressPoint may not be set correctly,
and we don't need it for this purpose anyway in Qt 6, since every
QEventPoint is supposed to remember its own press position.

Task-number: QTBUG-61783
Change-Id: Idd82f3d79b1167a40f28669d15b5974c7d240a9c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 0f4eb2320c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-28 10:25:06 +00:00
Qt Submodule Update Bot 635a41e1e5 Update dependencies on '6.5' in qt/qtdeclarative
Change-Id: Ife4f2e90cb626e0cc484ae1ea3c3fb0514da691f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-07-28 07:42:52 +00:00
Ulf Hermann 79175ef102 QML: Do convert objects with prototypes to QVariantMap
While we shouldn't convert to QVariantMap if only QVariant is requested,
we should convert if QVariantMap is explicitly requested. QVariant can
hold QJSValue which is a better fit for objects with properties.
QVariantMap cannot hold QJSValue. A best effort conversion is still
better than an empty map.

Amends commit 47678c682f.

Fixes: QTBUG-115523
Change-Id: Iaa96809ee411dc0db95311c641c4e3f1f51a6026
Reviewed-by: Amanda Hamblin-Trué <amanda.hamblin-true@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit afe96c4d63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-28 07:42:42 +00:00
Ulf Hermann 8aeef636ba QmlCompiler: Force QObject* for LoadElement on list properties
In the presence of incomplete type information we may otherwise conclude
that the value type is QJSValue and generate broken code.

Change-Id: I533f704a422d0efe8b7b5bb0a170966e9f290b1f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 81bab13560)
2023-07-27 10:18:55 +02:00
Shawn Rutledge f08c708324 doc: Remove readonly tag from PinchHandler persistent properties
Amends a432970b25

As a drive-by, remove redundant categorized logging output, which
wrongly implied that starting scale could be set from the target scale.

Task-number: QTBUG-76739
Task-number: QTBUG-94168
Change-Id: I1fad79b58fa20e165fd21bc593a27cff8378b7ea
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 442eeba672)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-26 20:24:21 +00:00
Ulf Hermann aee2cdd6ec QML: When marking a QObjectWrapper, also mark its const counterpart
Otherwise the const wrapper will be swept while the object should still
be alive (and vice versa).

Amends commit d3b3fef5a8.

Fixes: QTBUG-114596
Change-Id: Ib4d8e9f805a229a471ca72f5ff357e3a4c9999a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ffa15d0e21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-26 12:06:42 +00:00
Ulf Hermann 051e3c95a8 QV4::ArrayData: Fix offset calculation for sort()
We cannot just sort the raw values. We have to take the offset into
account. If the array wraps around the end of the allocation, we have to
move it around to be contiguous.

Fixes: QTBUG-58718
Change-Id: I1866b3f271d97352e250d687955af3fc54340334
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit f0b2fbcf47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-25 14:43:01 +00:00
Jaishree Vyas 1226012798 Doc: Remove \ingroup all-examples command from the docs
Task-number: QTBUG-115044
Change-Id: I69fa38a974c6143b862af1bc4fb27a73508406bc
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 1c01b3cc8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-25 14:43:01 +00:00
Andy Shaw 03768788d4 doc: Fix typo in qt_deploy_qml_imports example
Change-Id: I52869a202169d7cc4bcf5337bcd61b10a68915de
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit c3e40c8997)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-25 14:43:01 +00:00
Alexey Edelev addbcd49c3 Fix the plugin class name handling in qt6_add_qml_plugin
If the CLASS_NAME is not specified and the BACKING_LIBRARY exists
we should get the plugin CLASS_NAME from the backing library, but
not from the non-existing plugin target.

Change-Id: I51ba2290f8f9cb8bcf4217f535c6aa4e676f7293
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e97f1631c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-25 14:43:01 +00:00
Ulf Hermann 3d2418b74e QmlCompiler: Optimize storage for register variables
We don't need nested hashes there. A single hash is enough, and we also
don't need to key it by pointers. Keying it by internalName instead
makes the ordering deterministic. We also don't need to duplicate-track
the variable names when outputting the declarations anymore.

Verify that qmlcachegen's output is actually stable by compiling the
entire test data for tst_qmlcppcodegen twice, packaging the generated
code into the resource file system, and comparing it in a separate test.

Fixes: QTBUG-115159
Change-Id: I659661e58a52ed9ff308c83d6c821cf016f2e94e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit fb4cc245e0)
2023-07-25 13:30:47 +02:00
Ulf Hermann b1af4d9dbc QML: Unify treatment of wrappers when dealing with QObjectMethod
A method can belong to a QObjectWrapper, a QQmlValueTypeWrapper, or a
QQmlTypeWrapper. store only one wrapper pointer and allow for all
variants. Furthermore, keep a reference to the wrapper so that it
doesn't get garbage collected. We still need it to retrieve the
metaobject, even if we're calling the method on a different instance.

Fixes: QTBUG-115115
Change-Id: I1759fb687918ff79829fef776e0a93d29373b30f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 63b622d590)
2023-07-25 09:54:11 +02:00
Ulf Hermann 787a874835 V4: Use memmove() for tail calls
If you have many arguments, the argument ranges can overlap. In that
case memcpy is UB.

Fixes: QTBUG-115320
Change-Id: I54dd4d7762e7278502954b8ac2cb4af1197ce88c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d4a6673d2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-24 21:58:21 +00:00
Amanda Hamblin-Trué 6a330e6916 Add testcase verifying unshift misbehaving
When calling sort after unshift, array entries unexpectedly become undefined.

Task-number: QTBUG-58718
Change-Id: Ie577e6d983f22e02ab4ade3d1f722e7c44c2a981
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 7e65bb98c5)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-24 13:05:40 +00:00
Venugopal Shivashankar 53535358eb Doc: Add example category for Qt Qml examples
Also, removed the \example command for a couple
QML tutorial pages.

Task-number: QTBUG-115226
Change-Id: Ia3b988d369402b59c1a191fae12a5e8119ecbcab
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 6d64967f85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-21 15:22:09 +00:00
Venugopal Shivashankar 55f9f97adc Doc: Add \examplecategory for Qt Quick Controls
Also, changed one of the example pages to a tutorial
page.

Task-number: QTBUG-115297
Change-Id: Ife1b740523039b9287008a1c5243edfc4c1349d1
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 2983a38c1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-21 13:19:12 +00:00
Marc Mutz a56a56b1e8 QtQuick: unbreak unity-build-batch-size 100000
Exclude TUs that cause problems in a build where all of QtQuick's .cpp
files end up in a single unity_0_cxx.cxx. This should ensure that the
build will forthwith not fail because someone added a new .cpp file in
the "wrong" position.

Of course, this is just a snapshot, with my configuration: Clang 15,
Ubuntu 20.04, -developer-build, C++23, -sctp, libc++, ...

Task-number: QTBUG-115140
Change-Id: Iea1fd344541b966add097a7e0c144a427edabd94
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 174e3fd026)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-21 10:32:28 +00:00