Removes a static string literal. QtMiscUtils allows the compiler to
possibly avoid the array, or share with other TUs
Pick-to: 6.3
Change-Id: I449800f113620a53d2f4b11fe027ebcb710f7b86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's used as a thread_local static, so it better be.
What prevented it was the unused inheritance from QObject and the
missing constexpr ctor of the StatIdent() data member.
Fixed both.
Pick-to: 6.3
Change-Id: I312ed6dc8bf7193cdaa7dc708bf19b018e56ec8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The typical argument, source_location::current(), is consteval, so it
cannot actually be used outside constexpr contexts. Having a
non-consteval, non-constexpr ctor to accept the return value is
conceptually wrong, as a constexpr-only result is forced though a
non-constexpr function. It may even trigger MSVC's consteval bug:
https://developercommunity.visualstudio.com/t/Cannot-use-std::source_location-in-C-m/1436152
because the work-around given, wrapping in a lambda, means wrapping
the result in a constexpr context, and that may just be the root cause
of the issue.
Pick-to: 6.3 6.2
Change-Id: I49534cf86f32e16b13d7e169cd5cb0c8fc374d69
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Also saves ~1.4KiB in combined TEXT and DATA size on optimized Linux
GCC 11 C++20 AMD64 builds.
Pick-to: 6.3 6.2
Change-Id: I53922ccd191e412a13e3e23f2e26fdb3bf43af33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This string table is small, so instead of using qOffsetStringArray(),
just don't make it static. The compiler will do it's thing, then,
without introducing relocations.
Proof:
$ ~/bin/relinfo.pl libQt6Core.so.6.4.0
libQt6Core.so.6.4.0: 6303 relocations, 5346 relative (84%), 318 PLT entries, 1 for local syms (0%), 0 users
vs.
$ ~/bin/relinfo.pl libQt6Core.so.6.4.0
libQt6Core.so.6.4.0: 6300 relocations, 5343 relative (84%), 318 PLT entries, 1 for local syms (0%), 0 users
Task-number: QTBUG-100536
Pick-to: 6.3 6.2
Change-Id: I7f5c3c127867c9baebfb270ef3e257dd818f821a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No need for a virtual do-nothing destructor in a class that isn't
inherited from. Defining an empty init merely makes QTest go to the
trouble of calling it, which it could just as well skip.
Change-Id: Ifd44c473c05fdeaaa7923d2ccdd0a13c8921b6bd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The offset fields for tst_QTimeZone::specificTransition() had a
comment claiming they are in minutes; they are in fact in seconds, so
fix that. At the same time, Moscow hasn't had a time-zone change since
2017, so the end-date for one of the test intervals can be nudged a
little closer to the present without harm.
Change-Id: I66822cb758f7e00d6added801466a6745be3e31a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Unless "." (or the empty string) is in $PATH, we're not supposed to find
executables in the current directory. This is how the Unix shells behave
and we match their behavior. It's also the behavior Qt had prior to 5.9
(commit 28666d167a). On Windows, searching
the current directory is the norm, so we keep that behavior.
This commit does not add an explicit check for an empty return from
QStandardPaths::findExecutable(). Instead, we allow that empty string to
go all the way to execve(2), which will fail with ENOENT. We could catch
it early, before fork(2), but why add code for the error case?
See https://kde.org/info/security/advisory-20220131-1.txt
[ChangeLog][Important Behavior Changes] When passed a simple program
name with no slashes, QProcess on Unix systems will now only search the
current directory if "." is one of the entries in the PATH environment
variable. This bug fix restores the behavior QProcess had before Qt 5.9.
If launching an executable in the directory set by setWorkingDirectory()
or inherited from the parent is intended, pass a program name starting
with "./". For more information and best practices about finding an
executable, see QProcess' documentation.
Pick-to: 5.15 6.2 6.3
Change-Id: I54f205f6b7314351b078fffd16cf7013c97ee9fb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In C++20, any given relational operator is also considered in its
reversed form, so e.g.
given op==(X, Y)
and X x, Y y, then y == x will compile, by using the reversed op(X, Y)
This, unfortunately, makes some existing asymmetric operator overload
sets ambiguous, and instead of applying tie-breaker rules, at least
Clang is warning about these.
For us, this means we need to make our overload set non-ambiguous. The
QJsonValue{,Ref} classes failed this, because they only provide the
following member-operators:
- QJsonValue::op==(const QJsonValue&) const
- QJsonValueRef::op==(const QJsonValue &) const
For member functions, there are no implicit conversions on the LHS. So
in C++17, we have a nice dichotomous overload set:
- LHS is QJsonValue -> use QJsonValue::op==(QJsonValue)
- LHS is QJsonValueRef -> use QJsonValueRef::op==(QJsonValue)
In both of these, it the RHS is a QJsonValueRef, it's implicitly
converted to QJsonValue for the call.
Enter C++20, and the reversed signatures are suddenly available, too,
which is a problem for QJsonValueRef <> QJsonValueRef, which could be
resolved, as in C++17, using
lhs.QJVR::op==(QJV(rhs))
or it could now be
rhs.QJVR::op==(QJV(lhs)); // reversed
Says Clang 10:
tst_qtjson.cpp:990:5: warning: ISO C++20 considers use of overloaded operator '==' (with operand types 'QJsonValueRef' and 'QJsonValueRef') to be ambiguous despite there being a unique best viable function [-Wambiguous-reversed-operator]
CHECK(r0, a0, r1);
^ ~~ ~~
qjsonvalue.h:189:17: note: ambiguity is between a regular call to this operator and a call with the argument order reversed
inline bool operator==(const QJsonValue &other) const { return toValue() == other; }
^
A similar argument makes op!= ambiguous.
Says Clang 10:
tst_qtjson.cpp:988:5: error: use of overloaded operator '!=' is ambiguous (with operand types 'QJsonValueRef' and 'QJsonValueRef')
CHECK(r0, r0, r1);
^ ~~ ~~
qjsonvalue.h:190:17: note: candidate function
inline bool operator!=(const QJsonValue &other) const { return toValue() != other; }
^
qjsonvalue.h:189:17: note: candidate function
inline bool operator==(const QJsonValue &other) const { return toValue() == other; }
^
qjsonvalue.h:189:17: note: candidate function (with reversed parameter order)
To fix, provide the missing operators as free inline functions (so Qt
6.2 and 5.15 don't get new symbols added) so there's always exactly
one best match.
This is a fix for 6.2 and 5.15. At the time of writing, 6.3 isn't
released, yet, so there, we could QT_REMOVED_SINCE the pre-existing
member operators in favor of hidden friends (as per QTBUG-87973).
Use C++17'isms to prevent an automatic merge to 5.15, which requires
contains(QT_CONFIG,c++2a):CONFIG += c++2a
added to tst_qtjson.pro.
[ChangeLog][QtCore][QJsonValue] Fixed relational operators to not
cause warnings/ambiguities when compiling in C++20.
Pick-to: 6.3 6.2 5.15
Change-Id: Ic70f3cad9987c87f7346d426c29cc2079d85ad13
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2dea20e4b0 de-inlined the dtor to avoid
duplicating its vtable in multiple translation units, but the class is
used externally, so we need to export it now.
Pick-to: 6.3
Fixes: QTBUG-100569
Change-Id: I7cf2abdfdeb59bced0631838fe329ba94ab8c73a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Those classes are not used by any bootstrapped tool.
Also remove the QT_BOOTSTRAPPED code paths.
Change-Id: Ic5a9b153a578fedcba37cd81a62ccf0182a2d34f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Those classes are not used by any bootstrapped tool.
Change-Id: I82fc32e16d044b91ab3a79109ab98a3010df2e2d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Because at least one compiler *cough*MSVC*cough* is unable to dllexport
a method that is in a dllexport'ed class.
Change-Id: I54f205f6b7314351b078fffd16d06b4e6ef0c086
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Before the #ifdef __cplusplus and namespace start. We don't need to
export anything from C (and I hope that remains the case), but at least
this removes the need for QT_{BEGIN,END}_INCLUDE_NAMESPACE. Which also
weren't needed.
Pick-to: 6.2 6.3
Change-Id: I54f205f6b7314351b078fffd16d0bc84c57cb2ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It's not used by any bootstrapped tool.
Change-Id: Id6751e80bb34642aeaea1c2bb4f24b480280623d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This class is used by androidtestrunner, which is not bootstrapped.
Change-Id: Ie75b4dd039f773a8ccb58f243bf9f74a5121c3f3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the CSR_ALLOW_UNRESTRICTED_FS bit of System Integrity Protection (SIP)
is enabled lldb will fail to print a valid stack trace when launched from
the crashed process, and might also resulting in hanging or crashing the
parent process (Terminal e.g.):
https://github.com/llvm/llvm-project/issues/53254
We detect this situation and avoid printing a stack trace if so.
Pick-to: 6.3 6.2
Change-Id: Iad8cab5fcdc545d810ca4d4e985aefc0988d0234
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Fixes crash in key mapper on iOS < 13.4, where the symbols are not
available.
Pick-to: 6.2 6.3
Fixes: QTBUG-100518
Change-Id: I9bb1a75b17e5f0f50205b757fdb673218d7fb5e0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Amends d42cfeb84f, which would result in
infinite recursion when the Edit menu was populated and added to the
menubar after the menubar has been shown.
Add a macOS-only test case that reproduces the crash without the fix.
Fixes: QTBUG-100441
Pick-to: 6.3
Change-Id: I018a7aa7f01558a3b9732b4d6d96a911dc7fbd19
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add baseline tests for QListView, QTableView, QTreeView
Add const to reflect number of available standard icons
Add baseline test for QLineEdit
Task-number: QTBUG-99677
Change-Id: I1abaae7f90c9b05c3b3467dc85c5652bc9d0f53b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The value of __cplusplus has nothing to do with whether the library
implements wg21.link/P1115 (libstdc++ even before C++20) or not
(libc++, even in C++20).
Use the idiomatic check (#if defined(foo) && foo >= x) instead,
fixing the Android build.
Pick-to: 6.3 6.2
Change-Id: I11bcefe455a1f13865c15d4beecbd3fe32115328
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The things they warn about are not of any serious consequence
to users or end-users and there's nothing they can do about it.
Adding to that, in Qt 6 it has a reduced role since
QNAM::networkAccessible was removed.
Fixes: QTBUG-100482
Pick-to: 6.3 6.2
Change-Id: I178d056c513b5dbb122d5c731af602d3dc117d8e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Forward declare some types in qaccessiblewidgetfactory_p.h instead of
including qaccessible.h. In turn, qapplication.cpp which relied on
transitive includes now needs to include qaccessible_base.h.
Change-Id: I8ac00d45a7ffccd84769fb210f29364a45bcd59e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
qaccessible.h includes quite a few heavy headers. While QAccessibleEvent
and QAccessible can be forward declared, the enums in QAccessible
cannot. By moving QAccessible into its own lightweight header, we can
significantly reduce the cost of using the enums.
qaccessible.h still includes qaccessible_base.h, and the syncqt rules
are adjusted to ensure that this changes is source compatible.
Additionally, we no longer include cstdlib, as we only need cstring.
[ChangeLog][Potentially Source-Incompatible Changes] <QAccessible> no
longer includes <stdlib.h>. This might break code that relied on
transitive includes.
Task-number: QTBUG-97601
Change-Id: I15fbd9c85f5746885f9e89eabfc6d07b9bb1f968
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
The C++ code, which is called from Java, was executed on Java thread.
However Qt has its own main GUI thread, where all GUI elements and their
accessibility instances are created.
As a result we have threading issues when accessing A11Y objects from
Java thread.
This patch uses QMetaObject::invokeMethod calls to dispatch all the
critical parts of the C++ code to the main thread.
It uses BlockingQueuedConnection, so that Java thread can still use
these methods synchronously.
The proper context is based on the m_accessibilityContext object, which
is created as a child of the base accessibility QObject of the
application (which is the QGuiApplication instance in most cases).
Task-number: QTBUG-95764
Pick-to: 6.3 6.2 5.15
Change-Id: Iff4f3f2645657f6aca426fa19ccc86a2cbe4d4d0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
This commit amends 850a7f1238.
We can't extract the parentId for the hidden object on Java side,
because the Java call is executed in a separate thread, so the
original hidden object can be destroyed somewhere in the middle of
parentId() call.
As a workaround, we get the parentId in advance, on C++ side, and pass
it as a parameter to JNI function.
Task-number: QTBUG-95764
Pick-to: 6.3 6.2 5.15
Change-Id: Ied2ab4ab39b947f3f582575cf77cc76fbac9e274
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Some properties and commands were mistakenly assigned to Qt 6.3.
Pick-to: 6.3
Task-number: QTBUG-100212
Change-Id: I504021863ce628628af469f0ac12881c2eb07dbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qtdeclarative has a call like
qt_internal_add_example(imagine/automotive)
This causes issues when trying to pass that as the name of the
external project. Use the last part after the last slash as the name
of the project.
Pick-to: 6.2 6.3
Change-Id: Ifc074e50e537f07f3636699ed255d2561930d873
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
It was using a faster divide by 256 instead of an accurate divide by
255. This meant black screen wasn't a null operation as it should be.
This also fixes alpha mixing for a few other compositions.
Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-100327
Change-Id: I149ad39147176e00ce753979d55dc8633704dc1a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Yield a warning instead of an error that -skip and -submodules have
no effect in a per-repo build.
Amends acaba63260
Adjusts to 11ae0e772c
Pick-to: 6.2 6.3
Change-Id: Ic26b0ba29e48be5162f13ad75308f8358d8878e3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Having just spent another afternoon wrapping my head around why this
code is correct, I chose to save the next person (quite possibly me)
faced with it the slowest half of the effort that went into doing so.
This amends commit d3ff95dcb8
Change-Id: If0fcd2fb1fff5e99b1046d07039169e928fda9e4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
moc, qmake, rcc, and uic tests execute corresponding tools inside
the test executables. This adds dependencies explicitly, to execute
tests using _check targets, without the need to manually build
dependencies.
Pick-to: 6.3 6.2
Fixes: QTBUG-98576
Change-Id: I8b989276e21199b867591f7b0f6af9204695ac13
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
With Ninja Multi-Config generator it's necessary to provide the
'-C' option matching the build configuration when running
ctest. This patchset adds the missing option to the command line
of the '_check' targets.
Pick-to: 6.2 6.3
Change-Id: I42acfba26a09877a6d3a5be9230860f15f95a0cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In a single-config build on Linux, we usually don't want a debug
postfix in library names (as opposed to Windows/macOS).
But when doing a multi-config build on Linux, assigning no postfixes
causes CMake to generate rules for a single config only, the first one
specified in CMAKE_CONFIGURATION_TYPES.
This leads to being unable to build all configurations from the same
build.ninja file as well as other obscure issues like race-conditions
when generating prl files.
To address this, when doing a multi-config build, always assign a
postfix for each config except the first release-like one, while
preserving the existing rules we had for debug postfix names.
Pick-to: 6.2 6.3
Fixes: QTBUG-100493
Change-Id: Ie9c88e074abdcf2961d7b3dee19a5694292717b8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
To clarify its purpose and separate it from the others
Pick-to: 6.3
Change-Id: Id9efcf474ac0cd8777393380bb85c83780454005
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
CI tests for QNX are run in QEMU which does not have enough RAM
to run this test successfully.
Pick-to: 6.2 6.3
Change-Id: Idab3e8b6a1e0ae3eddf5aedb82e6784a74ae9a3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The headers are already included in QtGui/QtGui. This also fixes
an issue when compiling with the respective features disabled.
Pick-to: 6.2 6.3
Fixes: QTBUG-100290
Change-Id: I5e7c6578952535315bacde218a26d2133c486b2c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
My understanding is that the two bullet list items should be
treated as one item.
Pick-to: 6.3
Change-Id: Ibdd2bbc8677e925e71e6de7b3f076a1fab3914bf
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This link command simply links back to the same page. Also, none of the
other modules put their module name inside a link command at the
beginning of the document, for example: The Qt QML module provides...
Pick-to: 6.3
Change-Id: I2299b92f44ee736d181f34d9e71a31ba210a34e8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>