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>
The plain bool variable wasDeleted is set to true in the
QHostLookupManager dtor before the call to clear(), which calls
waitForDone() on the thread pool performing the lookups. All tasks on
the thread pool start by checking this variable so as to return early
when destruction is in progress. But the check was outside the
mutex-protected area, so as a non-atomic load, without a
happens-before relation to the write, this is a Data Race, thus UB.
Fix by moving the check past the mutex locking into the critical
section. This way, tasks that were waiting for the mutex after seeing
no wasDeleted before get the message reliably.
This does not introduce a dead-lock, since the call to waitForDone()
is outside any mutex protection leaving a window for the tasks to
obtain the mutex and react on wasDeleted.
Change-Id: Ied4b9daa7dc78295b0d36a536839845c4db2fb78
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: David Faure <david.faure@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>
Factor out the screen area check to a separate helper and apply to
restoredGeometry, too, fixing an oversight of
2f2bfc4e59.
Change-Id: I795d8d5e3cddb5e986c96c08a342d69063d04970
Fixes: QTBUG-76900
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
restoredFrameGeometry is only used for a sanity check in format
version 0, add a comment and remove code.
Task-number: QTBUG-76900
Change-Id: I797b07d069f8568cb39541bcbe9009935a4a79f7
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This is an enabler for supporting pen color for color fonts in
Qt Quick.
Task-number: QTBUG-74761
Change-Id: I3e605f939e6677cbbd4a650ae7998dea8fd2d7a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A previous change to QLineEdit::sizeHint() has caused the QSpinBox
arrows to break the widget frame on a high-DPI display with some
particular scale values like 150 or 175%. This change updates
QLineEdit::sizeHint() so that it has a minimum height, using the same
values used in 5.11.
Fixes: QTBUG-76047
Change-Id: I21f3e736da473b10fdf52e5a60e5fc5d07f270a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@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>
Color fonts may also contain regular alphabet characters that
should be rendered with the current pen. In Qt, however, these
characters were drawn into the cache with a default pen color
of black.
Since all characters in a font is currently backed by the same cache,
and it would require a lot of plumbing to get around this, a step
in the right direction is to include the current pen color in the
cache as long as it is an RGB cache. This means that drawing
text with the color font with different pen colors will create
different caches.
There is no API to select font color on Freetype currently, but
this problem has also not been observed there, as the fonts
in question, with both regular and color glyphs, are not being
detected as color fonts (so the text color will be correct).
So Freetype will be left out for now.
[ChangeLog][QtGui][Text] Fixed bug where regular text rendered
with a color font would always display in black.
Task-number: QTBUG-55096
Task-number: QTBUG-74761
Change-Id: Icc7dbf73241db1e7cc6a0de18c2de927aeecf713
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Remove the config.unix condition from the ccache feature. This enables
us to use ccache for non-Unix cross-builds like MinGW on Linux.
Change-Id: I3b108c2288754ad5dd05834e3d5a487c2da4ac00
Fixes: QTBUG-76681
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This reverts commit 224a60989e.
Turns out that we cannot just untangle the determination of
source root and build root, because this breaks the assumption
that every .qmake.conf results in a separate .qmake.cache in the
build tree. QTBUG-76140 must be fixed differently.
Fixes: QTBUG-76907
Change-Id: I5c0a3719d5e00a0f1cacad51651b47c1f284d22d
Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
The header clean command must not be prefixed by "@echo ...", because it
now starts with "$(CXX)" which already is prefixed.
This amends commit 6fa5dfdd.
Change-Id: I5c2e0d2c2ed91c7232fce0a4a49db0fccfdc005d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A blinking white dot could appear on dark backgrounds on Windows 7/8/8.1.
It was caused by a workaround added to trigger the on-screen keyboard
on the Microsoft Surface. This change effectively restricts that
workaround to Windows 10, where the blinking dot was not an issue.
And anyway, impact over the Surface functionality should be minimal,
as all models produced since 2015 only support Windows 10 (and it's
unknown if the workaround was ever necessary for early models running
Windows 8.1).
Fixes: QTBUG-74492
Change-Id: Ic9b9c0f71f23b75212054c56a29796cf0efa109a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
In some cases, the wheel event coordinates would be incorrect, as the
local coordinates were being determined relative to one window and
the event being sent to another window, possibly incorrect.
Fixes: QTBUG-75820
Change-Id: I4c3c4c6c4688bd9232d67ce4052d24365f6aea3a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
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>