Sometimes it's useful to know the scan code and virtual key as well.
Change-Id: Ic120189470a9ff44a5cb7f6dcc1405654136424f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Automatically unload loaded crypto providers on cleanup. In most cases
we don't load them, but when we do (e.g. when MD4 is used), we would be
leaking memory.
Fixes: QTBUG-115233
Pick-to: 6.5 6.6
Change-Id: I91318d391ab35d00647d1e9e2408fc987811a2d3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QWidgetResizeHandler sets its own mouse cursor, which can cause the
wrong icon being shown in corner cases (e.g. floating dock with custom
title bar and windows container).
Windows handles resizing of toplevel windows on platform level. A
QWidgetResizeHandler is not necessary.
=> Do not create one on Windows.
Resizing of floating dock widgets is tested in
tst_QDockWidget::dockPermissions(), floatingTabs(), hideAndShow().
=> No separate autotest needed.
Fixes: QTBUG-102196
Pick-to: 6.6 6.5 6.2
Change-Id: I20ab203e6b7ecc1dbda0524c7ff9bef271a7c04f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
The platform plugin should already DPR (or DPI) change
events, however if that does not happen we update in
the expose event as well as a last resort to make sure
the window's DPR value is in sync.
Also print a warning and ask for a bug report.
Pick-to: 6.6 6.0
Change-Id: Ibb144f163281a28216c2fa3353ed50237e91ce25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
User code usually don't need to differentiate between asyncify
1 or 2 (JSPI), since the differences are abstracted over by
the wasm event dispatcher.
haveJspi() returns true for JSPI only as before, and can be
used to differentiate between the two.
Add canBlockCallingThread(), which returns true also for
secondary threads (which don't need asyncify to block).
Change-Id: Ia37513f2d4c56ef6351c950b5fc31ad15fa389d9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Use pmf-style connect, remove Q_PRIVATE_SLOT and remove the _q_ prefix
for the private slots.
Change-Id: I7e606e24f4f89183eb12fefcf53d0d8952a90516
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
During NTLM http proxy authentication QHttpSocketEngine did
not emit the proxyAuthenticationRequired signal during
handling of HTTP 407 responses. As a consequence, the proxy
server was spammed with connection requests that never
worked.
Fixes: QTBUG-109718
Pick-to: 6.6 6.5
Change-Id: Icf0ccf58e3f2690d210652713155a303026ed3b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Signals delivered via kill(2) are delivered to any thread that is
running, so let's make sure the WatchDog thread doesn't get them.
This may be hiding bugs in the user's handler code, but in simple unit
tests the user may not be expecting there to be multiple threads in the
first place.
Pick-to: 6.6
Change-Id: I512648fd617741199e67fffd17822cdcdf30926c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: Id15ef245cacca9c00bf65271bccf4da82fb7fd2f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: Ib03acba5823101f05d695aa31fd0d7f131443c01
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: I38f13fff8312ac1f3f9da6e034f3131de7bd6247
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: I9a5e178af997bfcfef78f7a3b9b84da6d653186d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Cleanup the private function names after the change to pmf-style
connections.
Task-number: QTBUG-117698
Change-Id: I60275b7da6bf5e78562ccfd38a02719cc313eb49
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Remove the now unused Q_PRIVATE_SLOT() macros for all itemviews classes
after the conversion to the new style-connection syntax.
Task-number: QTBUG-117698
Change-Id: Id4b8077d9f07741cc418a2126843565940701125
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: Ia0745dc10a917f3af4b448b3156d66bdb5d6ce64
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: I955bd088e24ada7aa87645d28dc9b201bc67e927
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: If2c259c3f7737cec736c134c8bc83c4cb14906ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: I2b5bb99c77e6e783a4cd7b0065d2f52a0266d88b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: I652c8d6f27b23a7d4467dc39b7c12850f4d25f66
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: Ic6617b3611a2ce156e9e568c1d07343f649562c4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Task-number: QTBUG-117698
Change-Id: Ifd6a55080a803b3aba2e35b9679a5194ff3f633c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Fix runtime warnings about testdata with the same name.
Pick-to: 6.6 6.5
Change-Id: I5d4927cc53be3e08a524498db42a8a08396ced8e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Upstream changes every few days, so make this as easy as possible.
Older branches have a different way to update the list. The idea of
this script is to paper over the these differences.
Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-117138
Task-number: QTBUG-116236
Change-Id: Ib7c6187e4b9c09de715a014d22af9c20d4783086
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Xdg-desktop-portal will reject any OpenFile request if there is an empty
filter, so if we can't find the mimetype in the mimedatabase we just
use it's "raw name"
Pick-to: 6.6 6.5 5.15
Change-Id: I705ae7523445e5c2ec97a42ee334401bc90adb68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As described in QTBUG-27681, we no longer send KeyboardLayoutChange
events in Qt 5 and up. We have QInputMethod::localeChanged, but that
doesn't cover the cases where the input language stays the same, but
the layout is changed.
None of our widgets react to KeyboardLayoutChange these days, but
ideally we should send KeyboardLayoutChange if we can plumb it from
the platforms.
However that plumbing wouldn't live in QKeyMapper, and having it
around as dead code doesn't help, so remove it for now, and track
the work to implement it in QTBUG-27681.
Task-number: QTBUG-27681
Change-Id: I480590550f3bc741b829fb30aa85393b07d5c16f
Reviewed-by: Liang Qi <liang.qi@qt.io>
There is no point in maintaining the keyboardInputLocale and
keyboardInputDirection in the QKeyMapperPrivate, as these
things are handled by QInputContext nowadays. The values
were never updated either, so the base class implementation
of QPlatformInputContext referring to them was confusing.
With those gone, we can remove the entire class.
Subclasses of QPlatformInputContext typically only override
locale(), so we now base the input language direction on the
current locale(), giving dynamic updates of the direction as
well (without the signal, but this will be fixed in a follow
up patch).
Change-Id: I16ae4097eadadd278e60edea3c1101ab90ed7444
Reviewed-by: Liang Qi <liang.qi@qt.io>
They actually can be, so the implementation need not change. Just add
the noexcept tag (which is BC, it's not part of the name mangling on
any compiler).
Silences a bunch of XFAIL in the test (the test is automatically
picking up the change, no need, and no way, to manually remove the
QEXPECT_FAIL).
Change-Id: I24b6ba1248001056de64f341617943e7aea5ae93
Reviewed-by: David Faure <david.faure@kdab.com>
Pointers can only be legitimately compared with less-than (<) if they
point into the same array (or one past the end). This is decidedly not
the case for heap-allocated objects like
QPersistentModelIndexPrivates, so doing it is UB.
Fix by using std::less, which is guaranteed to be a total order, even
for unrelated pointer values.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If04341b4b55784e7732782f3ae829f53b0ceab9c
Reviewed-by: David Faure <david.faure@kdab.com>
Execute the cheaper test first, so we loop over the entries more
quickly.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd178749a12c966739
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Copying QStrings and QByteArrays is reasonably cheap, but moving is
cheaper.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1787498ead687da2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
All these where somewhat cheap to copy (QStrings and QByteArrays), but
why copy multiple times at all? Just copy at the end.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1787497434632dd4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
symlinkTarget() suffices, because if the candidate is not a symlink, it
will return an empty string. Plus, /dev/disks/by-label is a udev-managed
directory, so everything should be a symlink.
This doesn't change the number of statx() calls because QDirIterator
needs some information on file types to decide how to filter and,
unfortunately, that information is missing for symlinks (we know it's a
symlink, but we don't know what it points to). Moreover, due to
QDirIterator's design, we always statx() one entry past the one we
wanted.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786ce1bd3398d1b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Otherwise Qt Creator won't index it.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786cda60859226b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
It was limited to only the most common platform, Windows.
Change-Id: I1821a5201f85b14f8f43469775af816519724f6b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit baac34de modified the set[Red|Green|Blue|Alpha] function
signatures. Amend the \fn commands to reflect those changes.
Pick-to: 6.6
Change-Id: I947995fc5c80baac111a04272cd848961c22eb73
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We react to WM_INPUTLANGCHANGE, and handle it by calling
handleInputLanguageChanged on the input context.
As input language is not the same as keyboard layout
(a keyboard layout might change without the input
language changing), let's be accurate about what's
happening.
Change-Id: I8914994a8d46485179741e010d0da5135b023668
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().
Change-Id: I8f2d64b77849bf5fea01b7f80bbd5d0c0a09c4fa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
If users have
CONFIG += qt
in their .pro file then the project won't link if the platform requires
the entrypoint module. This is because qt.prf is loaded before
entrypoint.prf in this situation.
Make the CONFIG values 'entrypoint' and 'qt' independent of their order
by embedding the content of entrypoint.prf into qt.prf.
Pick-to: 6.5 6.6
Fixes: QTBUG-117674
Change-Id: I72a3c9be023a73d70454533262544a4211cb6974
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The jbyte type is a signed char, which also promotes to int in variadic
argument functions.
Extend the test case to make sure that we don't get any warnings for
the most relevant parameter types.
Change-Id: I7811e1eebdbc989ab5989eb1a2c502acd0540bc7
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
This reverts commit 5e76a9569e.
The change's stated goal was to make shortcuts "stable",
i.e. work the same, regardless of which keyboard layout
the user has selected.
In doing so, it changed the semantics of shortcut handling
to depend on the order of the keyboard layouts reflected
by XKB, picking the first Latin layout in the list, instead
of prioritizing the currently selected/active keyboard
layout.
This change in semantics is a major behavior change, and
breaks common and valid setups such as having [en,fr] or
[en,de] layouts.
For example, the French layout uses an AZERTY layout,
where the Q and A keys are switched compared to QWERTY.
With the change in place, pressing the physical A key
on a French keyboard, with Control pressed, no longer
selects all text, but instead quits the application,
as the shortcut is interpreted based on the English
layout, which just happens to be first in the list.
Similar issues exist for German layouts, which use
QWERTZ, or more complex layouts such as the Neo layout.
The semantics of prioritizing the order of declared
layouts instead of the active one is inconsistent with
both macOS and Windows, as well as other toolkits on
Linux, including GTK and earlier versions of Qt.
It's also not discoverable by the user that the order
now matters. For example, there is no UX in the Gnome
setting that tells the user to ensure the order matches
their expectations for shortcut handling. And if there
was, this would only apply to Qt apps built with 6.6.0,
creating inconsistent behavior for users.
Worse, the X server is limited to four concurrent keyboard
layouts (groups), so if the user adds more layouts than
that, Gnome will replace the X server's view of layouts
only when switching to a layout beyond the first four.
And in that case, the X server's view of the layouts is
actually starting with the fifth layout declared in the
Gnome preferences. The logic in the reverted patch does
not take this into account, making it confusing for the
user which layout actually takes precedence.
Note that reverting this change does not affect our
fallback logic for layouts that do not produce Latin
symbols for the given key press, such as Greek or Russian.
Those layouts will continue to fall back to a Latin
layout for their QKeyEvent::key().
[ChangeLog][QtGui][X11/Wayland] A change in 6.6.0 that
resulted in keyboard shortcuts not respecting the user's
active layout has been reverted.
Pick-to: 6.6
Task-number: QTBUG-108761
Change-Id: Iec2897cd1541c0c125cc5b1078d0beec12b501c0
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
`QCoreApplicationPrivate::self` is set to nullptr in `~QCoreApplication`
without any synchronization. So it is not safe to access it from
instances of `QDaemonThread` that may outlive the application instance,
but are using the Qt event system. This patch moves some usages of
`self` behind other checks, so that the QtDBus management thread can
continue workoing without race conditions detected by Thread Sanitizer
while running tst_qdbusconnection.
Change-Id: Iece65e4126a59e3a1a41dfb6a99c84527b8d389c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When changing the selected index in a combo box,
also update the current index in the item view's
selection model right away, and don't delay this
until when the combobox popup gets shown in
QComboBox::showPopup.
This is needed to make sure that the selection
is properly exposed to the accessibility layer.
On the accessibility layer, QAccessibleComboBox,
the a11y implementation for the combobox, exposes
the entries in its list child
(s. QAccessibleComboBox::child) and Orca queries
the selected item when the combobox gets focus,
which didn't return the proper results earlier,
resulting in no or the wrong entry getting
announced.
Extend the existing combobox a11y tests
accordingly.
Pick-to: 6.6 6.5
Fixes: QTBUG-117644
Change-Id: Ia26de5eafd229f7686745a2fbe03fc1eb6a713f8
Reviewed-by: Liang Qi <liang.qi@qt.io>
Call QEvent::accept() when a key event has been acted on.
This prevents redundant event delivery and consumption.
Task-number: QTBUG-117644
Pick-to: 6.6 6.5
Change-Id: I069c61c14890577683894f165fd2585ba05c45ff
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Liang Qi <liang.qi@qt.io>