Commit Graph

30154 Commits

Author SHA1 Message Date
Sami Shalayel 3df8eba0f5 qmltc: generate code into namespaces
Generate code into namespaces to avoid clashes between qmltc-generated
and user code. Code generated by qmltc will by default be put in the
URI_OF_MODULE namespace, and will generate subnamespaces
to follow the module hierarchy if URI_OF_MODULE contains dots('.').

Also fix the test to use the new namespaces.

[ChangeLog][Qml][qmltc] The type compiler will generate C++-code into
a namespace by default. The  new default namespace is inferred from
the module's URI, where dots are interpreted as separating subnamespaces
from each other,
e.g., a type in module MyCompany.MyModule.Sub will be generated in the namespace
MyCompany::MyModule::Sub.

Fixes: QTBUG-109274
Change-Id: I3bfe2697b81e90bb63a079dc44c2810fc9925f97
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-06 18:28:31 +01:00
Ulf Hermann 4e1fe071ff Fix some qsizetype vs. quint32 problems
On 32bit platforms you cannot losslessly convert quint32 to qsizetype.
However, in the places we are facing here, we are only interested in
signed 32bit numbers anyway.

Pick-to: 6.5 6.2
Change-Id: I93a07c2847bd5bfae426dccbb6c0e33c5758442d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-06 15:45:41 +01:00
Sami Shalayel c4b0acd5eb qmltc: test C++-namespace support
Add a test to see if qmltc handles c++ types correctly, that are wrapped
into namespaces.

Fixes: QTBUG-106830
Change-Id: I9ba89d209b84dfb8104073a02588cd824e657658
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-01-06 11:40:59 +01:00
Shawn Rutledge 434e19bede Drawer: don't close during destructor
This animation is pointless and can cause a crash.

Fixes: QTBUG-109464
Change-Id: Iffd41b2a5e205afda3295c15a2040becdcf7c96b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-06 08:31:31 +01:00
Fabian Kosmale 9b1d3a8602 Deferred properties: avoid spurious binding loop
During binding evaluation, it might happen that we do an initial read of
a deferred property. If that deferred property is in turn an object
property, further binding evaluations might occur. Those bindings should
not depend on whatever trigerred the initial binding evaluation.
However, with the new C++ properties/bindings, that would happen, as the
bindingStatus would still indicate that binding evaluation is active.

To remedy this, we temporarily suspend the binding status ind begin and
completeDeferred.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-96351
Change-Id: I7e9778aa5339f044ce3082e962a2ede34b5d1e69
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-06 08:31:20 +01:00
Laszlo Agocs e351ca8f9f Remove odd naming leftovers in ShaderManagerShader
The odd programRhi struct is a leftover from 5.14/15 times where there
were multiple code paths and so the data structures had to gather for
both. Drop that inner struct and use sensible names.

Pick-to: 6.5 6.4
Change-Id: Ic157325afdb11b362b009212ab45093e8b7472f8
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
2023-01-05 15:20:48 +01:00
Alexey Edelev daf79869f6 Exclude the manual test of text from build when building Qt
The test uses public API and tries to look for packages that do not
exist when builing the test with qtdeclarative.

Exclude the test from Qt builds. The test still can be build mnually
using qt-cmake outside the Qt build tree.

Fixes: QTBUG-109473
Change-Id: I3af914ffbacf10d8a984a074e92396f7056549dc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-05 14:58:24 +01:00
Ulf Hermann 4dfcaa7ee8 QQmlObjectCreator: Do not crash on read-only bindable
If the binding was not actually set (because the bindable is readonly)
then it's dead after the pop_front. We cannot examine it anymore, and we
don't have to.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-109597
Change-Id: I3bf0ca501aa9ad45a64ad181b685ca6d9d325231
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-05 09:29:52 +01:00
Shawn Rutledge 0461a51c8e tst_QQuickListView::flickBothDirections: flick more
If we make flickDeceleration's default value platform-dependent and
often larger, this test begins failing because it expects to flick
all the way to the end of the ListView. If we flick a longer distance
(starting at the lower-right instead of in the middle of the ListView)
in the same time, it's more likely to get to the end.

An alternative would be to set flickDeceleration back to the old value
in this test.

Pick-to: 6.5
Change-Id: If85d9502ceef9fbf6fc087240572cc98326453a5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-05 06:04:29 +01:00
Shawn Rutledge cae32cb2ec Use inline component in sidebar example rather than Loader
Originally in ca9e2a0d74 I used Loader as
a way of reusing some content in two places in one QML file, not
necessarily to test hover behavior with Loader. Inline components
are a little cleaner.

Pick-to: 6.2 6.4 6.5
Change-Id: Ib064bdb460704bec0c714550d8935dcef8af0637
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-01-05 06:04:16 +01:00
Santhosh Kumar 051d7dd955 Override dark with light mode for quick controls using windows style
The dark mode for windows style not been supported and it doesn't look
good when application uses windows style. To overcome this, its made to
override dark with light mode for quick controls that use native windows
style.

Pick-to: 6.5
Change-Id: I271f55ba86f23617ef83ca0e14dd111ec7a191de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-04 13:56:17 +01:00
Ulf Hermann a933e28bd6 qmlplugindump: Don't crash on value types with extensions
We have some internal value types without their own base metaobjects,
but with extensions. qmlplugindump is not designed to handle those. Skip
them.

Pick-to: 6.5
Fixes: QTBUG-109562
Change-Id: I3c4925790ac905077e6ea07724c898b32dd6e59a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-04 08:55:55 +01:00
Ulf Hermann 32a9015c8f QML: Re-allow assigning QVariantList to arbitrary other lists
Since we can assign a QVariant to any other singular value, we should be
able to do the same with lists of QVariant. This ability was lost when
we stopped converting QVariantList to JS array but rather started to
express it as QV4::Sequence.

As a drive-by, generalize the messy code that allows assigning singular
values to lists. This should also just work for any singular value and
any kind of list.

Fixes: QTBUG-109584
Pick-to: 6.4 6.5
Change-Id: Icab1dceff332c5fc4fae9e7e8a8b5fde9f0b0ea9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-04 08:55:55 +01:00
Qt Submodule Update Bot bb06d13821 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: Id81dd3a6fd2cff60de2db3b1eb2016adcac8709b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-04 04:55:49 +00:00
Sze Howe Koh f92a2a6798 Examples: Update custom QSGMaterialShader correctly
Pick-to: 6.5 6.4 6.2
Change-Id: I469c4f813f006ca47f9660a0c9ccfa30bbe89dc6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-04 10:04:36 +08:00
Marc Mutz 0766794e0b QObjectWrapper: fix QT_ASCII_CAST_WARNING
The two arguments to QLatin1StringView::arg() are const char* and
QByteArray, both of which are considered "ASCII" for the purposes of
QT_ASCII_CAST_WARNING.

Fix by wrap them in QLatin1StringView (their contents are actually
ASCII (class and method names)).

Amends 3fd3a2a9d0.

As a drive-by, use the _L1 UDL for the format string.

Pick-to: 6.5
Change-Id: I7f83133f52b6f4ec53a2bfcbca58d91afa9e2ff2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-01-03 21:34:49 +01:00
Ulf Hermann b62f70fe9f QJSEngine: Document new conversion functions
... and drop the notes about QMetaType<T>. You can get a metatype for
any type these days.

Pick-to: 6.5
Change-Id: Iaae53830dfb9cbe81975c3f73cf6cbe33494884a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-03 14:44:57 +01:00
Marc Mutz 179200d2a3 QQmlPropertyCache: don't depend on locale for toupper
The C toupper/tolower functions are locale-dependent. Given the right
locale (Türkiye, e.g.), toupper(i) is either

- İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or
- i (unchanged; if it isn't)

Both results are wrong for the present use-case. Use the new
QtMiscUtils::toAsciiUpper() function instead.

Amends d481f2ff51.

Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-109235
Change-Id: Ib66593fc7eff3edc0cc16291ca3eae8bdf0dd8ed
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-03 09:46:19 +01:00
Mitch Curtis 29106dc0c0 testbench: save search text between session
This makes using the testbench more convenient, as you don't need to
search for the controls you're interested in each time you run it.

Also added an extra font icon (clear), which required regenerating
the set from fontello. The same license is still applicable since
they're from Font Awesome.

Pick-to: 6.5
Change-Id: I9b44f7f8bce0bb4032071c19186eb5affbfe42a5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-01-03 12:09:41 +08:00
Oliver Eftevaag f641848af9 QQuickFlickable: add internal doc comments
The codebase around qquickflickable and qquicktimeline is not very
intuitive to read for people that are not already familiar with it.

This patch is an effort to improve the readablility to some degree.

Pick-to: 6.5
Change-Id: Ie8082040156323ba6b316d4a8800a15c50caaed2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-03 01:24:45 +01:00
Shawn Rutledge 7ece01a794 tst_PointHandler::tabletStylus: see why velocity check sometimes fails
At least with QCOMPARE_GT we will get to see the value when it fails.

Change-Id: Ie2d3d0289984b6da4b65a739b9bd5dc4bbe11cff
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-01-03 00:24:45 +00:00
Ulf Hermann 3fd3a2a9d0 QObjectWrapper: Fix calling attached methods on different objects
You can generally store a method in a value and call it on a different
object. However, since we've ignored the thisObject basically forever,
we cannot just accept it right away. Add an opt-in mechanism via a
pragma that allows you to pass (implicitly via context or explicitly via
call()) specific thisObjects to QObject methods.

Fixes: QTBUG-109585
Pick-to: 6.5
Change-Id: I4c81b8ecf6317af55104ac9ebb62d98862ff24e7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-02 21:50:34 +01:00
Shawn Rutledge e39b4572c2 map example: don't restrict pinch-zoom to center
A big advantage of PinchHandler over PinchArea is the ability to zoom
into a particular location in the target Item, so let's not fail to
show that off.

Pick-to: 6.2 6.4 6.5
Change-Id: I0f22abff99bdc60bac27e72fd5f66be4796794df
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-02 18:52:57 +00:00
Ulf Hermann 344f09bb98 QtQml: Allow more fine grained control of the disk cache
You can now enable and disable the AOT-compiled code and the loading and
saving of .qmlc files separately.

Fixes: QTBUG-101358
Change-Id: I1305c4f2f75d8cff544a127e956589d1ed1aeb52
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-02 19:48:43 +01:00
Alexey Edelev 3c2c53f0ba Remove QT_USE_SYNCQT_CPP
Option has not effect anymore.

Pick-to: 6.5
Change-Id: Id054735ad9aa419b3d31531fb87c902f8a9f8da1
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-02 19:43:56 +01:00
Qt Submodule Update Bot d33db2d928 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: Ic89425229b076dcb9d56761922bc586cbd8806ca
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-02 18:42:37 +00:00
Laszlo Agocs bcfcaeb87b shapes: Privately expose the tringulator scale
For many typical uses in Qt Quick the hardcoded TRI_SCALE = 1 was
just fine. However, this is not quite sufficient for Qt Location's
purposes since the triangulator in QtGui may run out of precision
when zooming in a map and having to deal with large coordinates.

To overcome this one would pass in a transform with a < 1 scale
to the triangulator and then apply the same scaling in reverse
to the generated vertex positions (e.g. this is what the OpenGL
paint engine does). But to allow doing this, there needs to be
an internal way at least, so that one can send the desired scale
down to the default Shape rendering backend.

Pick-to: 6.5
Change-Id: I4e7f72b79d317ebc31e9d661f4a93723854e3504
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-01 16:08:49 +01:00
Marc Mutz 6ac764a4d9 QQmlPrivate: Don't allocate just to parse a number
... or compare to "true".

Use QLatin1StringView::toInt() and qstrcmp() instead.

Pick-to: 6.5
Change-Id: I3052895b59c5b8232097bf56255ba328bc6b3e95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-12-27 23:11:34 +01:00
Marc Mutz cf85487792 De-inline DomItem::subReferencesItem()
It calls fromQList<Path>(), which is compiled 55x at almost 0.5s each
time round, contributing ~24s to a 'ninja qtdeclarative' build.

It is the top-most non-QMetaType/non-std template instantation
according to Clang -ftime-trace.

Also de-inlined DomItem::subReferenceItem() before realizing that
there are tons of other member functions that need to be de-inlined in
that class and giving up for this round.

Pick-to: 6.5
Task-number: QTBUG-97601
Change-Id: I23489c68b0a5b5df3c8bd0e4f6c3cb3c1ba5bd4f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-12-27 17:30:20 +01:00
Marc Mutz 1e852bb496 De-inline QQmlPrivate::revisionClassInfos()
It was compiled 1152 times, with the QList::push_back alone
contributing a cumulative ~24sec to a 'ninja qtdeclarative'. There's
no reason it should be inline, so make it out-of-line.

This function was the highest non-QMetaType/non-std contributor in a
Clang -ftime-trace build of qtdeclarative.

Pick-to: 6.5
Task-number: QTBUG-97601
Change-Id: I143639168f859dc604b902647fe921332bbe49c0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-12-27 17:30:06 +01:00
Richard Moe Gustavsen 04a155dba4 doc, QQuickTreeView: hasChildren should be bool, not int
This patch corrects the type in the documentation.

Pick-to: 6.5 6.4
Change-Id: I9a3114fb3a1b2f72efc73ec471d6c49cafe08701
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-12-23 20:42:04 +01:00
Richard Moe Gustavsen 6bfc50dcb4 QQuickTreeView: change the order of row and column to modelIndex(), v2
This patch amends 46fb848411. That change swapped the
order of row and column to QQuickTableView::modelIndex().
But that function is virtual, so we need to apply the
same change to the overridden function in QQuickTreeView
as well.

Task-number: QTBUG-109542
Pick-to: 6.5 6.4
Change-Id: I8a2abbc16baba550683d6184573aecaad72c818d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-12-23 14:21:17 +01:00
Ulf Hermann b1df14cfc0 QmlCompiler: std::move() registers where possible
In the common case that we read a register only once, in the same basic
block, generate a std::move() in order to move it into place.

Especially for QVariants holding large internal objects, this should
help performance.

Fixes: QTBUG-101452
Change-Id: I015892e1046ca7b739dbd296756f3f012dba5f9b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2022-12-23 09:02:37 +01:00
Ulf Hermann 35e2bb0906 QmlCompiler: Test that infinities cleanly cast to int
Task-number: QTBUG-108820
Change-Id: I984f6f35ffd32ca9adae31e56010d10c683e5615
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2022-12-23 09:02:24 +01:00
Richard Moe Gustavsen d6352cd4aa Native style: remove setting font from QStyle
This is a follow-up on 43eca45b06.

Which font a control should use should follow
normal font propagation. So setting a different
font explicitly in every control is not ideal.
The font is in practice the same for all controls
anyway.

This will also remove a warning that will be
printed if the application assigns a custom
background delegate to a Button.

Fixes: QTBUG-98098
Change-Id: I4f9304b391b4b9e398882fc532cbff5b09f53aff
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-12-22 19:41:12 +01:00
Volker Hilsheimer dc8f44b145 QQuickWidget: always accept touch events and grabbed event points
A QQuickWidget contains a Quick UI, which can be expected to handle
touch events, and it handles touch events by forwarding them to the
QQuickWindow. So set the AcceptTouchEvents attribute and let the
Qt Quick delivery machinery deal with the touch-mouse synthesis
within the scene.

Also, Qt Quick's event delivery might return event points as ignored
after setting the exclusive grabber. Qt Widgets touch event delivery
logic doesn't care about exclusive grabbers, and relies on the event
points being accepted to make the widget that received the TouchBegin
an implicit grabber. QQuickWidget needs to translate those states back,
so accept all points that come back with a grabber.

Add a test that verifies that a button in a popup gets all events,
and that those events are translated correctly - without the fix,
the "clicked" test fails, as the release is delivered, but with
coordinates outside of the button.

Also test that we can have two QQuickWidgets where each gets one
touch point.

Fixes: QTBUG-101736
Pick-to: 6.5 6.4 6.2
Change-Id: I3a2bf05fd297ae4d72b6e236ecd8e5ddac37ce06
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-12-22 09:40:41 +01:00
Ulf Hermann 4cbc25f379 Controls: Move QtQuick.Controls.impl import to QtQuick.Controls.Basic
We want it to be available in all the individual styles, not only if you
import QtQuick.Controls.

Fixes: QTBUG-104768
Fixes: QTBUG-109299
Pick-to: 6.5
Change-Id: Id483ee9f721e0c820bed638702a4a8aced759063
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-12-22 03:57:04 +01:00
Mitch Curtis 0cd146b4b0 Fix warnings with native styles
Amends e592a2ad31 to cover some cases
that were missed. They were missed because I incorrectly assumed that
the various test functions that I added in
0765c176e7 would catch warnings,
forgetting that the fact that we set
QT_QUICK_CONTROLS_IGNORE_CUSTOMIZATION_WARNINGS to 1 in tst_macos and
tst_windows meant that we'd never get the warnings.

Fixes: QTBUG-109438
Pick-to: 6.5
Change-Id: I527785a3adf3afb2a7ee4943300e87909f21562e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-12-22 10:57:04 +08:00
Kaj Grönholm ae6546c240 Change asserts to runtime checking
In rare cases it is possible to get into situation where m_effect nor
m_effectSource exists at the time update* methods are reached.

Task-number: QTBUG-109506
Pick-to: 6.5 6.4
Change-Id: I74e9a156ae8e313b60243020a8c65b89770c27ce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-12-22 00:12:24 +02:00
Andreas Eliasson 239082b5ad Doc: Add createObject() approach to dynamically generating menu items
Fixes: QTBUG-108798
Pick-to: 6.5 6.4 6.2
Change-Id: Ie8c8edfe00b11eca0082e89c864ec20cef8748e5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-12-21 16:49:25 +01:00
Paul Wicking 21455028f3 Revamp Qt Quick Layouts overview documentation
* Use sentence capitalization in section titles
* Move sections around for improved reading experience.
* Reflow text to conform to 80 column documentation width convention.
* Add a section that describes spacing in more detail.
* Add new snippet that shows the impact of default spacing on layouts.
* Add new snippet that shows spans in a GridLayout.
* Add information about Spans, and how unneeded spans and empty
  columns are ignored.
* Update screenshot with improved color choice, add screenshot as
  visual aid to new text.
* Describe how the size hints of items can be (ab)used in order to
  specify size weights/ratios on each item.
* Describe how each item is aligned inside a cell.
* Emphasize that size hints should never depend on "external" factors.

Pick-to: 6.5
Fixes: QTBUG-109437
Fixes: QTBUG-98991
Fixes: QTBUG-91040
Task-number: QTBUG-103976
Change-Id: Ia69b4e679eece56a5e6bf1a49038118a320b76f6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-12-21 16:49:25 +01:00
Giuseppe D'Angelo 9bad017590 qmlRegister*: check that the registered types are concrete
For some reason the QML engine seems to allow abstract types
to be registered in some cases, using the functions that however
expect concrete types (e.g. qmlRegisterType). Add static_asserts
to prevent this from happening, with a clear error message.

Change-Id: Id3701a8671bcc02457c81c793ee53c9721223ac2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-12-21 13:19:21 +01:00
Qt Submodule Update Bot 23d6733eb8 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I868848421b42761fff93dd5230acb230e5fa3f80
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2022-12-21 05:16:55 +00:00
Richard Moe Gustavsen 46fb848411 QQuickTableView: change the order of row and column to modelIndex()
In Qt 6.3, TreeView had a function called modelIndex().
This function took two arguments: row and column.
In Qt 6.4, This function was moved into TableView
(the superclass) instead, since it was needed in both classes.
And in that process (probably because this was done
in several patches), the order of the arguments got
swapped, to conform with two other functions in
TableView that took a column and row as argument.

But this was a source incompatible change.

The result is that TreeView in Qt 6.3 has a function
modelIndex(row, column) that works differently compared
to Qt 6.4.0. The signature there is modelIndex(column, row).

This patch will therefore effectively revert that
SiC, and let modelIndex() again take row and column as
arguments, like in Qt 6.3.

The downside is that we already have two versions
of Qt released (6.4.0 and 6.4.1) that contains the SiC.
We therefore offer an environment variable that
can be set to use the swapped version, if needed.

[ChangeLog][Quick][TreeView] Because of a source incompatible
change in Qt 6.4.0 and Qt 6.4.1, modelIndex(column, row) has
been reverted back to modelIndex(row, column), equal to how it
was in Qt 6.3. This also affects modelIndex() in TableView.
If the order used in Qt 6.4.1 is needed, you can set the
environment variable QT_QUICK_TABLEVIEW_COMPAT_VERSION=6.4

Pick-to: 6.5 6.4 6.4.2
Fixes: QTBUG-109542
Change-Id: I6af5e978d42b06c61ab0728e5e8b71f2a0300d13
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-21 02:28:28 +00:00
Peter Varga 3a509c301c Clean up QQuickWindowsStyle
- Remove QStyle::polish() and QStyle::unpolish() commented code, these
  were never used in Quick implementation. QMacStyle doesn't implement
  these methods either.
- Remove QQuickWindowsVistaStyle sources, these were never added to the
  build.
- Comment out unused code in QQuickWindowsXPStyle to avoid compiler
  warnings

Change-Id: I36ec66c33dc82547a02fd80e5b9463ee726e00b2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-12-20 23:00:19 +01:00
Axel Spoerl ecc484bef9 Blacklist tst_qquicktextedit::largeTextObservesViewport
Test function flakes and blocks CI.
Blacklist temporarily until fix is provided.

Pick-to: 6.5
Task-number: QTBUG-109488
Change-Id: I0ddd472a6bc27d01439d67198db3ce81a8267ec0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-20 16:17:02 +01:00
Sami Shalayel 5c1d96b70a qquickpopuppositioner: fix popup mirroring
Fixed a bug where QQuickPopupPositioner::reposition() was confusing
coordinates obtained by mapToSource() and mapToItem() during mirroring
of the popup. This leads to popups at the wrong places, e.g. when a
rotated combobox has not enough space to unroll its popup.

Translate the coordinates using mapToItem instead of mapToSource after
computing the alternative position of the popup (e.g. when it can not
be unrolled correctly).

Add a test to check if the combobox popup appears at the right places.
Skip native styles as they might be pushing the popup around, same
for Android as they might have too small screens (which involves
more positioning logic then just the mirroring).

Fixes: QTBUG-105148
Pick-to: 5.15 6.4 6.2 6.5
Change-Id: I0033509a8824e3a71698f91ef832b94527d8e2c8
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2022-12-20 16:10:55 +01:00
Kaj Grönholm e09b72fe10 Improve blur items sizing
MultiEffect uses max 5 blur items. So to be able to divide first one 4
times without rounding, first one needs to be rounded up to next
2^4 = 16 (16,8,4,2,1). Make the first blurred item size half of the
source size (plus the rounding). This increases the blur amount and
performance and decreases texture memory usage and quality. Based on
testing it seemes like a good compromize.

Also resize bluritems only when needed.

Pick-to: 6.5
Task-number: QTBUG-109490
Change-Id: I907b48904d3f9b0414704026cc1f07c02c49a8c7
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
2022-12-20 12:09:59 +02:00
Kaj Grönholm 7c174fcf96 Cleanup and fix initial shadowOpacity
Cleanup unused properties from the effect. Also update initial shadow
opacity correctly with the color.

Task-number: QTBUG-109432
Pick-to: 6.5
Change-Id: I3615f17333ce63403d00b3df75794565b72768ed
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-12-20 12:09:53 +02:00
Kaj Grönholm 672bb1d450 Improve and optimize MultiEffect mask
Move mask calculations from fragment shader into C++ side, so that only
need to be done once vs. each pixel. Adjust slightly so that smoothstep
doesn't reach potentially undefined rangle (edge0 ≥ edge1).

Task-number: QTBUG-109431
Pick-to: 6.5
Change-Id: If0ca10385c9bf41fb32b666f2b1c4dd38b7cc192
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-12-20 12:09:47 +02:00