Tests in non-qtbase modules could not find_package their own Qt6*Tools
packages, because add_subdirectory(tests) was called before the config
files for Qt6*Tools were created.
The creation of tools config files is done in QtPostProcess.cmake, which
was included in qt_build_repo_end(). Move that include into its own
macro, qt_build_repo_post_process() and remove it from
qt_build_repo_end(). Call qt_build_repo_post_process() before the
'tests' directory is added in qt_build_repo().
Every call site of qt_build_repo_end() must now be adjusted and call
qt_build_repo_post_process().
Task-number: QTBUG-88264
Change-Id: I80d60a1b5c0e9b715c298ef4934b562f815432d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
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>
qt6_android_generate_deployment_settings is implicitly used by
qt6_add_executable in user projects. This test makes sure that the
function behaves as expected for user projects specificly, since in Qt
tests it behaves differently because of Qt-specific conditions inside.
Task-number: QTBUG-116037
Pick-to: 6.6
Change-Id: Iea10eca7a780ebaff0c05b91ebe47b821b9ec956
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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>
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>
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>
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>
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>
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>
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>
Remove all "#undef QT_NO_FOREACH" white-listing from source files.
Previous commits have removed all remaining Q_FOREACH/foreach uses in
this sub-tree.
Also remove one source file from NO_PCH_SOURCES in CMakeLists.txt.
Task-number: QTBUG-115839
Change-Id: I02cf994eda720c028e613407342fbd6658fa62b1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The QHash "cache" isn't modified in the loop body (method is const), in
general cacheSize() shouldn't be susceptible to data races.
Task-number: QTBUG-115839
Change-Id: I122a03ddd5e648d16736c16fa9289eafc886979d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The toString() method's parameter is a const&, the loop body doesn't
change the container; and the container the parameter refers to isn't
changed during iteration.
Drive-by, remove braces from single-line if blocks.
Task-number: QTBUG-115839
Change-Id: I363e1ed37c0f75fa6a9f8eac3393a6c10d756c1b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Straightforward ports where the container could be made const.
Use C arrays instead of QList if the data is known at compile time.
Drive-by, where appropriate make the for-loop variable a const& (e.g.
QString) instead of copying it for no reason.
Task-number: QTBUG-115839
Change-Id: I273a386e414e5923e750072f0407226efcd4531e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In both cases, the container is a member of the unittest, initialized in
initTestCase(), then not changed after that. So use std::as_const.
Task-number: QTBUG-115839
Change-Id: I3b66127e10ac94137260d99f354de9f66a74bec7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The containers are created locally in the top level test functions, they
can't be made const due to the way they are filled, however the loop
body don't change them; even if the code in a loop would cause
re-entrance du due to signal emittance or events processing, those
containers aren't affected and aren't changed during iteration because
the top-level test functions themselves aren't re-entered, hence
use std::as_const.
Drive-by change: take QHostAddress by const& when it's used as a
for-loop variable (it has a QExplicitlySharedDataPointer d-pointer).
Task-number: QTBUG-115839
Change-Id: I443169e10d973aba2f62854aba200fc2dc2c80aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The loops were iterating over a temporary, so use a local const auto
variable to hold it, and use ranged-for.
Drive-by, make the for-loop variable const& instead of copying it,
for any object that has a d-pointer (QNetworkAddressEntry, QHostAddress,
QNetworkInterface).
Task-number: QTBUG-115839
Change-Id: If96c0b2a6142fe2fa2ed45ed7e2435cc1f80e005
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
while touching code, use inline string, since there is only one user
Change-Id: I6e89c24d8a37da090203e6eaf690d9094c5aa76a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
This is to avoid it formatting lambda => as = >
Change-Id: Ie9cb19c8594cab6fe33910f52800fc1b6207a6f6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The recent change in QCocoaScreen (108d2e4486)
fixed the problem with no widget found at 'hot spot' (while we know
it's there, since we create it and wait for it to get expose event).
Pick-to: 6.6 6.5
Fixes: QTBUG-108402
Task-number: QTBUG-115945
Change-Id: Ibbf6867bb3381b8137d64cdbd15cc467d8fcf348
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Unix dispatcher is not used and - as such - redundant on WASM.
Change-Id: Ia8789ef783b06ce9cfba2ce9d67159db2355b594
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
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>
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>
If OpenSSL version is 3.1.1 or above - this version moved the protocol
under security level 0, but the default one is 1.
Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-116166
Change-Id: Iaabb2cf33e2a9f280d6167233ee16080dee808b0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Static variables for a message handler were used only in developer
build, while they were declared unconditionally.
That has lead to compiler warnings about unused variables in a
non developer build.
=> declare them only in developer build
=> move assignment and static method in front of the method,
that uses them.
Pick-to: 6.6 6.5
Change-Id: Ie06f91f7857130f08fd484a6e7319ddfd16c546b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
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>
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>
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>
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>
When using MinGW compiler and Qt is configured with "-static-runtime",
we should pass "-static" to g++ while linking, like Qt 5, instead of
"-Wl,-Bstatic", to get rid of dependencies on libgcc_s_seh-1.dll,
libwinpthread-1.dll and libstdc++-6.dll.
Because syncqt doesn't link to any Qt library,
"target_link_options(${target} INTERFACE -static)" has no effect on it.
So we should use "PRIVATE" instead of "INTERFACE" for executables.
Pick-to: 6.6 6.5
Change-Id: Icf551783f92ef3615b3840c9af16d163eee09fdb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Also while touching code, replace arg usage with QSB to prevent temp allocation
Change-Id: I3573266dbee8a00ae917773c107b5df7774acb79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
Starting from OpenSSL v 3.1.1 DTLS 1.0 is only available, if the
security level is 0, which is not the case most of the time. So
we consider this version number to be a 'threshold' after which
we don't test v 1.0 anymore.
Pick-to: 6.5 6.6 6.2 5.15
Task-number: QTBUG-116166
Change-Id: I9763703f36ae742e1d3c7cb17872cf8d0d82ab85
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>