QChar currently is convertible from nearly every integral type. This
is bad code hygiene and should be fixed come Qt 6.
The present patch is the result of compile fixes from marking these
constructors explicit. As is clear from the distribution of fixes,
only low-level string handling code used these implicit conversions,
an indication that they're not in widespread use elsewhere.
Change-Id: Ief5336f21e6d181e03ab92893b3d13a14adc7cb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Who knows what this may end up being good for.
Change-Id: Ib5e73b0170ebba54f87f36e75b7c407f801c52a0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I61446afa882304400d3ae8045e4f17bb7a020600
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Blocks are likely to have been created in a differnt thread from the one
performing their deletion, so we need an acquire fence.
The rest of the atomics use in the class looks ok, but nevertheless warrants
a deeper analysis.
Change-Id: I1571ded3a06695b0d58b5bf1d80d6283ac21f959
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6fa34930c2)
(cherry picked from commit 51bcc7e07e2bb5b42bb200dcd5269e9e9e2fe240)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The pointer value is not the only data we're interested in, but
instead points to indirect data, so we need a release fence on store
(present) and a corresponding acquire fence on load (was missing).
Change-Id: I51f8251c0c7f4056192880430f2be5e0836dbed6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f84829031)
(cherry picked from commit 4cc6e1419294a729e53d698bace2254903c1429b)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
As with widgets, items that are disabled should not receive any input
events.
Similar to QGraphicsScene, which ignores disabled items when handling
mouse presses, the view should also ignore them when handling mouse
moves to update the cursor.
Since QGraphicsView only adjusts the cursors on mouse moves, reenabling
an item that is currently under the mouse will not change the cursor.
This is consistent with other changes of item attributes that would
position the item under the mouse (such as moving it). The overhead of
hit-testing items for every such attribute change would be too large,
and applications can generate a mouse move event if they really need
to adjust the cursor in all situations.
[ChangeLog][QtWidgets][QGraphicsView] Ignore disabled items when setting
the mouse cursor.
Fixes: QTBUG-76765
Change-Id: Ifcd31fc0581e8421e58eeb436a55b031909eed7e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The tests send QEvent::MouseMove events to the view, but don't fully
construct the event with both local and global position. Consequently,
QMouseEvent will use QCursor::pos as the global position, which is
unreliable, as QTest::mouseMove can not guarantee that the mouse really
moves - when running the tests locally on e.g macOS, it never does.
So instead construct the QMouseEvent with the trivially calculated
global position.
Change-Id: Ic4c914e3af7f15751545080d4743b06d3887cce8
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
The QImageIOHandler::name() has been deprecated since 5.13, but its
overrides weren't. Enabled compilation of the overrides only when the
QImageIOHandler::name() is compiled.
Task-number: QTBUG-76491
Change-Id: I8fea0032427d25bb0de01be8920c723fc21f6b7a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Amends ca280bfe3b and
705e3f68df which added these enums only to
QPlatformTheme::ThemeHint but not to QPlatformIntegration::StyleHint.
Those patches did not add accessors to QStyleHints, probably because
the accessors in QStyleHints use the themeableHint() function which
takes both enums; so to have an accessor implemented this way, we need
it in both enums. But it's getting too silly, since the only platform
plugin that modifies MouseDoubleClickDistance is Android, implemented by
QAndroidPlatformTheme overriding QPlatformTheme::themeHint(), and thus
illustrating that adding the enum to QPlatformIntegration::StyleHint
is not the only way to allow a platform plugin to customize the hint.
So it seems we need a new way of writing these accessors without needing
to duplicate the enum value in QPlatformIntegration::StyleHint. The new
version of themeableHint(QPlatformTheme::ThemeHint) falls back on the
static QPlatformTheme::defaultThemeHint() accessor.
Users should at least be able to see what the default value is; and
having these getters will also provide link targets for QtQuick's
TapHandler docs.
Change-Id: I0f8560062bcd0ca5e6d580071d9fbcf3f07f625f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This patch amends 730cbad882
The issue was that the event reader thread (QXcbEventQueue::run()) can enqueue
events sometime between GUI thread has last time peeked at the queue and before
it has called waitForNewEvents() and hence started waiting for more events (via
QWaitCondition). This scenario is even mentioned in the QWaitCondition documentation:
"[..] if some of the threads are still in do_something() when the key is pressed,
they won't be woken up (since they're not waiting on the condition variable) and
so the task will not be performed for that key press. [..]"
And if there are no more events on the X11 connection, the waitForNewEvents()
in QXcbClipboard::waitForClipboardEvent() would timeout.
Fixes: QTBUG-75319
Change-Id: I8990a2a0c00571dfc334fb57d616dee999042885
Reviewed-by: Igor Kushnir <igorkuo@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
These tests have not failed on the removed platforms for at least 60 days
Task-number: QTBUG-76608
Change-Id: If7a9f4db907124e3cd54e3f4b0ad3e20717d1912
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The code contained a copy of std::any_of from a time when we couldn't rely
it's availability in all compilers. We now can, so remove the copy.
Change-Id: I356077f58ae6a48b71f2dd98a2dab4e2acf985c7
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Simplistic console application with one test for each of the two
classes. Simply tests that we receive the signal when the connection
is disrupted in some way.
This patch also exports the classes for tests/developer builds
so that we can actually link with them.
Change-Id: I8066312274350984110c3f3ad3e94854adca7c2a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Currently not available for mingw because it's missing all the
interfaces. But should start working once it has them.
Change-Id: I231e8b69e008c5300a83087fe9cd071acd0687cb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QNetworkSession has a concept of UsagePolicy which can disable
background* transfers to conserve battery or bandwidth. However, it is
only possible to change the policy through
QNetworkSessionPrivate::setUsagePolicy which currently doesn't have any
callers outside of our auto tests.
*background = transfers not initiated directly by the user, but needs
to be marked as such by the application developer.
Change-Id: I92c4abccaca040612b4795abe7c52d68a2d21749
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QNetwork{Status,Connection}Monitor isn't used for QNetworkReplyImpl yet,
so we should connect the signal until it is.
Change-Id: I40f1483608195418d43c442f46184882f64596ff
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
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>
Implicit capture of 'this' in [=] is deprecated in C++20.
Fix by using explicit captures.
Change-Id: I1633446f4670202b0d1aca938d8c27dbc0c1411e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
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>