We're already tracking the last view along with the last event, so
use that instead of always assuming the drag started from the window's
content view.
Fixes: QTBUG-102584
Pick-to: 6.2 6.3
Change-Id: Ibe8506b0f91ecdfe6e7fe91e17c129b4d7552880
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: <stefan.wastl@native-instruments.de>
In the sequence for the early 32-bit time_t leap years, I somehow
managed to get two of the entries swapped. This amends
commit 1f4b237dad
Pick-to: 6.3
Change-Id: I5cb9080f8c6a24e2163508e640747c6fbbe93dbd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In the same ways as for blacklisting. In the process, move reporting
of an unrecognised tag outside the global-data loop, as the tag might
be, or start with, a global data tag; and also report the global data
alongside the test-specific data. Indent the lines reporting tags, as
this makes the structure of the lists more evident. Converted the tag
argument to QLatin1String() to facilitate searching and matching.
Updated documentation, including expanding on the option of specifying
the data tags on the command-line. Drive-by: fixed a link in the
documentation, removed a snippet that was nowhere used.
[ChangeLog][QtTest] When specifying what tests to run on a QtTest
command-line, it is now possible to include a global data tag in the
same way as a function-specific data tag or in combination with it.
Thus if the test reports itself as tst_Class::function(global:local),
command-line option function:global:local will select that specific
test and function:global will run all data-rows for the function on
the given global data tag.
Fixes: QTBUG-102269
Change-Id: I7c86d6026933b05f7994bfc3663a2ea6a47f5f38
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The compositor should not show the resize cursor for fullscreen and
maximized windows, since windows in those states aren't resizable.
Pick-to: 6.3
Change-Id: I58762b7729a02f9a3c78edafe5d9d5b364fb552f
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The canvas cursor should always be restored to "default" if no cursor
is set, otherwise we get the I-beam cursor since the canvas is
contenteditable.
The code which handles setting and restoring the override cursors
handles this correctly, however we also need to set the default
htmlCursorName for cases where setOverrideWasmCursor() is not called.
Pick-to: 6.3
Change-Id: I23be7847d3a30ab78e3a8c9ec402285246bfefec
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Include new CMake and qmake snippets and reorganize some of the sections
structure.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I47cc9b24818c26740e49e6365bf881874942b79c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Add the new qdocinc cmake and qmake snippets and reorganize some of the
sections structure.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: Iafa31856500e458c14feeb92bee660f44a65ffa9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Move some of the detailed information into its own overview page and
reorganize the contents structure. Also, escape the _ character.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I396877912bed66537e4a97ee3d109ff92e15d843
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
clang compiler recently got smarter and detects "pseudo used variable"
patterns where we declare a variable and only use it in self-increments,
self-decrements and other similar expressions
Errors:
qtbase/src/corelib/text/qlocale.cpp:3898:9: error: variable 'group_cnt' set but not used [-Werror,-Wunused-but-set-variable]
int group_cnt = 0; // counts number of group chars
^
qtbase/src/corelib/text/qunicodetools.cpp:1372:21: error: variable 'uc' set but not used [-Werror,-Wunused-but-set-variable]
const char16_t *uc = text + from;
^
and more of the kind
Remove the ones that have no usage, mark others with [[maybe_unused]]
Pick-to: 6.3 6.2
Change-Id: Ib2d0722110e3da8c39e29ec78c0ec290d064c970
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Restoring the state of a window with a dock widget could cause a crash
in a multiple display configuration if the scale or screen arrangement
in the system had changed after the state was saved. In this case, the
original top-left coordinate of the window could now lie outside of any
screens, which would result in a NULL QScreen pointer being dereferenced
inside QDockAreaLayout::constrainedRect().
Fixes: QTBUG-102718
Fixes: QTBUG-102541
Pick-to: 6.2 6.3
Change-Id: Ie5e3209b82a33a1dc4568611c1b2ee3a6d8830b7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Matches the ordering in QFontDatabasePrivate::invalidate() and ensures
that when the fontDatabaseChanged signal is processed by clients the
cache is ready to be filled again.
Change-Id: I9d09060284c6090ae2748147f6ee75b9f9b173c5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
If you try to use the QKeySequence::FullScreen
as a shortcut for your Qt applications, you'll find
it's not working. This is due to this key combination
is being skipped by Qt and it's being passed to Windows's
default handling procedure. This is wrong because
Windows doesn't provide any default action for this
shortcut so nothing will happen.
Change-Id: Id73b7275764fe63c119a6d673a665b0090944fef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
DWM colorization color change should also be considered
as a theme change event.
Change-Id: I55562b9d43988aafc8a60a6264fe16dccbefff92
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.
As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.
Change-Id: I0d3c232a9fa95aea854445922f100b89c6d6f5a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
screenGeometry() for proxy widget was returning visible part of the
scene instead of screen geometry for enclosing first view
Pass button center position to screenGeometry() to get correct screen
for cases when graphics view occupies two screens
Fixes: QTBUG-98785
Pick-to: 6.2 6.3
Change-Id: Idaeb3c3faf739751c93624a06fa0fd3d65388236
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QDockAreaLayout::sep represents the visual margin between a dock widget
and its frame, i.e. a dock within the main window.
The comment 'separator extent' has been replaced by a clearer version.
Change-Id: Icfb3d549a5bcb00c5f1cf4558c5a1c4f995e31f0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Empty drop areas have a fixed size of 80 pixels in QDockAreaLayout.
If a main window is below 160 pixels wide or high, drop areas start to
overlap. If a main window's width or height is 80px or less, drop areas
fully overlap. Dock widgets can't be dropped in overlapping areas,
because the dock area becomes ambigous.
This patch decreases the width and height used to calculate the drop
area rectangle by the extent necessary to prevent docking.
QDockAreaLayout::sep (margin between a dock widget and its dock) is
used as the new minimum height and width.
Change-Id: I1db3282cfc7c602b59bb2f20ba616efe1719b0cb
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
We were using the count of the registered families as the way to
determine if the font database had been populated yet. As a result
we needed to invalidate the font database every time an application
font was added to an empty database, as once the application font
was added, the font database was no longer empty, and we would end
up failing to populate any of the system/platform fonts.
We now have a dedicated flag for tracking whether the font database
has been populated, and we track whether an application font has been
populated by looking at its properties list, avoiding a second round
of populating when the full initialization happens.
This also opens up the possibility of the platform font database
populating (lazily or fully) fonts up front, for example as part
of resolving theme fonts.
The Windows font database had to be taught to invalidate itself
at the right moment, instead of assuming doing so during populate
was okey.
Change-Id: I80c893df755d8d35fb8a84dd7a83c6756a8f24a2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Convert various uses of Q_GLOBAL_STATIC_WITH_ARGS() to the less
verbose form the recent reworking makes possible.
Change-Id: I57820660b5d00d39bf54b5a08cb921ebaec57c7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do build zlib as static 3rdparty library. This makes it easier to
disable warnings.
Pick-to: 6.3
Change-Id: I1db331b671b64e68d81c56b0df337983c3bbe7fa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The QWSI event for theme change has an optional window parameter to
specify the window affected, but most platform react to global theme
changes, and end up passing nullptr into the event.
The reasonable thing to do in QGuiApplication in that case is send
a theme change event to every QWindow, so that they are all notified
about the situation.
This approach is what the Windows platform plugin was doing already,
but did so by iterating manually over the windows, resulting in multiple
calls to QGuiApplicationPrivate::handleThemeChanged -- one for each QWSI
event.
Change-Id: Ifb27b6c31231377c0df389a592cafd0075d3d8bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's one thing that this is not part of OpenGL ES, but it is optional
even with Vulkan, with some mobile GPUs not offering the feature at all.
Change-Id: I4e2c6642eccb0793e69074b4b6eeb2b7cef3516e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
In Qt 6, we removed the "old" Harfbuzz and Harfbuzz-NG became the
only option. But the QT_HARFBUZZ=old environment variable would
still be read and would disable certain parts of the code path.
This has caused some confusion when porting older applications,
where QT_HARFBUZZ=old was used to work around issues with the
earlier versions of Harfbuzz-NG. Setting it now causes text to
disappear completely.
To avoid this confusion, we remove traces of the QT_HARFBUZZ
environment variable as well.
[ChangeLog][Text] Fixed an issue where setting the legacy
environment variable QT_HARFBUZZ=old would cause text to
disappear from the application.
Fixes: QTBUG-102774
Change-Id: I0f07cdb2418202fc36b82e766ad9547c34477175
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Use _s literals everywhere, removing all codepaths generating
QLatin1Strings for comparisons and other optimizations.
This is now possible since string literals are now longer duplicated.
Task-number: QTBUG-98434
Change-Id: Ie35199593dc13a36afd92e3a0dd8d58ec492e4b7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
resource compilation is typically not bound by parsing headers, so they
don't benefit much from using precompiled headers. otoh, if we don't use
precompiled headers for them, we may have better turnaround times, as
these sources can be compiled in parallel with the pch compilation and
they don't have to be rebuilt when a pch changes
Change-Id: Ib4560ff31196e729f8efbcfb83cacfad127d90cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.
As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.
Change-Id: I121f87214b77aeab1dfd3e62dc5adaa6255cc0e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
If the user supplied a content-length, and we also know the size of the payload
then we would set the content-length again, which is a remove + add on a QList.
This is completely avoidable if we are setting the same size anyway.
Fixes: QTBUG-102495
Change-Id: If62739cadb453dbda4c21e858ba3a17baaf71fb4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
A loop variable could just as well be declared in the loop.
The startPos variable sits more naturally just before its first use
than where the removal of the loop variable's declaration left it
isolated.
Change-Id: I4754b9dfe4b142e5a183a0d9555c9d3237bc6bbd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Since 5.6.0, Qt's serialization of QDateTime in QSettings files has
had special-case handling to use a newer QDataStream version than the
one QSettings uses for most other types. This was handled in the
serialization and parsing, but not taken into account in the code that
turned binary data into content suitable for saving to an ini file.
In Qt 5 this caused no problem when no iniCodec was set on the
QSettings object but Qt 6 now uses UTF-8 as (in effect) codec on every
QSettings object. This lead to the binary data encoding QDateTime
being encoded as if it were Unicode, instead of using \x tokens where
suitable. This lead to an unintended incompatible change in how
QSettings stores QDateTime values: Qt 6 was still able to read Qt 5's
values, but Qt 5 was unable to read Qt 6's settings files (unless it
sets its iniCodec to UTF-8, which works round the problem).
The code to convert raw binary data to ini-file-friendly value texts
had a special case for ByteArray and Variant values, to ignore the
codec and use \x tokens: when support for QDateTime was split from
Variant, it gained a DateTime prefix in the parsing code that wasn't
included in this special handling. So add that now.
The resulting DateTime values now match Qt 5 so are readable by it and
by Qt 6 (including versions prior to this change); and the code to
read a DateTime can still read what earlier Qt 6 versions have been
writing. It is likely a Qt 5 QSettings with an iniCodec other than
UTF-8 may have problems with the result, but that was already true.
This amends commit 73b8cd879c
Fixes: QTBUG-102334
Pick-to: 6.2 6.3 5.15
Change-Id: Icc44a33db3dcc6400144bc001710b400ee883c90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
When composition is activate and the user switches from one window to
another we get callbacks that the original window resigned key and the
new window became key, which gets propagated as window activation
events.
QGuiApplication reacts to this by sending a QEvent::FocusAboutToChange
event to the window that lost activation, which QWidgetWindow then
responds to by committing the current input method.
Unfortunately, at the time we get the key window callbacks from AppKit
the keyWindow of NSApplication has already changed, so technically the
QEvent::FocusAboutToChange event is too late and not in sync with the
system state, manifesting in a bug in the input context and Text
Services Manager (TSM) subsystem on macOS.
In response to the commit of the input context we unmark (accept) the
current composition, and then tell the NSTextInputContext of the focus
view about this fact by calling discardMarkedText on it. But since the
NSApp.keyWindow has already changed at this point, the focus view's
input context is no longer the NSTextInputContext.currentInputContext,
and as a result discardMarkedText will activate and deactivate the TSM
document to ensure the right TSM document's marked text is discarded.
This leaves things in an inconsistent state, as the current input
context document, which was activated when the key window changed,
is no longer active.
We can work around this by manually calling activate on the original
NSTextInputContext.currentInputContext. The documentation notes that
this API should not be called directly, but unfortunately there are no
other call sites in AppKit that end up in ActivateTSMDocument.
A longer term fix would be to add plumbing to QWSI and QGuiApplication
to allow notifying the application about the upcoming window activation
before it happens, so that the FocusAboutToChange event and corresponding
commit comes in at the right time (before the current input context has
changed).
Fixes: QTBUG-102083
Fixes: QTBUG-101278
Pick-to: 6.2 6.3
Change-Id: I8d369d1ca87cbb74a168ff3082bd0ab58eb391c5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This patch amends a374d59abc.
That commit introduced refactoring of A11Y object description
announcements that also took a value into account.
However for the elements without values (like QPushButton), an unused
space is added at the end of the description.
This patch fixes the issue by explicitly checking that the value
interface exists and that the value string is not empty.
Fixes: QTBUG-102744
Pick-to: 6.3 6.2 5.15
Change-Id: Ic1ba50859fb91c871c242189967dcce35723a0b2
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Added QFuture::unwrap() for unwrapping the future nested inside
QFuture<QFuture<T>>. QTBUG-86725 suggests doing the unwrapping
automatically inside .then(), but this will change the return type
of .then() that used to return QFuture<QFuture<T>> and might cause
SC breaks. Apart from that, QFuture::unwrap() might be helpful in
general, for asynchronous computations that return a nested QFuture.
[ChangeLog][QtCore][QFuture] Added QFuture::unwrap() for unwrapping the
future nested inside QFuture<QFuture<T>>.
Task-number: QTBUG-86725
Change-Id: I8886743aca261dca46f62d9dfcaead4a141d3dc4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The work done by QGuiApplicationPrivate in response to a theme change
goes beyond notifying.
Change-Id: I27c74adf6549c553e659c7b8e271945ce753031c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Problem: if you create a hybrid Widgets and Quick Controls
application, you would need to use QApplication rather than
QGuiApplication. But in that case, the QQuickWindows would
never receive window activation events from QApplication.
And this causes problems for controls, since, for example,
the palettes in use there will never update upon activation
changes, and instead sometimes get stuck as e.g QPalette::Inactive
after application startup.
This patch will make sure that we send out activation events
also for QWindows that are not QWidgetWindows.
Pick-to: 6.3 6.2
Change-Id: I649f5c653081c0c5249f4faf28a7de2c92f17421
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Turns out there is a fillModeNonSolid in VkPhysicalDeviceFeatures,
so to be true to the spec we need to enable that when setting the
polygonMode in a QRhiGraphicsPipeline to something other than the
default Fill. This way the validation layer won't bark at us.
Change-Id: I41f561a1796ba1d45229dc20bf1fb7bae3c43f48
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
When QT_USE_BOOTSTRAP_SOURCE_COPY is ON, there are situations where
includes like
"../../3rdparty/sha1/sha1.cpp"
in qcryptographichash.cpp cannot be resolved. For example,
out-of-source MSVC builds are affected.
In-source builds are working by accident, because we're adding the
include path "<qtbase-build-dir>/src/corelib/global", and
<qtbase-build-dir> is <qtbase-source-dir>.
Linux/macOS builds are working by accident, because we're adding the
include path "<qtbase-source-dir>/src/3rdparty/forkfd".
Fix this by explicitly adding the directory where qcryptographichash.cpp
resides to INCLUDE_DIRECTORIES.
This amends commit 743bb66744.
Fixes: QTBUG-102720
Change-Id: I55fcc186ea4c81134c39023ced3f04458230109b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
New upstream release.
[ChangeLog][Third-Party Code] PCRE2 has been updated to 10.40.
Pick-to: 5.15 6.2 6.3
Change-Id: Ice0516604259ad9fd36fe2708aa0239aafe381ca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Move shellquote helper functions into a common place instead of having a
copy in each tool's code.
Change-Id: I9723c11f894a211864788a7635773610c0fde739
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Instead of having to do that each time for multiple paths, a common
helper function is better.
Change-Id: Ice2499f390a5790c5768eca037d186ad2e656ec7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The "android" tool is deprecated and never used now, and this function
is not called by anything either.
Change-Id: I6fdb09934c93f5bc03610bcc4fd677f8bb2d4189
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The file is going to be remove anyways in the next build, so just delete
it once we're done with it, this also makes the build folder doesn't
have files that are not needed.
Pick-to: 6.2 6.3 5.15
Change-Id: I948f028e9151b38a3ccc1ec628239ac91397e0d0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Tag passed to __android_log_print shouldn't contain spaces because
filter-spec used by adb logcat expects space-separeate list of
tag:priority specifiers. Effectively, its not possible to filter tag
using logcat if Qt's application name has spaces.
Pick-to: 6.2 6.3
Change-Id: I52b706b7a368d0700db45c0406bbfef279bc61fb
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Not every id is an NSObject, and even those that are are sometimes
passed around as id<SomeProtocol>, in which case we still want them
to have pretty debug descriptions.
Change-Id: I50a02cd8fb9d6a2cbde3c4aef81116033d10b72c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We were requesting to activate the window too soon, when the window was
still in the initial size of 600x600, in which case, the paint event was
not getting called. This would require the user to have to click the
window in order to see it.
Removal of this does not seem to effect showing of tooltips, which it
was added initially.
Change-Id: I3efa86be99a3d9e1d9eda87b7537fff1e96e6774
Fixes: QTBUG-102005
Pick-to: 6.3
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>