This change will create Config.cmake files for internal modules like
AccessibilitySupport when doing static builds. They need to be
find_package()'ed and linked in when linking in certain qt plugins.
Task-number: QTBUG-38913
Task-number: QTBUG-76562
Change-Id: Ia2e446025c87df48f20bb65cfd9da6c6a4354bb1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Also reduce the pool size from 131 to 17, and use QBasicMutex
instead of recursive ones.
Change-Id: I3bf0374cce5ff2c07427070aba6128a22c9b70e4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The use of QMutexPool caused an #ifdef, because, lacking an object,
some OpenSSL function pointer was used as the address required as
input for the mutex pool. Sadly, the names of the functions differ
between OpenSSL versions, thus the need for an #ifdef.
By simply using a QBasicMutex (defined at namespace scope to evade
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79561), the #ifdef can go
away.
Another level of #ifdefs goes away because, even for
non-QT_CONFIG(thread) builds, Q*Mutex etc are defined, just as
no-ops. So we can freely use them without QT_CONFIG(thread) guard,
unlike QMutexPool.
Finally, optimize for the (common?) case of already-loaded libraries
by making symbolsResolved an atomic variable, and checking that before
taking the mutex (double-checked locking, done right).
For reasons of said GCC bug, again, the QBasicAtomic is defined at
namespace scope. And then move the other boolean there for symmetry.
Change-Id: Ic5f44871fb200e5368b9af327e4d1e852fbc586c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
That's how CommonMark specifies it. The HTML codec-guessing algorithm
was making it fall back to Latin1 in practice, which was screwing up
any Unicode characters found in the markdown source.
Change-Id: I4021adc4a68591ecfd56ef24971af53ce3e9c96d
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This allows to query all names that can be activated on the bus.
Change-Id: I8f894bf858eb18b67a074ca666ad3200ed99c373
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some compilers (hello, MSVC) do not produce literal types in Qt
because their constexpr support has been blacklisted.
Therefore, amend the check for literal types in Q_ARRAY_LITERAL:
only do the check if the compiler supports constexpr.
Change-Id: I7cffe00dde447d975aa6a7d02248df9c351508ff
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
If the filename matches, no other matching is necessary. Fontconfig
doesn't have a fast path for that, so implement one here.
Fontconfig is unlikely to add that fast path, see here:
https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/103
With -O1 builds of Qt and KDE stack, 358 fonts installed according
to KDE systemsetting, on a Ryzen 1800X, startup time of kwrite
decreases as following according to perf stat:
msec task-clock: ~480 ms to ~455 ms
cycles: ~1.73e9 to ~1.65e9
Change-Id: I630a80e4bed2647d5bbd95247005aab7d0cb0363
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
In one case, added NSDMI to avoid churning the ctor-init-list.
Change-Id: I5587d5cb7e393f60ad29cb5186127304d27d1d46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In all of these cases, the effect of the change is local to one file.
Change-Id: I3bda3aadee3b42e7797183c2330183390b92d1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Move the recursive mutex use case out of QMutex into a separate class,
unsurprisingly called QRecursiveMutex. As an immediate benefit, 90% of
the QMutex users now enjoy a constexpr QMutex ctor.
This change prepares for a real split in Qt 6, so that both use-cases
are no longer bundled up in one class.
[ChangeLog][QtCore][QMutex] Added QRecursiveMutex as a replacement of
QMutex(QMutex::Recursive).
Change-Id: I79b8724e8a8ee65e4bd0f06acd76103fe4197b8c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
resolver.openFileDescriptor throws a SecurityException when the caller doesn't have sufficient permissions to access the URL. This will make an application crash.
We should handle this case gracefully and report it to the user. I'm unsure if there is a better way to do this than simply logging the exception.
Change-Id: I36bfbd3e398c8176e57042a27740aa15bce63a7c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
QComboBox::currentIndexChanged(QString) was deprecated due to the fact
that there is a currentTextChanged(QString) signal but this signal is
not equivalent to the other since it's also emitted when the lineedit
text changes.
Therefore revert the deprecation of this signal.
Fixes: QTBUG-76890
Change-Id: Ia314116a5ac4e43e60383da9e729e24ffb3e8b30
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
A double left brace in a link command was causing qdoc to fail for
the remainder of the qdoc comment. This update just removes one of
the left braces.
Change-Id: Ie4fc0122e0799955b7804c2b6f61393af01747c7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This patch amends fe63900dc9
The previous value of 400ms was a random and seemingly harmless choice.
It turns out that 400ms is a bit too long and interferes with x11 async
behavior tweaks in the VirtualBox source code.
The original aim of specifying a concrete delay was to fix the
nondeterministic behavior of the pre-existing code and to avoid flickering
on KWin caused by waiting too little. This patch changes 400ms -> 100ms,
which seems to work better in practice.
Fixes: QTBUG-76742
Change-Id: Ia8168216819ac41d0124622c9472a98a1877262f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When adding the static dependencies for a module, they should be
added to the debug|release configuration as appropriate, otherwise
it ends up adding the debug version of the libraries to the release
configuration as well as the release version of the libraries.
Implementation wise, that means we have to use generator expressions
of the form $<$<CONFIG:Configuration>:${dependencies}>, because
INTERFACE_LINK_LIBRARIES does not have a
INTERFACE_LINK_LIBRARIES_<CONFIG> equivalent that can be set per
configuration.
Note that the condition part of the generator expression can not
explicitly check for Debug or for Release, because a user can
configure their application without specifying CMAKE_BUILD_TYPE,
which means that both Debug and Relase conditions would fail.
So the actual condition has to be isDebug or isNotDebug.
The same approach is used for INTERFACE_LINK_OPTIONS.
For debug_and_release builds we use the isDebug and isNotDebug
conditions for the generator expressions.
For singular builds (only release or only debug), we set the
generator expression condition to "1" aka always true.
This means that the Qt libraries and link options will always be used
regardless of the configuration with which the CMake application
is configured with.
Fixes: QTBUG-76337
Task-number: QTBUG-38913
Change-Id: I5369d8ba083359a4a92253dbd1dabe9d1efa34db
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
When I added the QEXPECT_FAIL the http proxy was the only one.
That's no longer true after fixing the SOCKS proxy, so let's make the
condition more specific.
Change-Id: I1eaa5117d5d0219e04cbd091ec54e522fe7b5509
Reviewed-by: Dimitrios Apostolou <dimitrios.apostolou@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
- Replaced QOperatingSystemVersion::WindowsVersion,
QSysInfo::windowsVersion(), QSysInfo::macVersion(),
QSysInfo::MacintoshVersion with QOperatingSystemVersion::current().
- Added QOperatingSystemVersion::WindowsVista for convenience, as it
is used in lots of places.
Change-Id: If9c4ac496005b2e70b5c70be160747afa74b98c1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
- Replaced the usages of deprecated APIs of corelib by corresponding
alternatives in the library code and documentation.
- Modified the tests to make them build when deprecated APIs disabled:
* Made the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods are
enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, added tests for the replacement.
Task-number: QTBUG-76491
Task-number: QTBUG-76539
Task-number: QTBUG-76541
Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The absolute paths of certain static dependencies can have spaces in
them. The _qt5_$${CMAKE_MODULE_NAME}_process_prl_file fails to handle
this, and simply replaces all spaces with semicolons, which obviously
breaks the list of dependencies, and a consuming application fails to
link with a message like:
LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'
This change partially restores the functionality that was added in
102e1822ff specifically the part
that changes qmake to export an additional variable
QMAKE_PRL_LIBS_FOR_CMAKE. This variable has the same content as
QMAKE_PRL_LIBS except it uses a semicolon as a separator, so that
CMake can correctly parse the separate lib entries.
This is much cleaner than trying to parse the original QMAKE_PRL_LIBS
variable with a complicated regular expression.
Amends eda28621f6.
Task-number: QTBUG-38913
Change-Id: I1d18fb779606505bc92320d8ce13232c7022e212
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The paths to the libraries and prl files should have the "_debug"
suffix for the debug configuration. This prefix is added to the TARGET
when by qt_module.prf when doing a debug build, but not during a
debug_and_release build.
Make sure to strip the _debug suffix if it's there, and re-add it later
always, to be consistent in both debug_and_release builds and in
debug builds.
Amends a12b6e7bf6.
Task-number: QTBUG-38913
Task-number: QTBUG-75520
Change-Id: I29e88f2b991e2be06b23652d64edc768fa35a5ae
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
If the resource path 'base' was relative it would enter condition 3) in
qFindTestData() and it would actually find the nonsensical "://data" as a
viable candidate. We don't want to enter that case, but rather enter the
subsequent ('Try resources') case
Change-Id: I1928ba02c941e23fee4fec9052a1981e46fa59b7
Task-number: QTBUG-73512
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Noticed this when running Qt Creator against dev
Change-Id: Ie75b2e0f2a77033ce0455d7ee3304193aa6e511c
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
This commit introduces a new feature called vkgen for the tool which
depends on xmlstreamreader.
Note that when features.vkgen is disabled, vulkan.pri will generate
dummy qvulkanfunctions.h and qvulkanfunctions_p.h because buildsystem
needs them.
Task-number: QTBUG-76159
Change-Id: I03d526a0fd76a2d8b531940f37538cead109d9d3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
You can create multiple instances of QBenchmarkGlobalData as the ctor
is public.
The qmltest plugin does create a static one, but only conditionally
assigns it to the singleton pointer. On shutdown the plugin is removed
and the QBenchmarkGlobalData::current should only be reset by the dtor
if it's actually pointing to the same object.
Change-Id: I616c1ccf6f7a00abf1de342094da88481510bc7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
That code would normally call for QSet::find instead
(Uniform Container Find cannot come soon enough).
Since the code is showcasing a STL algorithm usage,
port it to std::find_if to showcase a real use case.
As a drive-by: fix the usage of endl with std::cout.
(Ok, it's just a variable called "cout", and I'd argue
that in example code "cout" is not the name of a
QTextStream).
Change-Id: I8686178b33c31552eb4d909a4089453d60994b79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Use the QSet QWidgetPrivate::allWidgets directly instead of
calling QApplication::allWidgets(), which allocates a QList.
Change-Id: I16d289030cecefae7811d4b2c94f865f46f700d5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reduce our usage of QRegExp in preparation towards deprecating
it. This also brings it in line with QDir that already uses
QRegularExpression for filtering.
Keep the old QRegExp based code around in bootstrapped mode,
since qmake uses this functionality.
Change-Id: I98b9d2875c30e17e406b6711dfe3265ba37624ac
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
By running dumpcpp if the files do not exist at qmake time we enable
the dependency finder to find these files and set up the dependencies
as appropriate. Since other changes ensure that dumpcpp will be called
at the right time when building if the typelib changes, we no longer
need to have the generated files dependent on the objects. As a
result, we are able to prevent it from unnecessarily rebuilding
everything if certain files are updated.
Change-Id: I334f48c7a980aa8b893c14cb2a4687d3b2b7a4b9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
... except for tests, which manually undefine the macro.
Like QT_NO_FOREACH, this is a technical way to keep JSI-free
modules JSI-free going forward.
Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Amends b03385f9cf.
Java-style iterators are scheduled to be deprecated.
The general pattern used in the patch is that instead of copying an
input list, then iterating over the copy with some calls to
it.remove() (which leads to quadratic-complexity loops), we simply
copy conditionally (a la remove_copy_if instead of remove_if).
To make clearer what's going on, rename the outgoing list to
'unhandled'.
To avoid having to touch too much of the loops' structure, which
sometimes is quite convoluted, use qScopeGuard to do the append to
'unhandled', unless the original code removed the element.
Change-Id: I808a939b9c816b329ee87620e0a3461fee6e3e40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Replace the identity check with a check for the underlying QHash
objects being shared and replace backwards iteration, which is really
forwards iteration with wrapping at bucket boundaries, with forward
iteration. QSet cannot contain duplicates, so the order in which the
RHS elements are presented to the algorithms does not matter.
Change-Id: Iad8528e3a9501b14cb85601b221a848aad91480c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QWidgetPrivate::windowHandle() should not return nullptr from the
WindowHandleMode::Direct branch in case WindowHandleMode::Closest was
passed.
Ameds eed9a8fbd3.
Task-number: QTBUG-62094
Task-number: QTBUG-73231
Change-Id: Ia55fff15f0a499cef9525e53111ddd55b2e012d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The QNetworkReply implementation for Qt for WebAssembly now supports
usage of the QNetworkAccessManager::sendCustomRequest, making it
possible to send requests with custom verbs.
[ChangeLog][QtNetwork][QNetworkAccessManager] Fixed
QNetworkAccessManager::sendCustomRequest for Qt For WebAssembly.
Fixes: QTBUG-76775
Change-Id: I9394ffef110fce4ed2c877893631bedc7631f71e
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This seems to be a common use case, and to be expected from pastes
of MSWord documents.
Change-Id: I5849d7f51408e76f15a0b03c2118649f118af1d6
Fixes: QTBUG-66794
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>