Commit Graph

46261 Commits

Author SHA1 Message Date
Mårten Nordheim
a7d2855b3c invokeMethod: enable passing parameters to overload taking functors
This was missing for a while, and there is nothing fundamentally
missing for it to work.

With the more recent work around slot objects and invokeMethod in
general, it is a good time to add support for this.

In this patch, when connecting to a functor, it automatically deduces
the overload to call based on the arguments passed to invokeMethod.

Sharing code with QObject::connect could be done, but they have a
key difference that makes it harder:
With signal emissions we throw away trailing arguments that are not
used: i.e. `signal(int, int)` can be connected to `slot(int)` or
`slot()`. With invokeMethod that's not a thing. So we will need a way
to toggle that behavior during resolution.

[ChangeLog][QtCore][QMetaObject] Added support for passing parameters
to the overload of QMetaObject::invokeMethod that takes a functor. These
new overloads must have the return-value passed through qReturnArg().

Change-Id: If4fcbb75515b19e72fab80115c109efa37e6626e
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-24 07:45:04 +02:00
Mårten Nordheim
777a1ed191 Make qReturnArg return a type templated with the return type
This way we can make check verify that the passed-in pointer is correct
at compile time.

Doesn't do this in this patch because all current uses are in the
string-based overloads, but we'll use it in a later patch which adds
new invokeMethod overloads for the functor-based API.

Change-Id: I30186adc9d0b67c7ca337deb35c2c34661e50261
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-24 07:45:03 +02:00
Thiago Macieira
306d32fdd3 Doc: add missing docs for QFileInfo::filesystemReadSymLink()
Fixes: QTBUG-116351
Pick-to: 6.6
Change-Id: Ifa1111900d6945ea8e05fffd177dc57774db65cf
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-08-23 18:15:10 -07:00
Mårten Nordheim
394602a80a Use qintptr for socket handles
Because the real handle is also the size of a pointer,
not int

Change-Id: Ic2efdd56a5deffe9bd130ce02e549efd68d6a337
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-23 21:14:25 +02:00
Ivan Solovev
f081578ce0 QSqlIndex: implement member swap() and use a macro for move-assignment
Also declare the type as shared using Q_DECLARE_SHARED

Found during Qt 6.6 API review.

This commit amends 46e909a37a.

[ChangeLog][QtSql] QSqlIndex is now a relocatable type.

Pick-to: 6.6
Change-Id: I78394cba082b4df2e4d8a6aab8e8e87f2340962c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-08-23 14:21:57 +00:00
Ivan Solovev
2f87711913 SQL: add missing Q_DECLARE_SHARED to the value types
QSqlField and QSqlRecord implemented all special member functions and
the member swap() function, but were missing the Q_DECLARE_SHARED
macro.

Found during Qt 6.6 API review

[ChangeLog][QtSql] QSqlField and QSqlRecord are now relocatable
types.

Pick-to: 6.6
Change-Id: Ia10f1d3fd9f634864be5b36d1d3903301adfa9ab
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-08-23 16:21:57 +02:00
Axel Spoerl
aff0915352 QDialogButtonBox: Use separate eventFilter class
bbb71e7e80 added an eventFilter override
to QDialogButtonBox, in order to fix QTBUG-114377. The approach added
a symbol to QDialogButtonBox, which breaks binary compatibility between
patch releases.

=> Use a separate class to install an event filter
=> Remove the symbol (eventFilter override) in QDialogButtonBox

Fixes: QTBUG-116287
Pick-to: 6.6 6.5
Change-Id: I920deca9f45f6246ed1fcbf5346f681dd5dd12f6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-08-23 14:56:16 +02:00
Anton Kudryavtsev
2da366fbba qcommandlineparser: use string view type more
Change-Id: Ic3a04843d6b73d9489cbce1411453b146842c52f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-23 15:56:16 +03:00
Tor Arne Vestbø
a143158eb1 macOS: Re-apply QWindow visibility when moved between NSWindows
When a QWindow is moved between being a child window and a top level,
it gains a corresponding QNSWindow, which we create as part of
QCocoaWindow::createNSWindow(). NSWindows are not visible by default,
so we need to re-apply the QWindow state to the newly created window,
just like we do for other QWindow properties.

Pick-to: 6.6
Change-Id: I809d12b09eeccea7a4ee4e8444f69db46dbd159e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-23 12:48:20 +02:00
Kai Köhne
3aaeef59fb Doc: Fix typo in comment
Change-Id: Iabf098e22398721f2087e2bbd02d128a75639315
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-08-23 12:25:28 +02:00
Kai Köhne
be26eb14da Doc: Mention version of QApplication::setActiveWindow() deprecation
Pick-to: 6.5 6.6
Change-Id: I7cd9be3b34a4cb7f396d175ff8137b590c2435c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-08-23 12:25:28 +02:00
Anton Kudryavtsev
4ec9e4b2b1 qhttpnetworkheader: port some methods to QBAV
to save some allocations. In qhttpnetworkreply.cpp methods are used with const char* literals, so no need to create QByteArray

Change-Id: I94c2eca1a5c6ab73d4133d87fee007af8cb65ea1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-08-23 07:00:37 +00:00
Marc Mutz
17f2b6d2e9 QDeadlineTimer: make the (Qt::TimerType) ctor explicit
Qt::TimerType is not a faithful representation of a QDeadlineTimer.
It's missing the actual deadline, and so should not be allowed to
participate in implicit conversions.

Consider whether you'd like to see such code:

    foo.setTimeout(Qt::PreciseTimer); // HU???

So split the old (TimerType = CoarseTimer) ctor into an explicit
default ctor (applying NSDMI to make it =default'able) and a new
explicit (TimerType) ctor.

[ChangeLog][Potentially Source-Incompatible Changes][QtCore] The
QDeadlineTimer(Qt::TimerType) constructor is no longer implicit. To
keep old source working, wrap the Qt::TimerType argument in
QDeadlineTimer{}. This is backwards-compatible with older Qt versions.

[ChangeLog][QtCore][QDeadlineTimer] The (Qt::TimerType) constructor is
now explicit (was: implicit).

Found in API-review.

Pick-to: 6.6
Change-Id: I72aaaad5201bd288a6fd6af398573aaa9d0eda5a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-23 09:00:31 +02:00
Marc Mutz
c8d04c1a37 QUuid: drop the noexcept of fromBytes()
The function has a precondition, namely that [bytes, 16) be a valid
range. Therefore it cannot be noexcept.

Found in API review.

Pick-to: 6.6
Change-Id: Idcc61cdc3b1cbffc20a86b0dbc4eb17e51c1becd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-08-23 09:00:14 +02:00
Kai Köhne
5d8e0ce0fb Fix definition of QOSV::MacOSSonoma
Make sure that MacOSSonoma symbol is defined in
qoperatingsystemversion.cpp, instead of duplicating the
MacOSVentura symbol. This seems strictly speaking not
needed (as this shouldn't have compiled otherwise), but is
avoiding confusion in the future.

Also document when it got added (Qt 6.5).

Amends 0237709e2.

Pick-to: 6.5 6.6
Change-Id: Idff7cbe0b5862907d735fb60f91f85469cb1edf0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-08-23 08:59:10 +02:00
Thiago Macieira
3c4c7860f0 QString: use equalStrings in operator== and operator!=
QStringView already did since 6.0. I don't know how we missed this.

Pick-to: 6.5 6.6
Change-Id: I5acc02341c5940499682fffd1774f7c3a807317a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-08-22 20:12:41 -07:00
Tasuku Suzuki
02a98a5646 Fix build with -no-feature-opengl
Change-Id: I0e6ead4783ed9bf997c8addb07c2f623da5799cb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
2023-08-23 08:25:05 +09:00
Ahmad Samir
5d1e4567f9 QDateTime: refactor an if-else
Change-Id: I1d1bd6d0e819e525b03898d43a2a683ee617a3ed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-08-22 21:44:40 +03:00
Anton Kudryavtsev
38429c16b5 qhttpheaderparser: port some methods to QBAV
Change-Id: If9d74e42e8633cdbc0caeebedc9a36918c0b05a5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-08-22 20:58:15 +03:00
Tasuku Suzuki
b77e1de2ba Fix build with -no-feature-thread
Change-Id: I7158f92faa1d6b3b0fe6322998682b825af908be
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-08-23 02:58:15 +09:00
Anton Kudryavtsev
9218c8f4ea qcommandlineparser: replace QSL with QL1SV
while touching code, use inline string, since there is only one user

Change-Id: I6e89c24d8a37da090203e6eaf690d9094c5aa76a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-22 17:17:33 +00:00
Thiago Macieira
4368179c37 QTimer: fix regression on singleShot-invoking non-mormalized SLOT()s
The was introduced with the rewrite of QMetaObject::invokeMethod() in
commit 0f76e55bc4, because we have an
optimization for zero timers to avoid creating a temporary
QSingleShotTimer object. The old implementation did attempt to normalize
the target slot name, but did so because it looked metamethods up using
QMetaObject::indexOfMethod:

    int idx = meta->indexOfMethod(sig.constData());
    if (idx < 0) {
        QByteArray norm =
QMetaObject::normalizedSignature(sig.constData());
        idx = meta->indexOfMethod(norm.constData());
    }

The new implementation does not use this method so it didn't need to
attempt to normalize.

I am fixing this only in QTimer and not in QMetaObject::invokeMethodImpl
(even though it is trivial to do so) because I don't believe spaces in a
pure string to invokeMethod were ever expected to work:

    QMetaObject::invokeMethod(obj, "slotName ", Qt::QueuedConnection);

The Q_ARG and Q_RETURN_ARG (for code not recompiled) still does
normalization inside QMetaType::fromName().

Fixes: QTBUG-116060
Pick-to: 6.5 6.6
Change-Id: I964c2b1e6b834feb9710fffd177cac60c83ef413
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-08-22 10:17:33 -07:00
Anton Kudryavtsev
3c56f561e4 qhttpheaderparser: replace QBA with QBAV
in QSB expression to avoid temp allocation

Change-Id: Ib4106c5c9fa0281203dc61bad50418805c6119a9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-08-22 17:17:33 +00:00
Alexandru Croitor
409469ba14 CMake: Fix build when developer-build is on but private_tests is OFF
If qt is first configured without -developer-build, and then
reconfigured with -developer-build, QT_FEATURE_developer_build will be
ON but QT_FEATURE_private_tests remains OFF, and is not reset to ON.

This causes a link failure in Network, because the source files
defining the QNetworkAccessDebugPipeBackendFactory class are only
added if QT_FEATURE_private_tests is ON, which is not the case above,
but the C++ code checks for the QT_INTERNAL_BUILD define which is
defined when -developer-build is ON.

Align the C++ code to check for the private_tests feature.

Pick-to: 6.5 6.6
Task-number: QTBUG-112957
Change-Id: Ib6ed891a84c6b118836497d6ead48019bb1b9052
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-08-22 18:09:36 +02:00
Mikolaj Boc
93637ea296 Add clang-format guards around EM_JS code in WASM dispatcher
This is to avoid it formatting lambda => as = >

Change-Id: Ie9cb19c8594cab6fe33910f52800fc1b6207a6f6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-08-22 17:19:51 +02:00
Mikolaj Boc
234f03a0b3 Remove the unix dispatcher from WASM builds
Unix dispatcher is not used and - as such - redundant on WASM.

Change-Id: Ia8789ef783b06ce9cfba2ce9d67159db2355b594
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-08-22 17:19:50 +02:00
Friedemann Kleint
462904d46b Mimer SQL driver plugin: Fix messages
Amends 0efd8854c4.

Task-number: QTBUG-111219
Pick-to: 6.6
Change-Id: I8425c13a324562beb4a687ecdd0339a129fe190e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fredrik Ålund <fredrik.alund@mimer.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2023-08-22 16:59:27 +02:00
Edward Welbourne
196a1acffc Update CLDR version in qt_attribution.json
Amends commit 9237908327 - I neglected
to update the attribution. The license hasn't changed.

Pick-to: 6.6 6.5
Change-Id: Ie1e281bf08ac31506e152fc0fa17c8fae6b7ac98
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-22 16:26:02 +02:00
Ievgenii Meshcheriakov
e073d7d20c QDBusServer: Delegate construction to two-argument constructor
This reduces code duplication.

Change-Id: Ia637045f9495d68dba41bc146c9ba807f5619c5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-22 16:26:02 +02:00
Ievgenii Meshcheriakov
a1ab2297a9 QDBusConnectionManager: Remove unused member variables
Change-Id: If9e452e81db0fefa10704b83e6447ccef0763b59
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-22 16:26:02 +02:00
Ievgenii Meshcheriakov
12a0eee1f8 QDBusConnectionManager: Move all locking inside the class
Make `mutex` member private and make all former users call
new public member functions that perform locking. Make
old non-locking member functions private.

Change-Id: I29092d1bd785aa6b830183c1c1fe125b16e0d633
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-22 16:26:02 +02:00
Ievgenii Meshcheriakov
3c4a092cf7 QDBusConnectionManager: Use invokeMethod() to create connections
Use QMetaObject::invokeMethod() with a lambda instead of setting
up a permanent signal/slot connections with BlockingQueuedConnection
type. This makes the code flow easier to follow.

Change-Id: I0e77433e3fb96f99ed39f2d14dad737d444d3269
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-22 16:26:02 +02:00
Tor Arne Vestbø
108d2e4486 macOS: Use enumerateWindowsWithOptions to implement QCocoaScreen::topLevelAt()
The [NSWidow windowNumberAtPoint:belowWindowWithWindowNumber] API has issues
with sometimes being out of sync with the window server, resulting in failing
to hit test windows that we know are there.

This has manifested in flakeyness in our tests, for example in tst_QWindow's
testsInputEvents: http://testresults.qt.io/grafana/goto/YNGj7TgIg

A workaround is to call [NSWindow windowNumbersWithOptions:0] to force a sync,
but we might as well use the more modern block based API to iterate our own
windows in Z-order. This API seems to do the required sync on our behalf,
or at least doesn't operate on stale data.

The logic has been otherwise kept as is, including treating non-top-level
windows as candidates for hit testing, which seems strange for a function
named topLevelAt(). This is to be investigated further.

Task-number: QTBUG-108402
Task-number: QTBUG-115945
Pick-to: 6.6 6.5
Change-Id: I5599881c381a0a673d262e4b9585e2c6798c9810
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-22 11:27:21 +02:00
Oliver Wolff
68b16974a7 Remove elfreader and other unix leftovers from windeployqt
Back then elfreader and other unix functionality was added for the
purpose of having one generic deployment tool but it was never used.
Remove the code to be more clear on what to expect.

Pick-to: 6.6
Change-Id: I2b7a759de04afe0c5fb210ad65f1c86e32934f18
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-22 11:15:13 +02:00
Topi Reinio
634f474300 Doc: Qt OpenGL: Remove duplicate source dir from documentation config
As /examples/opengl is already listed in exampledirs, .qdoc source
files under that directory do not need to be listed in sourcedirs.
Doing so will cause the example to be listed twice in lists generated
by the \generatelist and \annotatedlist QDoc commands.

Same applies to imagedirs variable.

Pick-to: 6.6 6.5
Change-Id: I168dbfe111a4cb9615626eb9869f97d3814a14b7
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
2023-08-22 09:13:06 +00:00
Eskil Abrahamsen Blomfeldt
11321384d9 Update version of FreeType attribution
We updated FreeType to 2.13.1, but forgot the attribution file.

Pick-to: 6.6 6.5 5.15
Task-number: QTBUG-115340
Change-Id: I1e7bc91b9fd4a7674d40d15b3f2759f38831cd8e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-08-22 09:35:05 +02:00
Anton Kudryavtsev
c22d393afd qlogging: replace QSL with QL1SV
Also while touching code, replace arg usage with QSB to prevent temp allocation

Change-Id: I3573266dbee8a00ae917773c107b5df7774acb79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-21 21:57:58 +00:00
Mårten Nordheim
4660a230d5 QString/QByteArray: fix append() wrt. raw data
When appending to an empty string or byte array, we optimize and
copy the internal pointer. But if the other string/byte array was
created with fromRawData this might be temporary data on the stack/heap
and might be de-allocated or overwritten before the string/byte array
is used or is forced to make a deep-copy. This would lead to incorrect
data being used.

This is easy to overlook if you plan to append multiple strings
together, potentially supplied through an argument. Upon appending a
second string it would make a full copy, but there might not be a
guarantee for that. So, it's hard for users to avoid this pitfall!

Fixes: QTBUG-115752
Pick-to: 6.6 6.5 6.2
Change-Id: Ia9aa5f463121c2ce2e0e8eee8a6c8612b7297f2b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-21 23:27:56 +02:00
Mikolaj Boc
a6d40467de Make IDB settings work sync with JSPI
IndexedDB version of QSettings will now use solely the sync versions
of data access functions. Those will suspend with JSPI.
This makes IDB settings conform to the QSettings contract - and also
allows us to enable tests in tst_qsettings for the IDB version of
QSettings.
Also, do not treat the IndexedDB format as one defining read/write
functions in QSettings - those are the same as for ini format, as
IndexedDB settings backend uses a backing ini file.

Change-Id: Iee3471cc79c0cea87378923cf9baac58e56d1272
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-08-21 19:39:21 +02:00
Ulf Hermann
9306db6d46 QObject: Do not register an observer when writing objectName property
Observers should only be registered when _reading_ the property.
Otherwise we get binding loops.

Pick-to: 6.6 6.5
Change-Id: I974f6ea444fa7a5d333ed79eea6f34e3d757d169
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-08-21 14:15:51 +02:00
Ievgenii Meshcheriakov
7c9e61a3fe QDBusConnectionManager: Use invokeMethod() to create servers
Use QMetaObject::invokeMethod() with a lambda instead of setting
up a permanent signal/slot connections with BlockingQueuedConnection
type. This makes the code flow easier to follow.

Change-Id: Ib6566e7a4694ecbd69900b645d020b3331fb3462
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-21 12:18:33 +02:00
Ievgenii Meshcheriakov
338de68395 QDBusConnectionManager: Move to a separate source file
Split the source code into a separate file for easier code
navigation and to better match the rest of Qt.

Update the link to the blog post explaining the
preventDllUnload() function, mention the blog post title
to make it easier to find it again when the link breaks.

Change-Id: I061d72bc795110f03352abf10fc639ddd6243527
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-21 12:18:33 +02:00
Mikolaj Boc
7a0de7fda2 Add WebLocalStorageFormat, WebIndexedIDBFormat to public API
Fixes: QTBUG-115587
Change-Id: Icb5dc795ad60608effbf08200592899d1a3d7fd1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-08-21 12:12:44 +02:00
Ievgenii Meshcheriakov
cff1c12eca QAbstractEventDispatcherPrivate: Create free timer ID list in constructor
Create the global static free timer ID list in the constructor
so that it is destroyed after any global static QDaemonThread instance
that may be using it.

Fixes: QTBUG-58732
Pick-to: 6.6
Change-Id: Ic2d33ac3aa2ec3ca0261be9996920aae260e16fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-20 23:38:06 +02:00
Christian Ehrlicher
e26a87f1ec WindowsVista style: fix subControlRect() in rtl mode
During refactoring of the vista style in
46f98147f4 a regression slipped into
subControlRect()'s default branch which lead to a double call of
visualRect(). This breaks nearly all subControlRect() calculations in
rtl mode.

Fixes: QTBUG-116224
Pick-to: 6.6 6.5
Change-Id: Ida722e1b6c6a311b27a9b48d1fe1378b47c21cf4
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2023-08-19 21:15:03 +02:00
Joerg Bornemann
ba96238600 Fix running CMake test projects in prefix builds
Consider the following situation: There are CMake tests in
qttools/tests/auto/cmake that configure and build CMake test projects,
essentially as external projects. One of those test projects does
find_package(Qt6 COMPONENTS LinguistTools). This call fails in a prefix
build, because Qt6LinguistToolsConfig.cmake is not installed yet. It
merely exists in qttools-build/lib/cmake/Qt6LinguistTools.

We must adjust CMAKE_PREFIX_PATH to be able to find Qt6LinguistTools. We
also must adjust QT_ADDITIONAL_PACKAGES_PREFIX_PATH to be able to find
the LinguistTools component of the Qt6 package.

Use the prefixes setup from the support for building examples as
external projects and use it for CMake test projects as well.

Task-number: QTBUG-84884
Change-Id: I1bd5d5084cf931196bdb014cd75ca7578cd9decb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-08-19 11:03:36 +02:00
Marc Mutz
f780893c39 QRecursiveMutex: make tryLock(QDeadlineTimer) the default (was: int)
The default argument staying on the old int overload meant that on
Windows a nullary tryLock() call would need to go through both DLL-
exported functions (int, then QDeadlineTimer) and on non-Windows
platforms, it would hit the out-of-line QDeadlineTimer(qint64)
ctor.

By moving the default argument from the old to the new function, we
reduce the nullary call on Windows from two to one exported functions.
On non-Windows, we make it to hit QDeadlineTimer's constexpr inline
default ctor instead.

Found in API-review.

Amends ff9da1db0b.

Pick-to: 6.6
Change-Id: Id3e9923cf97ee1673fe05c85c30b5a12531857b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-19 10:30:41 +02:00
Marc Mutz
11d6932560 Mark all of Qt as free of Q_FOREACH, except where it isn't
The density of Q_FOREACH uses in this and some other modules is still
extremely high, too high for anyone to tackle in a short amount of
time. Even if they're not concentrated in just a few TUs, we need to
make progress on a global QT_NO_FOREACH default, so grab the nettle
and stick to our strategy:

Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from
creeping in, and whitelist the affected TUs by #undef'ing
QT_NO_FOREACH locally, at the top of each file. For TUs that are part
of a larger executable, this requires these files to be compiled
separately, so add them to NO_PCH_SOURCES (which implies
NO_UNITY_BUILD_SOURCES, too).

In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the
#undef QT_NO_FOREACH to indicate that these actually test the macro.

Task-number: QTBUG-115839
Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-08-19 05:19:42 +00:00
Marc Mutz
1a3f573bd9 QHostInfo: remove usused -Result and -Runnable ctors
Clean up after all users are ported to the SlotObjUniquePtr overloads.

Pick-to: 6.6 6.5
Change-Id: I3e58249296ea9674c45fb412463ae3201518de72
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-08-18 21:02:51 +00:00
Ahmad Samir
07c34e4c79 QTimer: put #ifdef qdoc related-lines in one block
Slightly more readable.

Change-Id: Ib945319b4f7606a0796e8ac09f6659e63b7291df
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-18 19:56:30 +03:00