Commit Graph

60876 Commits

Author SHA1 Message Date
Ahmad Samir
dc6578a373 QTimerInfo: fix lambda name
We are trying to find the first time in the list that has not expired.

Drive-by change: fix a narrowing conversion warning

Change-Id: I9e5f95b0f9d767f1fda9061c928e3182f4be6a85
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-17 00:01:09 +02:00
Laszlo Agocs
dc44323586 rhi: Make non-critical pipeline cache warnings qCDebug instead
It's not just that these are not fatal, but some "errors" are
not actual errors, e.g. getting "Nothing to serialize" from Metal
is not something we care about.

Convert them from qWarning to qCDebug with our standard category,
so they still all show up when running with QSG_INFO=1, but won't
pollute the output for regular users. Even if a cache file cannot
be used or written, that's not something typical users care about.

Pick-to: 6.5
Fixes: QTBUG-110485
Change-Id: I63d815f7b95c4d6a4428497b7247811e860ebf04
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-03-16 19:33:43 +00:00
Marc Mutz
c5d4dde678 QMessageAuthenticationCode: add move SMFs and swap()
QCryptographicHash is move-only these days, so
QMessageAuthenticationCode should not be left behind.

[ChangeLog][QtCore][QMessageAuthenticationCode] Added move
constructor, move assignment operator and swap() function.

Fixes: QTBUG-111677
Change-Id: I420f24c04828e8ad7043a9e8c9e7e2d47dd183e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-16 17:27:29 +01:00
Ahmad Samir
41fea4f5fa QDate: add epochDate() helper to unittests
Drive-by change: add an assert for JULIAN_DAY_FOR_EPOCH.

Change-Id: I891ef253f1f16b1efb8354d1b179f319b3553feb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-16 17:52:20 +02:00
Michal Klocek
fb24576fa4 Fix compilation issues for android
Deals with:
  * unknown class name 'Object'; did you mean 'QObject'?
  * use of undeclared identifier 'QTimer'; did you mean 'QTime'?

Pick-to: 6.5
Change-Id: Id63064e70090ed1f816fa19db047b382220d634c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-03-16 14:48:43 +01:00
Tor Arne Vestbø
b4814163c7 QEdidParser: Fix parsing of string descriptors with length less than 13
The EDID 1.4 spec states that string descriptors with length less than
13 are terminated with \n and padded with spaces. Since we sanitize the
string by replacing non-printable characters with '-', we can't start
out by replacing \n and \r with \0 to simulate a zero-terminated string,
as these null bytes will then be replaced with '-'. And even if they
were not, QQtring::fromLatin1(QByteArray) in Qt 6 will include any null
bytes verbatim as Unicode null characters, so we'd still end up with
a wrongly parsed string.

We simplify the process by following the spec, truncating the byte array
at the first occurrence of \n (without any check that the following bytes
are pure padding), and then doing the non-printable character replacement.

Pick-to: 6.5 6.2
Change-Id: I9f4e77ddb7b1b759c08b94b29e28d8c148b5435f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-03-16 14:17:24 +01:00
Tor Arne Vestbø
13951b44cd Add basic test for QWindow foreign windows
Only implemented on macOS and Windows for now.

Change-Id: Ib6330bc7024453d23675c1770367e8da6c4c9a34
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-03-16 14:17:24 +01:00
Ievgenii Meshcheriakov
d243ab7d00 QtDBus: Don't list removed listnames example in manifestmeta.thumbnail.names
This amends eea83bac26.

Task-number: QTBUG-111366
Pick-to: 6.5
Change-Id: Ic9f57a4d99f7f2a1132c15ae8e999386678dbec3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-16 13:17:24 +00:00
Ulf Hermann
566e5e1acf moc: Allow anonymous properties
This is private for now. It's very handy to have anonymous properties
for the QML model/delegate adaptors. There are models with only
"singular" model data that doesn't have any sub-properties. Such model
data should be available from the model object via an empty string as
role. This way we can get rid of a lot of special casing.

Task-number: QTBUG-104752
Change-Id: I229e355a7cab064ee1c9f89557bc0244a5d0c90a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-16 14:17:24 +01:00
Laszlo Agocs
cac1abb012 QOpenGLTexture: Add a doc note about the unavoidable conversion
As requested by users. Explicitly stated in the docs that the QImage
is going to be converted, to avoid surprises.

Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-105364
Change-Id: Ia6a8930bcee8bd3cdbef016083599bd435b37a09
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-03-16 10:27:18 +01:00
Laszlo Agocs
27ab0f012a Add QOpenGLWindow/Widget doc note about depth/stencil
Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-108050
Change-Id: If011d6efff996870ff23eff3c2d1cf455d31b7a6
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-03-16 10:26:40 +01:00
Marc Mutz
9e18e5c869 Modernize Tuple Protocol implementations
The existing get<I>() implementations are very clever™, if I, as their
inventor in at least the Qt ecosystem, may say so myself. E.g. the ()
around the return value are absolutely required, to ensure we return
by reference, not by value, through decltype(auto).

C++23 gives us forward_like, which doesn't require the parentheses,
because it always returns a reference.

Also replace decay_t with C++20's remove_cvref_t, the latter being
more efficient (performs less work).

Change-Id: Ic9ed0c25e6d6bfbd77d7c85858a8d97fe58be615
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-16 06:21:42 +01:00
Marc Mutz
49e5f21908 QVector<N>D: simplify get<I>() implementation
instead of if (I == x) return ~~~[x]; just always return ~~~[I].

Pick-to: 6.5
Change-Id: I236159480ab90201f7e3f6f90fdcd1cab5d3a223
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-16 00:46:28 +01:00
Axel Spoerl
09c3cd8503 QPlainTextEdit: Don't block signals on page step
Signals of the vertical scroll bar were blocked when scrolling with
pageUp/pageDown keys or clicking on the scroll range outside the
scroll bar. This has lead to inconsistent signal emissions:

The vertical scroll bar's valueChanged signal was emitted only on
single steps and when the scroll bar was moved with the mouse.
When it was moved in page steps by clicking on the scroll range or
pressing pageUp/pageDown, it was not emitted.

This patch removes the signal blocker for page step movements, which
was added in 94fd108ea4 to replace
explicit calls to blockSignals(), which were added in
c14d442b08ac81327b173b0a220c7b1840667899.

The patch also adds test function to tst_QPlainTextEdit to check if
the valueChanged signal is emitted correctly.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-8682
Fixes: QTBUG-25365
Change-Id: I4385a5387c91497f623978e35bbbe3e06f473afe
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-03-15 23:45:00 +01:00
Nicolas Fella
99975ec07f QApplication: Fix DEPRECATED_VERSION for setActiveWindow
It's not deprecated in 6.4, only 6.5

Pick-to: 6.5
Change-Id: I86a09b9ce5a7f4d8b1d80a6e67218dfe00f93844
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-15 21:25:57 +01:00
Ahmad Samir
9d05fd9fa2 QString: change test data to compile with QT_NO_CAST_FROM_ASCII [10/13]
Drive-by changes:
- Cleanup creating a QChar[], by creating a char16_t[] and
  reinterpret_cast'ing it
- Use human-readable Unicode characters where possible

Pick-to: 6.5
Change-Id: Ice2c36ff3ea4b6a5562cf907a7809166a51abd28
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-15 22:25:57 +02:00
Ahmad Samir
f325bdacb6 Replace ushort*/uint* with char16_t*/char32_t* in private API [1]
Task-number: QTBUG-110403
Pick-to: 6.5
Change-Id: Ie20a831f22212d56659cf3c6940d17134ab5f2c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-15 20:25:57 +00:00
Ahmad Samir
2ad63a0975 qcompilerdetection: all supported compilers have visibility attributes
Remove a redundant QT_VISIBILITY_AVAILABLE check. Pointed out by Thiago
in review.

Note that this is going to help with breaking include cycles between
qglobal.h and qcompilerdetection.h (otherwise we'd have to include
qtconfiginclude.h in qcompilerdetection.h as the former includes
qconfig.h which defines QT_VISIBILITY_AVAILABLE; without
QT_VISIBILITY_AVAILABLE defined, Q_DECL_EXPORT/IMPORT expands to
nothing on Linux and co., and tools linking to qtcore (with bootstrap)
can't find exported methods.

Change-Id: Ib1244d43e606a6c80e122adea631305f6d8c51d3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-15 22:25:56 +02:00
Ahmad Samir
a0e3da2625 QLockFile: {set}StaleLockTime: use chrono first
This is similar to the tryLock() commit, making the chrono overloads the
main methods, this way the lock time isn't limited by the size of int,
but rather by std::chrono::milliseconds (which can be as up to int64_t).

Task-number: QTBUG-110059
Change-Id: I8d1652748b16be2154233f7db57ed485bcab62c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-15 20:48:31 +02:00
Ahmad Samir
779bdf481c QLockFilePrivate: initialize members in-class
Cleans up the constructor.

Except for fileHandle member on Windows, initialize it in the
constructor with INVALID_HANDLE_VALUE as before. I don't know why
exactly that makes the build fail on Windows.

Change-Id: I8ade6f35ea6d9b3d31ef369d1f90d145e52ae8fc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2023-03-15 20:48:31 +02:00
Mate Barany
3dcd6b7ec9 Pack languageCodeList tighter
Pack some of the arrays that contain locale data more tightly. The
AlphaCode struct is a char[4] but always holds only [a-z]{,3} which
could be fit into 16 bits, halving the size of an AlphaCode struct.

With the new constructor the initialization of the AlphaCode struct
also changes - modify qlocalexml2cpp.py to reflect this change and
regenerate the languageCodeList.

Fixes: QTBUG-105050
Change-Id: I2b1e93ab7cc3f2d667bf67b45769b74a15211931
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-15 19:48:30 +01:00
Assam Boudjelthia
a9c8870b5e Android: demistify the "No platform plugin" androiddeployqt error
Make the error message clearly mention that a Qt for Android app
require linking to Qt Gui library.

Along the way get rid of the libqtforandroidGL mention which
was valid when Qt for Android had separate plugins for raster
and opengl, which was removed some time ago in
8a9bd001c9.

Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-111933
Task-number: QTBUG-111934
Task-number: QTBUG-108643
Task-number: QTBUG-97636
Task-number: QTBUG-83997
Fixes: QTBUG-85544
Task-number: QTBUG-93185
Change-Id: I24f6c08f619d805e0d82758d35aebaf32038206c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-15 17:49:50 +00:00
Amir Masoud Abdol
cd12c1f332 Fix an issue with passing NO_UNITY_BUILD_SOURCES
Amend 31518f1a4e
Amend 3602936230

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ibb2fd881c02b6496f06b8b623fa6009358755a26
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-15 18:18:01 +01:00
Amir Masoud Abdol
11ae4b70a1 Fix tst_qfilesystementry in unity build
Previous setup of the test was failing in minimal static build if built
using  the unity build because of the explicit inclusion of the qtcore
source files. By removing them, it surfaced that QFileSystemEntry
doesn't export all its necessary symbols for testing. So this patch does
that, as well as removing the qtcore sources from the test. It also
makes sense to make the test private.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Icdabe32485b7ce4ed6049bcc24918f531406b4bd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-15 18:18:01 +01:00
Axel Spoerl
2f3f3eb0d4 QPlainTextEdit code cleanup
Replace QObject::connect statements using SIGNAL/SLOT macros with
recent API.
Replace if/elseif cascades with switch statements.
Remove unnecessary blank lines.

Change-Id: Ib813e25530905e01f70ad52da11e69163445eaf8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-15 14:32:38 +01:00
Axel Spoerl
8b84374892 emit QAbstractSlider::valueChanged() only on value change
The signal has been emitted also, when the slider position has changed
without a value change (e.g. on QWidget::show() or on resizing).

This patch stops emitting the signal without a value change.
It adds a verification to tst_QAbstractSlider::setValue(), that
valueChanged is not emitted on a no-op value change.

As a drive-by, the patch removes an unnecessary assignment and
changes signal spy constructions to PTMF syntax.

Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-25365
Change-Id: I9932e45d4e680aa53422ca75aa42a16306213a38
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-03-15 14:32:35 +01:00
Bartlomiej Moskal
f4d897f04e androiddeployqt: remove infinity loop in deleteMissingFiles
There was a possibility of infinite loop and eventually crash when
androiddeployqt was used for the second time. Everything because of
deleteMissingFiles function for clean up previous build.

When we find the same names and those are directories, we call
recursively deleteMissingFiles. The parameters we use are absoluteDir,
not absoluteFilePath. As we use parent of found dir, deleteMissingFiles
is called with the same values as before.

This commit removes possibility of infinite loop by using
absoluteFilePath. That allows to avoid calling deleteMissingFiles with
the same parameters.

There is still a possibility, that directory that was found is not the
same as we were looking for. That will cause not needed files removing,
but those file will be copied again later.

This regression was created by 7dc05252a0
commit

Pick-to: 6.5 6.2
Fixes: QTBUG-111027
Change-Id: I195b4c407068b14e2ef94800ad1945adc66408cb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-03-15 12:42:15 +00:00
Piotr Wierciński
1faea46fb6 Wasm: Hide "Enable screen reader" button in QWasmWindow
For each QWasmWindow, there is "Enable screeen reader" button added
for accessibility. It's hidden visually by z-ordering behind main
QWasmWindow div.
Sometimes the content of QWasmWindow contains transparent elements
and the underlying accessibility button gets visible.
This commit introduces new CSS class which hides elements visually,
but keeps it accessible for screen readers.

Fixes: QTBUG-111896
Change-Id: I78ef5746da9e0d1584ee36dd0ca6ba476623a3de
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-03-15 09:52:04 +01:00
Ahmad Samir
5cea5fc80b QLockFile: tryLock(): use chrono first
I.e. tryLock(chrono::milliseconds) shouldn't call the int overload as
that truncates the timeout (milliseconds is typically int64_t).

Add a note to the tryLock(millisecons) docs that passing
milliseconds::max() will make it wait forever to obtain the lock.

Task-number: QTBUG-110059
Change-Id: Ib48d9b1b117ce816348625331543d6ba8a788973
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-14 22:15:35 +02:00
Axel Spoerl
425e635ecd QCompleter::setPopup() - refactor and cleanup
QCompleter::setPopup() sets window flags, focus policy, parent, focus
proxy, item delate and installs an event filter, before the popup
argument is assigned to d->popup.

In the QCompleter::eventFilter override, QObject::eventFilter is called
(under more) if d->popup is nullptr.

If a custom class is inherited from QCompleter and it overrides
QObject::eventFilter(), this causes an infinite loop.

This patch re-factors the method.
- early return is added if the new popup != d->popup
- remembering the existing widget's focus policy is constified and
  moved ahead of the delete secion.
- assignment of d->popup to popup argument is moved after the delete
  section.
- after assignment, the argument variable is no longer used.

The refactoring eliminates two issues:
- potential risk of double-installing event filter due to missing
  early return.
- inifite loop if inherited class installs another event filter.

The patch adds a test function to tst_QCompleter, which implements an
inherited class, installs an event filter on a popup and checks if a
ChildAdded event hass been recorded.

Fixes: QTBUG-111869
Pick-to: 6.5 6.2
Change-Id: I3f7a2434a11476077a5260e7686a912da9f6c60d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-03-14 21:15:31 +01:00
Piotr Wierciński
c99614711e Wasm: Add support for setOpacity() in QWasmWindow
Add support for QPlatformWindow::setOpacity() in QWasmWindow.

Change-Id: Ib54cecf1f49e3d576a386f4109b8c6df1f16f312
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-03-14 19:46:08 +01:00
Ievgenii Meshcheriakov
20668baa59 dbus examples: Update screenshots
Use WEBP format to reduce the file size.

Task-number: QTBUG-111366
Pick-to: 6.5
Change-Id: I14ff15010e7ac7e1b375eeafaa1c153b0fdd95e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-14 19:46:08 +01:00
Morten Sørvig
2245a8dbb0 wasm: restore windowCursor nullptr check
This check was accidentally removed in commit 783b63ce.

If the cursor is null, set the default cursor.

Pick-to: 6.5 6.5.0
Change-Id: I894d5e04cd7b49041bd0d3b59fc816a8b7efffe7
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-03-14 17:37:13 +00:00
Amir Masoud Abdol
3602936230 Improve the internal handling of unity build
- Removed the NO_UNITY_BUILD argument from commands that disable it by
  default.
- Add a warning in case NO_UNITY_BUILD or NO_UNITY_BUILD_SOURCES is
  being used where it is already disabled, e.g., qt_internal_add_test
- Exclude all sources of a target from unity build if NO_UNITY_BUILD
  is set on the target. This sounds a bit harsh, but I have noticed that
  sometimes the same source file can be included somewhere else, and
  some unexpected collision may occur.
- qt_examples_build_end excludes all its examples from the unity build.
- qt_build_test now sets the CMAKE_UNITY_BUILD to OFF before configuring
  the tests, and restore its value when done.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia42e7dd5a5bfb151db241deb639325720fd91eec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-14 17:28:44 +01:00
Amir Masoud Abdol
cfed658747 Utilize NO_UNITY_BUILD arguments instead of manual exclusion
Unity build is disabled by default for all 3rdparty libraries, so we
don't need to set the manually anymore; and for the plugins we can use
NO_UNITY_BUILD instead.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia2f83ae083924d31adf07e7647b34ae6571ed01f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-14 17:28:44 +01:00
Amir Masoud Abdol
f4228163fb Exclude a few source files from QtCore
On macOS, if QtCore is built with unity build, tst_qmakelib will fail.
For now, we decided to exclude the qsystemerror.cpp on macOS. The
_DARWIN_C_SOURCE provides a few necessary macros on macOS. By defining
the macro we can include the qfilesystemengine_unix.cpp and
qlockfile_unix.cpp into the unity build again.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I2c8b38b0512792c21966582c33471b7ee222617a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-14 17:28:44 +01:00
Amir Masoud Abdol
3e9f2a0adb Silence an unused-parameter warning
On Windows, when using unity build, compilers insist that these are
not used, even though they are; and consequently the build fails.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I6441134db563e0553a3c9193afe2569fc2ffce85
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-14 17:28:44 +01:00
Amir Masoud Abdol
d203f82916 Fix for CMake tests when build with unity
Some of the mockplugin tests needed to be excluded from the unity build
manually. In addition, MSVC's complain about include <QtCore/QString>
instead of <QString> was addressed here since it was breaking the unity
build as well.

Some other independent executable and libraries have to be excluded
manually as well.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I1f21f8484b4d3b1c399e2118ab3a71e682a3006a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-14 17:28:43 +01:00
Amir Masoud Abdol
608c2501e5 Fix tst_qfreelist when build with unity
Previous setup of the test was failing in minimal static build if built
using the unity build because of the explicit inclusion of the qtcore
source files. In order to resolve this, I removed the inclusion of
qtcore's headers and made the test private.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Id1c7b3b65ca2078354c235a718ff3e93a65362e6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-14 17:28:43 +01:00
Amir Masoud Abdol
e512734278 Use qt_internal_add_executable in auto tests
When possible, I replaced add_executable with
qt_internal_add_executable.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I643d2e27f0d880fe9b6cec7af790e4c99227fb0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-14 17:28:43 +01:00
Marc Mutz
3e1108aa7f tracepointgen: fix inefficient loops, add a const
Take the loop variable by cref.
Make one loop variable const that was ok to be taken by value.

Coverity-Id: 404395
Coverity-Id: 404396
Coverity-Id: 404397
Coverity-Id: 404398
Coverity-Id: 404399
Pick-to: 6.5
Change-Id: Ib90a8f12b98c892314f10a9a3cb2f3c5c19a5d78
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-03-14 15:55:48 +01:00
Marc Mutz
6fd163f627 tracegen: fix inefficient loops
Take the loop variable by cref.

Amends 83effb3a3f.

Pick-to: 6.5
Coverity-Id: 404701
Change-Id: I1266dd1feb16b3842a93169e554a6563861f5a14
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-03-14 15:55:48 +01:00
Marc Mutz
60c3aaa54f tracepointgen: fix inefficient loops
Take the loop variable by cref, avoid some QList detaching.

Coverity-Id: 404697
Coverity-Id: 404697
Coverity-Id: 404699
Coverity-Id: 404700
Pick-to: 6.5
Change-Id: I9fe7b6ad3cf87f442e6c111d6f661122ac23769c
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-03-14 15:55:47 +01:00
Alexandru Croitor
595ac662ed CMake: Pass CMAKE_EXE_LINKER_FLAGS to project-based try_compile
CMake does it for non-project-based try_compile calls if the
CMP0056 policy is set to NEW. That was introduced in CMake 3.2,
thus set it unconditionally.

The use case is to pick up custom -rpath-link paths when
cross-compiling.

Pick-to: 6.4 6.5
Change-Id: I726b90267dd46de116052b5b7f19b9354a568200
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-14 15:55:47 +01:00
Fabian Kosmale
6d054270fc QMetaType: Ensure that qfloat16 gets correct id
Code initially compiled against Qt <= 6.2 does not have a qfloat16
metatype that unconditionally gets registeret from QtBase.

Therefore, any preexisting metatype instance for qfloat16 will hit the
custom type registry code path. As builtin metatypes are not part of the
custom registry, we will create a new type-id, and the type will thus
not compare equal to new code using the builtin type-id.

Avoid this issue by inserting an alias to the type in
QMetaTypeCustomRegistry's constructor.

Change-Id: I825265ad16e274c08b2c4a3a4814475b6c6c6187
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b68ad5ef7fd8df0ef4aea03f33dfe05fd8272469)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-03-14 01:34:27 +00:00
Christian Heimlich
e7b8b7bfbe CMake: Add NO_COMPILER_RUNTIME to deploy script macros
Provides the NO_COMPILER_RUNTIME boolean option to
qt_deploy_runtime_dependencies() and qt_generate_deploy_app_script().

In both cases this results in using the "--no-compiler-runtime" option
of windeployqt.

The value has no effect on other platforms.

[ChangeLog][CMake] Added the option NO_COMPILER_RUNTIME to
qt_generate_deploy_app_script.

Task-number: QTBUG-111741
Pick-to: 6.5 6.5.0
Change-Id: I2e86f0959c4e1ae47b247667ace88d07e2f22271
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-13 16:31:31 -05:00
Tor Arne Vestbø
24da05f68d macOS: Remove workaround for worksWhenModal not being reevaluated
On macOS < 10.15 the worksWhenModal property of our NSWindow was read
on window initialization and propagated to the window server, but never
updated on the window server past that point, even if updating the
worksWhenModal property on the NSWindow.

Now that we no longer support macOS < 10.15, we can remove the workaround,
that was using private APIs to talk to the window server directly.

Pick-to: 6.5
Change-Id: Ide5a6d63cc471fd04748d1aa7f7915ccde2a1cdc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-13 22:26:28 +01:00
Ahmad Samir
f948835e62 QLocalTime: getCurrentStandardUtcOffset: fix narrowing warnings
UTC offset in seconds can't be bigger than 24 hours, so it should fit in
an int. Explicitly cast to int and add asserts.

Change-Id: I45460a0489a134e4ad03bdab112f067d5913709a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-13 23:26:28 +02:00
Ahmad Samir
5bffb47d6e QFSFileEngine: fix overflow bug when using lseek64
QT_LSEEK (lseek64()) returns QT_OFF_T, which is off64_t on 32bit
systems. The return from the lseek64() call was being assigned to an
int, which meant that if the returned value is > INT_MAX it will
overflow and the value becomes -1, and since errno would be EOVERFLOW
the code would fail to open the file.

Fix the issue by assigning the return value to QT_OFF_T.

Thanks to Giuseppe for pointing out the issue in the code review.

Found by compiling with -Wshorten-64-to-32.

[ChangeLog][QtCore][QFile] Fixed a bug where opening a file in append
mode may fail if the file size was bigger than INT_MAX.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iad33e3192f37466643a1218d38e5ecc2baaa7dc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-13 23:26:28 +02:00
Ahmad Samir
0d29a406f7 QThread: add sleep(std::chrono::nanoseconds) overload
All the other overloads are implemented using the new one.

Windows change relies on the pre-check in the code review making sure it
compiles.

[ChangeLog][QtCore][QThread] Added sleep(std::chrono::nanoseconds)
overload.

Task-number: QTBUG-110059
Change-Id: I9a4f4bf09041788ec9275093b6b8d0386521e286
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-13 23:26:28 +02:00