Commit Graph

29946 Commits

Author SHA1 Message Date
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
Kaj Grönholm 4d1c27942b Adjust the default values of shadow offsets
Default to 0 with shadow horizontal and vertical offsets. This way they
match to GE DropShadow defaults and also the shadow fits inside the
effect item area without any extra paddingRect.

Pick-to: 6.5
Change-Id: Ib02763a15c088a390dfe65e0e9216ca0a10fc58c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-12-20 12:09:41 +02:00
Kaj Grönholm cf6a4d0bf9 Fix MultiEffect sizing with layer.effect
When using Item layer.effect, the effect source item doesn't get a size
but instead the size is updated directly for the effect (see
QQuickItemLayer::updateGeometry()).

Task-number: QTBUG-109406
Pick-to: 6.5
Change-Id: I3ef7469b6286848791b9c844281c68c5988cfd01
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-12-20 12:09:36 +02:00
Eskil Abrahamsen Blomfeldt 4bad329985 Fix missing glyphs when using NativeRendering
When we look up glyphs with subpixel positions in the glyph cache,
we use the calculated subpixel position (from a set of predefined
subpixel positions) as key. In some very rare cases, we could end
up with different subpixel positions when looking up an on-screen
position than when we entered it into the cache, due to numerical
differences when doing the calculation.

The reason for this was that when entering the glyph into the
cache, we used the 16.6 fixed point representation, whereas when
looking up, we used the unmodified float. In some cases, the
converted fixed point approximation might snap to a different
predefined subpixel position than the floating point equivalent.

To avoid this, we reuse the converted fixed point positions when
looking up the glyphs in the cache.

[ChangeLog][Text] Fixed an issue where text using NativeRendering
would sometimes be missing glyphs.

Pick-to: 5.15 6.2 6.4 6.5
Fixes: QTBUG-108713
Change-Id: Iecc264eb3d27e875c24257eaefcfb18a1a5fb5be
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2022-12-20 07:07:21 +01:00
Mikolaj Boc 80310d1faf Mention the FolderListModel dep of QQuickFolderListModel
The documentation now mentions that QQuickFolderListModel's
functionality is limited when FileSystemWatcher is disabled.

Fixes: QTBUG-108266
Change-Id: I114eea24772bc58bc7ee13cc604b6bf541415edb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-12-19 23:26:57 +01:00
Richard Moe Gustavsen 3f8b598720 Spinbox: clip contentItem
If the text in a SpinBox is larger than its text field, then
the text is drawn outside of the SpinBox covering the
spinbox buttons.

This patch will set a clip on the SpinBoxes, to ensure
that the text is not drawn outside the bounds of the
content item.

The SpinBox implementation differs a bit from one style
to the next, which means that some styles will only
need to set a clip, while others will need a bit more
change. Especially the Basic style will need to expand
the size of the content item to make room for the
focus rect (which the other styles don't have, or
implement differently).

There are also two versions of the SpinBox; One that
has the up and down indicators placed on each side
of the content item, and another that has them collected
on only one side. It seems like the latter implementations
has done a copy/paste of the padding from the former, and
thereby has set a too large padding. This has also
been fixed, as it's related to the clipping bug.

Fixes: QTBUG-98355
Pick-to: 6.5 6.4
Change-Id: I2c1ce6d477cf809e2187fd80aecbc9edeb8e0c2d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-12-19 15:59:40 +01:00
Oliver Eftevaag b307bf3c4f Flickable: prevent fixup() from being called while dragging
A previous patch 5647527a8c causes
a regression. The purpose of the patch, that caused this regression,
was to update the pressPos variables, in cases where the contentItem's
geometry was modified externally, while a user were dragging the
contentItem around.

The mistake that was made, was how width and height changes were
handled. We had previously added logic in setContentWidth() and
setContentHeight() that would call fixup() (with immediate fixupMode)
to ensure that the contentItem would immediately be repositioned
inside the flickable's viewport, if the contentItem was being dragged.

It turns out that setContentWidth() and setContentHeight() are being
called from QQuickItemViewPrivate::updateViewport(), which happens
quite often, while dragging. This would make fixup() and dragging
constantly interfere with each other, since they'd not always agree on
a specific position for the contentItem.

This patch reverts the changes made to setContentWidth() and
setContentHeight(), since it turns out that those changes weren't
necessary after all. QQuickFlickablePrivate::itemGeometryChanged() only
calls viewportMoved() on x and y changes anyways.

Done-with: Jan Arve Sæther <jan-arve.saether@qt.io>
Done-with: Santhosh Kumar Selvaraj <santhosh.kumar.selvaraj@qt.io>
Fixes: QTBUG-109140
Pick-to: 5.15 6.2 6.3 6.4 6.5
Change-Id: I0bddf8685d3afc1ae04b2c092212d3c1bd742c3b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-12-19 11:50:35 +01:00
Vladimir Belyavsky 42775c91e8 Text: respect to maximumLineCount when calculating implicitWidth
Do not add extra lines into QTextLayout until they're really needed,
because this may affect layout's maximumWidth. So, in this particular
case, we need to avoid an extra call to layout.createLine() for lines
that exceed maximumLineCount value.

Pick-to: 6.4 6.5
Fixes: QTBUG-109411
Change-Id: I92daa3ee4bb3fdd73515b76374c1dca21757ddf0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-12-19 06:37:22 +00:00
Giuseppe D'Angelo 38e0a0db18 QQuickTableView: fix C++20 build
Implicit capture of `*this` by reference when using [=] is deprecated.
We can capture using [&] instead: all the variables used in the lambda
are `const` anyways.

Change-Id: Ib165e99945a5f673d97f0abdefcd4b4adee31624
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-18 16:37:33 +01:00