Commit Graph

58407 Commits

Author SHA1 Message Date
Richard Moe Gustavsen
f7e4987966 iOS: send control keys to Qt, even if IM is enabled
Perhaps dating as far back as 829e421ddc (Qt 5.8), using
the arrow keys on a bluetooth keyboard to navigate the cursor
around in a TextArea/QTextEdit has been broken. Some work
was done to remedy this with 15576c9610 (Qt 6.1) it seems, but
still, using the arrow keys is broken in 5.15, 6.2 and dev.

This patch will ensure that we send control key events, such as
Qt::Key_Up and Qt::Key_Down, to Qt, also when the focus object
accepts Input Methods.

Fixes: QTBUG-101339
Pick-to: 6.4 6.2 5.15
Change-Id: I2d12438a822a607646080ab2edb17de8ea6d337c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-24 13:42:40 +02:00
Mate Barany
65c40615d1 qdbusxml2cpp: Drop extra QString()
This commit addresses a comment from the review of QTBUG-98434.

Drop the extra QString(), .arg can be called on _L1 as well.

Task-number: QTBUG-103100
Change-Id: I4891d42536f6ea413464bea78de4b82aa6363a11
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-09-24 12:38:32 +02:00
Axel Spoerl
d46f317c8e Fix native titlebar offset and resizing upon unplugging dock widgets
When a dock widget received a native title bar upon unplugging, the
position of the newly unplugged dock widget was calculated without
taking the title bar's height into consideration.

Furthermore, dock widgets grew by the separator size upon undocking.
That is fixed by 10a143ccd7 by relying
on the assumption that passing a QRect() to the unplugging method
leads to un unchanged dock widget geometry.
However, when more than one dock widgets are docked in the same
main window dock on macOS or Windows, the size is stil increased.

This patch corrects the position offset for native title bars.
It also corrects an unplugged dock widget's geometry by the sparator's
size.

Fixes: QTBUG-106530
Fixes: QTBUG-106531
Pick-to: 6.4 6.2 5.15
Change-Id: Ia4bcb556841e14146f19c1377f4010d5ae009bcf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-24 07:06:42 +02:00
Axel Spoerl
d35feca20c Propagate appearance property from QPlatformTheme to QStyleHints
Implement appearance property, getter and notifier in QStyleHints.

Update appearance property in QStyleHints when handling theme
change in QGuiApplicationPrivate.

Task-number: QTBUG-106381
Change-Id: Idd67ca9df248ec9d9e67c0d48121e8eead11a9e2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-24 01:30:48 +02:00
Mate Barany
ac2154c7e9 qdbusxml2cpp: Remove unnecessary lines
Noticed during the review of QTBUG-98434. The variable includeGuard is
a QString, that is converted into a Latin1 string and then converted
back to QString. Remove these unnecessary lines.

Task-number: QTBUG-103100
Change-Id: I335d49ef990cb6de24031be380b5c2c7e12e961e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-09-24 01:30:48 +02:00
Shawn Rutledge
9d6c1f387a Rename QHoverEvent ctor pos argument to scenePos
The QHoverEvent ctor takes two points: scenePos and globalPos; the first
of those is passed to the QSinglePointEvent ctor as _both_ the local and
scene pos, which calls QMutableEventPoint::setScenePosition() on the
persistent QEventPoint instance, and then detaches before setting
ephemeral state.

Therefore, we must construct QHoverEvent with scene position, not local
position, so that the right value is persisted. To localize a
QHoverEvent during delivery, use QMutableEventPoint::setPosition().
This needs to be done repeatedly while visiting multiple widgets or
items; the detach() prevents it from being saved in the persistent
QEventPoint in QPointingDevicePrivate::EventPointMap.

Amends 0a64a044b6

Task-number: QTBUG-35409
Task-number: QTBUG-100324
Change-Id: Ic1084e1c3cd384683666ba52fe34f16b9d039877
Pick-to: 6.4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-23 23:29:54 +02:00
Marc Mutz
bbd1f576f7 qUn/Compress: reject negative lengths
In qCompress, we've been calculating postive len values out of them,
only to fail at random points later, possibly running into UB. Fail
early instead.

In qUncompress, we've been catching negative values, and reported them
indiscriminately as "invalid data". Use a better warning message
instead.

By rights, nbytes ≥ 0 would be a precondition of both functions (which
we would Q_ASSERT() on), but seeing we're picking this back into LTS
branches, I found it prudent to use a non-fatal way to signal the
precondition violation.

If and when we keep these functions for Qt 7, it will be as an
overload that takes QByteArrayView, in which case nbytes ≥ 0 enters as
a hard precondition via the QByteArrayView constructor, so there
appears to be no need to pre-program a Q_ASSERT() for Qt 7.0.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104972
Task-number: QTBUG-106542
Change-Id: I6a1b25fe12d31e3d4c845033cad320832976f83c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-23 20:08:57 +02:00
Marc Mutz
6472616e6c qUncompress(): introduce more functions a la invalidCompressedData()
... and use them consistently instead of naked qWarning()s.

As a drive-by, fix the warnings we generate on failures, which
all-too-often was "invalid data".

Code for minimal size by DRYing what the compiler can't, and using
Q_DECL_COLD_FUNCTION to avoid excessive inlining.

Left the one qWarning() in qCompress(), for now, because that would
have changed the return value from an empty to a null byte array.

Move invalidCompressedData() to where the others are defined, too,
because it's required by a follow-up commit.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104972
Change-Id: Ia43aa315960b06530e98c1d7525ccf0e7f71bb5c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-23 20:08:56 +02:00
Eskil Abrahamsen Blomfeldt
ce4c26c8d1 Revert "QTextLayout: fix maximumWidth() for a text containing line separator"
This reverts commit 013c346a8d. It was
determined to cause a regression in Qt Quick: QTBUG-106899.

In order to unblock integrations, we need to revert the change. It
can be re-committed later when the problem has been analyzed and
addressed.

Pick-to: 6.2 6.4
Fixes: QTBUG-106899
Task-number: QTBUG-89557
Task-number: QTBUG-104986
Change-Id: I04054587f68ab39fdb038b02fc69ebfa3dc7d197
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-23 20:08:56 +02:00
Richard Moe Gustavsen
9516823fce iOS, input panel: be more careful before enabling QIOSKeyboardListener
The current implementation would assume that if we get a
UIKeyboardWillShowNotification, the keyboard is about to
show, and we should therefore enable the gesture.

This is problematic on an iPad with a hardware keyboard
connected, because we do actually get get a
UIKeyboardWillShowNotification on startup, even when the
standard input panel is not showing. From speculation, this
is probably because there is a little floating menu at the
bottom of the screen that lets you start dictation mode.
And in UIKit, this is probably implemented as a UIKeyboard.

This new input panel has a zero size, according to the
UIKeyboardFrameEndUserInfoKey key in the notification.
This means that we can still trust our own implementation
of QIOSInputContext::isInputPanelVisible() to be false
when a hardware keyboard is connected.

This patch will therefore only enable the gesture if we
understand the input panel to be visible, rather than
automatically assume that it is based on the
UIKeyboardWillShowNotification alone.

This will also stop the assert inside touchesBegan
from triggering.

Fixes: QTBUG-106387
Pick-to: 6.4 6.2 5.15
Change-Id: Ia3d27864325b6efb49f03fb20b711979f2d07fbf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-23 16:32:46 +02:00
Mikolaj Boc
56eb4badb5 Return the actual modal window in QGuiApplicationPrivate::isWindowBlocked
The method erroneously returns the common ancestor of the |window| in
question and a modal window in case of window-modality of the modal
window. What should be returned is the modal window because it is the
one that blocks the |window|.

Fixes: QTBUG-106627
Change-Id: Ib4da6c1e9757629bbedbd8a16407cd6b5b0d5d27
Pick-to: 6.4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-23 14:28:25 +00:00
Mate Barany
c2df659c8d qdbusxml2cpp: Fix mismatches between strings and string literals
Addressing some remarks made during the review of QTBUG-98434.

Fix the mismatches between strings and string literals.

Task-number: QTBUG-103100
Change-Id: I3a7d2574f55fcffa81b8c87fb510aba0a8853330
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-09-23 13:53:27 +02:00
Joerg Bornemann
67de96852d CMake: Add finalization to plugins created with qt_add_plugin
Add the MANUAL_FINALIZATION option to qt_add_plugin and run
qt_finalize_target like we do for qt_add_executable and qt_add_library.

Currently, the only user-visible effect is that resource files are put
into a FOLDER and not underneath a XXX_other_files target.

Change-Id: I430d87b5357f6d2ed7fe32198a73eb919f393dd8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-23 13:53:27 +02:00
Mate Barany
de80185575 QtWidgets: Fix mismatches between string types and literals
To address some findings from the review of QTBUG-98434, fix type
mismatches between strings and string literals in QtWidgets.

Task-number: QTBUG-103100
Change-Id: Ie4543d49ddfba382183c5d43df067694f5da53c7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-09-23 13:53:26 +02:00
Mikolaj Boc
b1b61636b3 Introduce centralized means of checking for asyncify
The new function has an advantage of not requring EM_JS.

Change-Id: Ib9ad0e6b59cfe2e6864697a14b5cfdb39f62af2d
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-09-23 10:14:28 +02:00
Yuhang Zhao
20ae1cd486 Windows QPA: remove two unused forward declared structs
They are not used, so just remove them.

Pick-to: 6.4
Change-Id: I9b92ef97df85a1ab975bf6b6d460b5427135c301
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-23 10:40:46 +08:00
Yuhang Zhao
0a02022805 QWindowsKeyMapper: make one variable const
It won't change, so make it const.

Change-Id: I7ac828baca5340125be2d095ddfa69900543f002
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-23 10:40:36 +08:00
Mårten Nordheim
2c6c76374e QFlags: Mark the operators declared in macro maybe_unused
Because, when used in a .cpp file, the compiler can verify that
they are. With warnings-are-errors this breaks compilation for me
on windows with clang++.

Pick-to: 6.2 6.4
Change-Id: Ib29c3b0b485be2c7d7cf6f1fa4541cac8fe32708
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-23 00:34:30 +02:00
Mårten Nordheim
bf9ba81429 QFlags: Mark the mixed enum operator declared in macro maybe_unused
Because, when used in a .cpp file, the compiler can verify that
it is. With warnings-are-errors this can break compilation.

Pick-to: 6.4 6.2
Change-Id: I2c403d914fca24158dba93f618476521cbcfe39f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-23 00:34:30 +02:00
Laszlo Agocs
b61e9846d3 rhi: Optimize the default null QShader
To please qmlbench. 441->463 in delegates_shadereffect.qml

Change-Id: I66bbfd7747df958963a4ebf588a1461edc5dce59
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-09-22 21:23:05 +00:00
Fabian Kosmale
9b3de58d2d QMetaType of non-const ref: play nice with template instantiations
...by making QMetaTypeId2 contain all expected members.
While we don't allow QMetaType from non-const references, we want to
get to the static_assert telling us as much, instead of running into
more or less incomprehensible error messages in the depths of
qmetatype.h.

Pick-to: 6.4
Task-number: QTBUG-106672
Change-Id: Ica9b13fee95eda97cafab2cccdc5249dfc3dcdf2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-09-22 22:43:37 +02:00
Øystein Heskestad
d8387fc538 Reduce foldCasing of the needle in Boyer-Moore QString searches
Before searching, foldCase the first up to 256 characters, and use this
buffer to compare against the haystack. If the needle is larger than the
buffer, compare the rest of the needle against the rest of the haystack
for every potential match. The buffer is placed on the stack and must be
refolded for each search, but this change does not break the API.

This is faster than the old implementation, except if the needle is long
and it is found near the beginning of the haystack, or if the needle is
long and it is not found in a short haystack where few comparisons are
done and hence few case foldings were needed in the old implementation.

Benchmarking using tst_bench_qstringtokenizer tokenize_qstring_qstring
shows an improvement for the the total testcase and usually for each
individual test.

Fixes: QTBUG-100239
Change-Id: Ie61342eb5c19f32de3c1ba0a51dbb0db503bdf3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 18:05:44 +02:00
Mate Barany
266eb124a2 QtGui: Replace QStringLiteral("...").arg with "..."_L1.arg
This commit addresses a comment from the review of QTBUG-98434.

QL1S has its own arg()s, replace QStringLiteral("...").arg with
"..."_L1.arg.

Task-number: QTBUG-103100
Change-Id: I5313783e36101a9a65c7d5a2344ca46614658b80
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-09-22 17:34:52 +02:00
Mårten Nordheim
c633f4644c tst_QHash: Fix outdated rehash test
Inserting the same key repeatedly with QMultiHash will not
test rehashing behavior because in Qt6 those entries all
end up in a linked list.

Pick-to: 6.4
Change-Id: I78c45eed0f35a13af6d6da75d7189a6933750f13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 17:34:51 +02:00
Edward Welbourne
f553e4b4c3 tst_QDom: replace a final u"..."_qs (deprecated) with u"..."_s
It seems all the others have had this treatment, but one got missed or
added while the others were being fixed.

Change-Id: If47e2c6bf939b7a55f2c38b029c1df3a901e8bfc
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-09-22 17:34:51 +02:00
Edward Welbourne
75d59c9502 Add QTest::currentTestResolved() and use in testlib
The QTRY_* macros and QTestEventLoop have (since 6.3) been exiting
their loops early if the test has failed. Where that was appropriate,
they should also have been exiting early on skip.

[ChangeLog][QtTest] Added QTest::currentTestResolved(), which is true
if the test has failed or skipped. The QTRY_*() macros and
QTestEventLoop now use this, rather than QTest::currentTestFailed(),
to test whether they should stop looping, so that they also do so on a
skip.

Task-number: QTBUG-104441
Change-Id: Ibf3d5a095b35e6670bc3daf756f05b66f7f3ef9b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-09-22 17:34:51 +02:00
Mårten Nordheim
1fa0e86995 QNetworkReply: honor legacy behavior of setting Accept-Encoding
And don't decompress the data

Pick-to: 6.4
Fixes: QTBUG-106689
Change-Id: I93a96be8178e24ff0b0bb8647276828161445cf5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-09-22 15:34:51 +00:00
Edward Welbourne
b3262c7e54 QDoc-ify QTest::runningTest()'s comment
While it's being picked into 6.3, it's not present in 6.3.[01], so
I've left it out of QDoc's sight (even though it's still \internal)
for the version picked to 6.3, but let's include it in internal docs
as "from 6.4" since that's the first minor release to contain it.

Pick-to: 6.4
Change-Id: I1704a1ca4ba1231d0213e9ca236ef8401a59ddd0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-09-22 17:34:51 +02:00
Edward Welbourne
0462dba766 Skip early return from test loops during cleanup()
The QTRY_* macros and QTestEventLoop exit early if the test has
resolved; however, in the cleanup phase of a test, even if the test
has failed, these loops should continue as normal.

[ChangeLog][QtTest] During the cleanup() phase of a test, the QTRY_*
macros and QTestEventLoop now ignore the test resolution, in contrast
to when they are used from the test itself, which (since 6.3.0) exits
the loops early if the test has failed.

Pick-to: 6.4 6.3
Fixes: QTBUG-104441
Change-Id: I2673161967cbbc57815155af698a9338ab98a686
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-09-22 17:34:51 +02:00
Edward Welbourne
abab3c5dad Fix error in TAP test logger's regex to recognize QVERIFY() output
The regex used a greedy .+ to match an actual dot and a space,
preceding an open parenthesis, with the result that if the message
contained any parentheses that .+ swallowed everything up to the last
of them. Correct the regex so that recently-added tests' error
messages show up correctly.

Change-Id: I6e52c9b2a6e7959335fcddbb4266f65b589eba68
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-09-22 17:34:51 +02:00
Edward Welbourne
16f5132b21 Add test-case for TAP logging glitch
The recently added test for QTestEventLoop produced a message which
the TAP test-logger mis-parses. Since that message shall soon go away
(when I fix the bug the new test exists to verify), modify one of
cmptest's QVERIFY2() messages to trip up the same bug, so we can spot
any regressions on this in future (after the imminent fix to this TAP
issue).

Change-Id: Ibbe9931c01c75df529c9571e2bbdbd34010dd9ec
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-09-22 17:34:51 +02:00
Edward Welbourne
73a2320278 Fix signed/unsigned comparison warning in shader test
Trivial, noticed while looking for deprecation warnings.

Change-Id: Ie2c450d457e25b998fb686c4c22333781364073c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-09-22 17:34:51 +02:00
Laszlo Agocs
8207751661 eglfs: Add env.var. to disable the dedicated drmHandleEvent thread
Setting QT_QPA_EGLFS_KMS_NO_EVENT_READER_THREAD=1 makes it operate
like it did before 5.12.7: just calling drmhandleEvent (guarded by
a mutex) on the current (main or render, depending on the QQ render
loop) thread.

This should not be needed and is discouraged (will certainly cause
deadlocks in multiscreen setups + QQ threaded render loop on certain
embedded systems), but it seems necessary to provide a way to revert
back to the old way of functioning as there are reports about
problems with screen cloning when the dedicated event reading thread
is used.

Task-number: QTBUG-91882
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I4cddcd09149dcab9e135467b6ef0e047a2a0ecff
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-09-22 17:31:31 +02:00
Sona Kurazyan
95a3f85a2f Move docs for QT_REQUIRE_VERSION to qmessagebox.cpp
Task-number: QTBUG-106154
Change-Id: I880b25a7dd4b834aa6b23a670bddddac6aaec256
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-22 13:48:16 +02:00
Sona Kurazyan
64eab8e234 Move docs for Q_DECLARE_TYPEINFO to qtypeinfo.qdoc
Task-number: QTBUG-106154
Change-Id: I318eb85caf188573915e3417e7470fd0a6efabca
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 13:48:16 +02:00
Sona Kurazyan
28ecb58d79 Move docs for helpers from QtForeach to qforeach.qdoc
Task-number: QTBUG-106154
Change-Id: Icc2fbce4a96d18e9af880d4b0ee4a31cb360e5ed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 13:48:15 +02:00
Sona Kurazyan
f7bd53b2a6 Move docs for deprecation macros to qtdeprecationmarkers.qdoc
Additionally:

- Generate the QtDeprecationMarkers fw header
- Add an overview page for QtDeprecationMarkers (otherwise the docs for
  deprecated QT_DISABLE_DEPRECATED_BEFORE aren't generated)
- Fix docs to stop mentioning deprecated QT_DISABLE_DEPRECATED_BEFORE.

Task-number: QTBUG-106154
Change-Id: Ic8c45ba3d9d267036ca470b208676a3ac82485eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 13:48:15 +02:00
Sona Kurazyan
3535f46374 QSysInfo: remove unneeded assert
Change-Id: I850aeb2acf569c42fd15df860d9724d8e7e236ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 13:48:15 +02:00
Sona Kurazyan
767beb7fff Move the implementation and docs of QSysInfo to qsysinfo.cpp
Task-number: QTBUG-106154
Change-Id: Ib2d812104b3514fb255d79ab6e4097ec6a851e21
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-22 13:48:15 +02:00
Sona Kurazyan
27197d1a12 Move QT_VERSION_STR docs to qlibraryinfo.cpp
Task-number: QTBUG-106154
Change-Id: Iba5f4d76dc220dc0ea3c7463151bfb3b8e85c02e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 13:48:15 +02:00
Sona Kurazyan
f326a565ef Move docs for Q_INT64_C()/Q_UINT64_C() macros to qtypes.cpp
Task-number: QTBUG-106154
Change-Id: I5975a1633c2848d13e95cb857b31bb1eab11573c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 13:48:15 +02:00
Sona Kurazyan
a47a5932a6 Mention in qRound*() docs about possibe UB
Change-Id: I0fcb9a72993959d028df1a9ef719938b1c555a2d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-22 13:48:15 +02:00
Sona Kurazyan
8e0b0aa5c5 Extract overview page for QtTypes header from QtGlobal docs
Task-number: QTBUG-106154
Change-Id: Ieb325d38572bf8659d3f49fa3948533156c70e40
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-09-22 13:48:14 +02:00
Marc Mutz
3cb00e415d DRY qCompress/qUncompress: introduce CompressedSizeHint_t
... and use it to remove the associated magic number 4 from the code
base.

As a drive-by, replace a naked qWarning() with the existing
invalidCompressedData() helper function, and a C-style cast with
reinterpret_cast.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-106542
Change-Id: I35004757e01bfc0747f7cc65bdf6eb243225caad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-22 11:07:20 +02:00
Laszlo Agocs
dccca4ab33 rhi: QShader: Only hash the first shader
This is good enough for a hash value and brings a not
insignificant boost to cases when this is used heavily.

In qmlbench with delegates_shadereffect.qml this improves
the results in my runs 386->405.

Pick-to: 6.4
Change-Id: I3dbb9ffabf5986c5ff6b69928b3f073e944450ee
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-09-22 02:09:35 +02:00
Mate Barany
2b841d40b2 QtGui: replace indexed for loop with range for loop
This commit addresses a comment from the review of QTBUG-98434.

Replace the index based for loop with a range based for loop.

Task-number: QTBUG-103100
Change-Id: Iaf92382f07172b254486882beb67f1927ad89be5
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-09-21 22:11:21 +02:00
Friedemann Kleint
33bee95910 Brush up the drop site example
- Use qsizetype
- Use new string literals instead of deprecated QLatin1String()
- Streamline some code
- Remove unused member variable
- Remove module include

Pick-to: 6.4
Change-Id: Ia96424a23f3ae10e57db942de49949ce3aef8876
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-21 20:52:14 +02:00
Axel Spoerl
10a143ccd7 Prevent dock widget from resizing upon unplugging from main window
QDockWidgetLayoutState::itemRect() has been used to calculate a dock
widget's size when unplugging from the main window. This method is meant
to calculate the size of the rubber band, showing the dock widget's
dock area.

The rubber band is by QDockAreaLayout::sep wider (top or bottom dock)
or higher (left or right dock) than the respective dock widget. This is
to make sure the rubber band is never fully covered by the dock widget.

By wrongly using itemRect() also for the dock widget's size after
unplugging, the dock widget grows in size each time it is unplugged.

This patch passes an invalid QRect to QDockWidgetPrivate::unplug(), in
order to prevent resizing.

tst_QDockWidget::unplugAndResize() is extended to check size
consistency after unplugging (corrected for frame margins).

Fixes: QTBUG-106531
Pick-to: 6.4 6.2
Change-Id: I1cf9f695691b0e165a5cb2881781602426e5d587
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-21 18:41:43 +00:00
Fabian Kosmale
a8ccd9cd84 moc: Do not fail to compile meta-methods containing non-const ref types
Amends 2d0c31e7d9. We were using
MetaTypeDecay in qTryMetaTypeInterfaceForType; but that is not used by
moc when complete types are enforced. Change qt_metaTypeArray to also
use qTryMetaTypeInterfaceForType, so that the code path for "force
complete types"[0] and the normal one do not diverge.

[0] Most easily enabled by using one of the QML type registration
macros.

Fixes: QTBUG-106672
Pick-to: 6.4 6.4.0
Change-Id: I9bf14873d1d0c4127a676643f7e8eb77f6e42dc8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-21 18:41:43 +00:00
Alexey Edelev
0a4761522b Avoid the 'file' command shadowing
Avoid the 'file' command shadowing by a variable and use file name when
filtering header files by type.

Amends 8539e641f6

Task-number: QTBUG-103196
Change-Id: If012975efafaf119cffbd89baf84df334bc057ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-21 20:41:43 +02:00