Commit Graph

57897 Commits

Author SHA1 Message Date
Mårten Nordheim
a901afcd79 QDateTime: work around bitfield bug on msvc x86
Somehow, when mixing types in a bitfield, MSVC will use a lot
more space than expected. So ShortData ended up being 16 bytes
causing various static_asserts to trigger.

Pick-to: 6.2 6.3 6.4
Change-Id: Ia0032e71621772db27e2917d9c71598046730107
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-30 21:46:13 +02:00
Sona Kurazyan
0f2079efb8 Extract header qdarwinhelpers.h from qglobal.h
Task-number: QTBUG-99313
Change-Id: Ia25270d381de99c5fcbb205d750e7bf86d4438dc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-30 20:56:46 +02:00
Sona Kurazyan
9ecc119276 Move QT_ASCII_CAST_WARN macro from qglobal.h to qtdeprecationmarkers.h
Task-number: QTBUG-99313
Change-Id: I6449f519db3f67ed3d390295b8fa93eff28d7cda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-30 20:56:46 +02:00
Thiago Macieira
db64694b4c tst_qlibrary.cpp: remove extraneous _data function
The test function itself is MIA.

Change-Id: Ie4bb662dcb274440ab8bfffd170a06fde5c1cd51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-30 15:56:46 -03:00
Thiago Macieira
98e21f0979 QVariant: fix conversions of string keys to Q_ENUM that are QFlags<>
Since Qt 6.0, QMetaType stores the name obtained from the C++ compiler,
which means we know a type like Qt::Alignment by its proper, full name
of QFlags<Qt::AlignmentFlag>. However, the meta object records only the
bare name of the enumeration, not the full flags.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105932
Fixes: QTBUG-96185
Change-Id: Ic6547f8247454b47baa8fffd170eab977e306377
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 18:56:46 +00:00
Thiago Macieira
845697bf11 findclasslist.pl: add a way to mark lines to be ignored
In case they get erroneously extracted. For example, in Core5Compat,
QTextCodec appears in the _p.h as a full class if !QT_CONFIG(textcodec)
(I don't know what that is for, but it's there).

Pick-to: 6.4
Change-Id: Ic6547f8247454b47baa8fffd170eb1d0f7e6d0f9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-30 15:56:46 -03:00
Sona Kurazyan
9afe954783 Move definition of QT_DEBUG from qglobal.h to qtconfigmacros.h
Task-number: QTBUG-99313
Change-Id: I0bb9bcabbfff5b6d97a6473dbbcd47eb46d1fd3d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-30 20:36:14 +02:00
Sona Kurazyan
5c01cbfe76 Remove Q_DUMMY_COMPARISON_OPERATOR
It's not needed for any of our supported compilers and isn't used in
Qt codbase anymore. It was only required for IBM xlC compiler, which
doesn't seem to support C++17 at the moment (when it does, hopefully
they will also fix the issue).

[ChangeLog][QtGlobal] Removed the Q_DUMMY_COMPARISON_OPERATOR macro,
which was needed to workaround outdated template instantiation rules
on some outdated compilers.

Fixes: QTBUG-105098
Change-Id: I2b992dd8c0f389d874d2a8521fc1a1aad3f80699
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 20:36:14 +02:00
Axel Spoerl
223fdc7d52 Make QKdeTheme aware of runtime theme changes
When the KDE theme gets changed programatically or by the user in KDE
settings, Qt applications were not notified during run time.
The KDE theme was read during startup only, when the QApplication's
palette was constructed.

This patch implements a DBus connection to the SettingChanged signal.
QKdeTheme is notified about KDE theme changes, which trigger an
application palette reconstruction and all subsequent QEvents.
The implementation reacts to changes the in KDE settings "widgetStyle"
and "ColorTheme". The application palette is updated only if the
underlying settings change results in a palette modification.

Fixes: QTBUG-103093
Pick-to: 6.4 6.3 6.2
Change-Id: If0ec0f0ba515ef3dcf9924283d3a818ac7d24a7b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-30 20:36:14 +02:00
Alexandru Croitor
51f8eaa328 CMake: Move Apple specific functions into a separate file
Pick-to: 6.4
Task-number: QTBUG-95838
Change-Id: Ib0ce53fe0e2068482b654921ecba3232efe656c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-30 20:36:13 +02:00
Alexandru Croitor
b0fef2849b CMake: Clarify documentation for target and project finalization
Amends 944c424ff6
Amends 63f79d7ffb

Pick-to: 6.3 6.4
Change-Id: Ic8f3376f49b7aaeaa4bf307aa401c54d48cd5c4d
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-08-30 20:36:13 +02:00
Timur Pocheptsov
9540a4eb90 QHttp2Configuration: in QNAM, use old, higher values in flow control
Initially, stream receive window's size was quite significant.
At some point when dealing with a server that did not want
our windows' sizes and was closing the connection (they only
accept 64K) we reduced this size, which ended in a regression
with download speed significantly throttled. We return the old
values (or even more, presuming we have 10 multiplexed streams
and not 100). And also making QNAM consistent with its documentation
(it was not updated).

[ChangeLog][QtNetwork] Stream receive window that HTTP/2 protocol in QNAM is using
increased to 214748364 octets (from the previous 64K) not to throttle download
speed. Clients, working with servers, not accepting such parameters,
must set HTTP/2 configuration on their requests accordingly.

Fixes: QTBUG-105043
Pick-to: 6.4 6.3 6.2
Change-Id: I252b6b5eefe92a7304dad15c67928d5a57d9597f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-30 20:20:38 +02:00
Alexandru Croitor
fbcf910831 CMake: Add documentation for QT_NO_COLLECT_BUILD_TREE_APK_DEPS
Amends 63f79d7ffb

Pick-to: 6.3 6.4
Change-Id: I0d2fb6377653d88f4899b990d9c073df86047b61
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-08-30 20:20:38 +02:00
Nicholas Bennett
b25b8ba1a9 Docs: Improve documentation regarding adding SSL support
Added link to Adding Open SSL support to Android Applications

Users are having difficulty finding this information, so adding a link
to the networking module's SSL Classes page.

Clarified the section title for adding SSL when building Qt from source.

Pick-to: 6.3 6.4
Change-Id: I88fbf696583d75c76d3b9778dbacd058eb00b50d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-08-30 13:46:01 +00:00
Konrad Kujawa
da12a40b8b Migrate QBasicTimer from int to qint64
QBasicTimer::start() now accepts qint64 instead of int.

Change-Id: Iba3f394b6c20daf762f1add5a9eed22c8a67c802
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-30 15:46:01 +02:00
Aleksandr Reviakin
89a703dcb8 wasm: add local-fonts API support
Add support for accessing local fonts via local-fonts API.
Local fonts API is available in Chrome 103 and above.

Fixes: QTBUG-81736
Change-Id: Iac47b3a30c7a22933cbdbfc97ce0791edb63b5bd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-30 15:46:01 +02:00
Morten Sørvig
be44827240 wasm: add support for building Qt as shared libraries
This implements the build system bits required to build Qt
as as separate wasm modules a.k.a Emscripten side modules.

Enable by configuring with the "-shared" flag.

This is the first step towards shared library support and gets
us as far as being able to load QtCore and instantiate a
QCoreApplication.

Task-number: QTBUG-63925
Change-Id: Ib8f07f80fb5b13c8dbba65c7db735dc557b70d0e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-30 22:11:01 +10:00
Mike Trahearn
20242a2549 Fix the spelling of the word "combination"
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ib6ad11d4fbbeefa280070125fd0ee6a64dababae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-30 05:06:52 +00:00
Lorn Potter
83b7598896 wasm: update emsdk to 3.1.14
This fixes some threading bugs

Pick-to: 6.4
Change-Id: I1a96dcc54d8338de09b551d52a166d073e85d752
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-30 11:22:56 +10:00
Doris Verria
56e2e89955 Add nullptr check for theme when initializing palette
Pick-to: 6.2 6.3 6.4
Change-Id: Iaac2c92f5f7e7fd5c25d6ecde058d4dc01c62aa1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-30 03:00:04 +02:00
Joerg Bornemann
39cea8900b Doc: Fix faulty include file extension
Two qdoc files included a .cmake file that contained qdoc markup.  After
.cmake files got license headers, the license header showed up in the
flow content of the documentation.

Rename the .cmake file to .qdocinc and adjust the license header to be
in line with the rest of the documentation.

This amends commit 87bcb9ca6ec883afb86165a282557014c9f06e41.

Change-Id: Ie9b02c75b67791c60cc8e054b52a15ffa9cf3e32
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-30 00:41:40 +02:00
Thiago Macieira
5ff637cc14 QMetaType/Doc: update some wording about type registration
Type registration isn't necessary any more, unless you're trying to look
up a name back to ID or QMetaType object. It hasn't been since 6.0.

Drive-by update the example not to use deprecated API.

Drive-by remove the paragraph about requirements that aren't accurate
any more.

Pick-to: 6.4
Task-number: QTBUG-104858
Change-Id: Ic6547f8247454b47baa8fffd170eecb66719fa65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 14:15:36 -03:00
Tor Arne Vestbø
30489eb661 Bump macOS and iOS deployment targets to 10.15 and 14 respectively
Change-Id: I1ffaa77f3a4194d2ab02729ff525e5f831e3b7a8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-29 18:55:24 +02:00
Mikolaj Boc
ecbbb75585 Relay the batched test name to ctest commandline on all platforms
Extend the support of pointing at the right test from batch from WASM
to all supported platforms.

Change-Id: I9b6342ed0954f0fdc2f08c76f6b3f24f44f0388a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-29 18:55:24 +02:00
Edward Welbourne
c88d2b0fcd Copy or check ShortData rather than pointer in more places
This follows-up on commit 4d24fcd3e1 -
when ShortData is bigger than a pointer (on 32-bit systems, when using
64-bit ShortData), copying d isn't sufficient; data must be copied.
Likewise, comparing d to check for equality is insufficient when
isShort(), as the other may also be short and differ in the more
significant bytes.

Change-Id: I49c0cf33727b8b43436cf0e3f57f602e83226885
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-29 18:55:23 +02:00
Tor Arne Vestbø
1bc7e9e77b Add QComHelper class for dealing with COM on Windows
Unifies our approach to calling CoInitializeEx and CoUninitialize,
removing a lot of boilerplate in the process, and also fixes a few
bugs where we would incorrectly balance our calls to CoInitializeEx
and CoUninitialize.

The optimistic approach of qfilesystemengine_win.cpp of calling
CoCreateInstance without initializing the COM library explicitly
has been removed, as calling CoInitializeEx should be a noop in
the situation where it's already been loaded.

Change-Id: I9e2ec101678c2ebb9946504b5e8034e58f1bb56a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-08-29 15:39:34 +02:00
Yuhang Zhao
49f9cadb52 MSVC: Add WIN32 definition to the resource compiler
The resource compiler may not use the same parameters as we passed
to CL, and if so, there won't be any definition for WIN32, this will
cause some header files think we are not building for Windows. To
eliminate this uncertainty, we just pass "/DWIN32" to the resource
compiler to let it have this definition unconditionally. It won't
hurt in any case anyway. And this parameter is also hard-coded in
vcpkg's Windows toolchain by default, so it should be safe.

Change-Id: I45c42c40de8f4ab75fee219832f84d22b653af31
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-08-29 19:23:19 +08:00
Yuhang Zhao
22662d7dba QLibraryInfo: Add isSharedBuild() function and deprecate qSharedBuild()
Now that there's QLibraryInfo::isDebugBuild(), it's better to also
have QLibraryInfo::isSharedBuild() at the same time. It's also a
very useful information about the current Qt build.
I think debug/release and static/shared are the most important
properties of a library, so it's better to have them both.

Deprecate the global function qSharedBuild() in favor of the newly
introduced QLibraryInfo::isSharedBuild().

As a drive-by, add the nodiscard attribute to both functions.

[ChangeLog][QtCore] Added QLibraryInfo::isSharedBuild() and deprecated
qSharedBuild().

Change-Id: I48fa0dc5eeca97e709d5267733fa70aae244174f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-29 19:23:19 +08:00
Jens Trillmann
56c4d183ec Android A11Y: Fix TalkBack scrolling behavior
* Add CollectionInfo to scrollable nodes.
  Every scrollable node will get a CollectionInfo attached to signal
  the number of (possibly invisible) children.
  This is necessary as TalkBack on Android doesn't scroll to items not
  visible on screen if the number of further child nodes is not
  communicated to TalkBack.
* Return success of scroll to TalkBack.
  TalkBack needs the result of the scroll to decide if it should leave
  the current element or stay after a scroll was successful.
  Success of a scroll action is measured as the successful movement
  of the children of the scrolled element. This is a workaround for
  the Qt Accessibility API not returning the success of failure of a
  performed action.

Task-number: QTBUG-103499
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ie2c51d0b77fb5030973a0f93c42e0db3082be45e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-08-29 12:31:23 +02:00
Jens Trillmann
3c70919883 Android A11Y: Notify android about scroll events
QtQuick Flickable has an issue that after a scroll the previously
hidden items are not added to the A11Y hierarchy. That happens because
Android has no ways to detect that something has changed.

This patch uses the ScrollingEnd event to notify Android A11Y backend
that the Flickable was scrolled, so that it could update the A11Y
hierarchy and add the previously hidden nodes.

The ScrollingEnd event generation is added to QQuickFlickable in a
separate commit.

Task-number: QTBUG-103513
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ie6cd688d56343bcfe7ce9580c0b9244dd6d6c068
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Samuel Mira <samuel.mira@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-08-29 12:26:43 +02:00
Sona Kurazyan
f5be5c6b14 Move qSharedBuild() from qglobal.h to qlibraryinfo.h
[ChangeLog][Potentially Source-Incompatible Changes] qSharedBuild() is
moved from qglobal.h to qlibraryinfo.h, '#include <QtCore/QLibraryInfo>'
needs to be added where it's used.

Task-number: QTBUG-99313
Change-Id: Ic64561a8eb129ba2934e2770ca02119de208a2a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
2022-08-29 11:02:05 +08:00
Mårten Nordheim
52162eebe5 QList: don't detach twice in operator[]
We first detached in operator[] itself, then in the data()
call.

Change-Id: I18b8b282b3b879125db350e0127953f83f773619
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-08-28 18:49:52 +02:00
Thiago Macieira
f039147165 tst_QMap: avoid tripping MSVC debug-mode iterator assertions
It does a check to ensure you aren't comparing outside the container.

Fixes: QTBUG-106001
Pick-to: 6.2 6.3 6.4
Change-Id: Ic6547f8247454b47baa8fffd170eef346b7f4f24
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-08-28 11:04:14 -03:00
Mikolaj Boc
dfc82f7917 Remove an unused variable in qwasmwindow
isMinimized in QWasmWindow::getTitleBarControlRect is unused. Remove it.

Change-Id: Iee0a351d4d20d5436fe45a18543d0811b8443459
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-28 12:32:39 +02:00
Tor Arne Vestbø
2436e259ce Deprecate QApplication::setActiveWindow() and mark as internal
The function is used the internal window activation machinery and
should not be called by user code.

Many tests still use this function, and should be ported over to
QWidget::activateWindow(). For now they are using the private
helper in QApplicationPrivate, so that we can progress with the
public API deprecation.

Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-27 20:22:29 +02:00
Volker Hilsheimer
accc833e55 QComboBox: Prevent recursion in hidePopup
With styles that want the selected combobox item to flash, QComboBox
runs a modal event loop in hidePopup. This might result in reentrancy if
a mouseReleaseEvent is processed during the 60 ms of flashing.
Since mouseReleaseEvent calls hidePopup again, we end up reentrancy and
possibly undefined behavior which has caused crashes with Qt Creator on
macOS.

Prevent the reentrancy of hidePopup using a boolean flag. Since
QBoolBlocker (or QScopedValueRollback) cannot be used with a bit flag,
use a QScopeGuard to reset the flag reliably.

Fixes: QTBUG-105951
Change-Id: Iaa5df47b93217fc8dff621764ac4005bbc3459b7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
(cherry picked from commit 2af64c4577e42fecfeab9611c15fa8526bb09988)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-08-27 15:51:28 +00:00
Yuhang Zhao
50bb5f8282 MSVC: Set default code page to UTF-8 for resource compiler
Add "/c65001" to explicitly set the code page to UTF-8 for
the resource compiler, otherwise the resource compiler may
pick up the local code page instead.

Already tested locally, most Qt repos build without any problem,
only very little repos are untested due to my local environment
can't build them.

Change-Id: I7e20f936d6af1fbb90b5c20980190b727c9021de
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-08-27 16:17:51 +08:00
Michael Weghorn
0c0eadc484 a11y: Prevent one case of losing a11y interface when setting event child
9a369a25dd added a
QAccessibleEvent ctor that takes a QAccessibleInterface*
instead of a QObject*.

Retrieving the QAccessibleInterface* later is done using the
interface's unique ID stored in the m_uniqueId member.

However, the fact that m_uniqueId is a member
of the union alongside with m_child means that setting
a child via QAccessibleEvent::setChild also overwrites
the stored unique ID, which breaks retrieving the accessible
interface later.

Fix this for the case where the QAccessibleInterface has
an associated QObject by assigning m_object in the ctor as well.
This means that a QAccessibleEvent created using either of the two
constructors (the one taking the QObject* and the one taking
the QAccessibleInterface* associated with the object) now behaves
the same.

Fixing the case where there is no associated QObject would require
further changes (e.g. adding a member for the QAccessibleInterface*
or making the m_uniqueId member a separate member instead of having
it in a union with m_child). However, I see no way to do so without
breaking the ABI, so that is left unchanged.

This also adds a corresponding test case.

Fixes: QTBUG-105988
Pick-to: 6.4
Change-Id: I71a548af0277a5034e9e207f066fa3e25c5393f3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 03:38:16 +00:00
Michael Weghorn
063344c8b9 a11y atspi: Send SelectionChanged AT-SPI event on selection change
When using QAccessibleEvents of types QAccessible::Selection,
QAccessible::SelectionAdd and QAccessible::SelectionRemove,
Qt (internally) also always uses QAccessbibleEvent::setChild to
set the child that has been (un)selected.
As a consequence, the interface retrieved using
QAccessibleEvent::accessibleInterface here is not the
a11y object in which the selection has changed, but
the child, so notifying about a change to its selected
state (as happens here in the AT-SPI adapter) is in line
with that.

For AT-SPI, assistive technology (like the Orca screen reader)
often reacts to the SelectionChanged event on the object
managing the selection, so send a corresponding event
for the parent of the (un)selected child as well.

(Besides the lack of support for the AT-SPI Selection
interface - s. QTBUG-105909 - the fact that this event
wasn't sent previously e.g. turned out to be one reason
for the Orca screen reader not announcing selected cells in
the Qt 6 based UI variant of LibreOffice Calc.)

Change-Id: Icc8b9a7ecc77bc5394fd1ab4f8163caed951ba86
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 05:38:02 +02:00
Michael Weghorn
2910a6b308 a11y atspi: Forward SelectionWithin change to AT-SPI
QAccessible::SelectionWithin is meant to be used
when several changes to a selection have occurred
(instead of using multiple QAccessible::SelectionAdd
and QAccessible::SelectionRemoved events).

So far, that event was simply ignored by the AT-SPI
adapter.

Forward that as a SelectionChanged event to AT-SPI.

Change-Id: Ia8187f82b9b96b7ca5b52bf0a0923bbf4c777ad1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 05:37:55 +02:00
Lorn Potter
d3be345a36 wasm: use uintptr_t for uint32_t
This helps get ready for wasm64

Change-Id: I6db5b93c7ca851cab7fc95701b27a20263c8c0bd
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-27 10:41:05 +10:00
Ilya Fedin
f832c707ca QGtk3Theme: subscribe to theme hint changes
Pick-to: 6.4
Change-Id: I67a9a0d06e88384c0bb6f5008609bcfbf504705f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 04:41:04 +04:00
Michael Weghorn
e81e7c3d99 a11y atspi: Drop FIXME that doesn't need action
The reply *is* needed.

Otherwise, e.g. running
examples/widgets/widgets/spinboxes/spinboxes
and clicking on the a11y objects for the spinboxes
in Accerciser's [1] treeview of the app's a11y
hierarchy makes Accerciser output this and crash:

> $ accerciser
> dbus[67434]: arguments to dbus_message_unref() were incorrect, assertion "message != NULL" failed in file ../../../dbus/dbus-message.c line 1727.
> This is normally a bug in some application using the D-Bus library.
>
>   D-Bus not built with -rdynamic so unable to print a backtrace
> Aborted (core dumped)

[1] https://gitlab.gnome.org/GNOME/accerciser

diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp
index cdc27132c9..6b8a9fcaac 100644

Change-Id: I442d3130623ccae096a6b79577874a6fd95c8aa2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 02:07:55 +02:00
Michael Weghorn
e5dca1ebe3 a11y atspi: Drop methods that are only declared
... but not actually defined or used
anywhere.

Change-Id: I8d6b9f58e7ec6bb795f10cf058c3f043995cefbd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 02:07:55 +02:00
Michael Weghorn
9ab11c726e a11y atspi: Support text interface's GetStringAtOffset
The GetStringAtOffset method was added to the
AT-SPI Text interface in at-spi2-core commmit [1]:

    commit 56220f05bc8b7683911658e1a8aff4a1ab3cab8d
    Author: Mike Gorse <mgorse@suse.com>
    Date:   Mon Aug 19 16:43:02 2013 -0500

        Add atspi_text_get_string_at_offset

As compared to GetTextAtOffset, which is very similar and
already supported in Qt's AT-SPI adapter, the new method
uses a new enum, AtspiTextGranularity, to specify the region
of text that should be returned.

Other than AtspiTextBoundaryType (that is used by
GetTextAtOffset), AtspiTextGranularity now also has
a value for the paragraph granularity
(ATSPI_TEXT_GRANULARITY_PARAGRAPH).

While AtspiTextBoundaryType has two enum values for the
word/sentence/line boundaries (ATSPI_TEXT_BOUNDARY_WORD_START and
ATSPI_TEXT_BOUNDARY_WORD_END, etc.), AtspiTextGranularity
doesn't have this any more, but ATSPI_TEXT_GRANULARITY_WORD
etc. seem to correspond to what the variants ending on "_START"
do when used with GetTextAtOffset, since the documentation says that
the range is "defined by the boundaries of a word
starting at the beginning of the current word and finishing
at the beginning of the following one, if present." (and likewise
for ATSPI_TEXT_GRANULARITY_SENTENCE, ATSPI_TEXT_GRANULARITY_LINE,
ATSPI_TEXT_GRANULARITY_PARAGRAPH).

In order to support GetStringAtOffset, this
adds a new mapping from the AtspiTextGranularity enum values
to the corresponding QAccessible::TextBoundaryType, similar
to what's done for the AtspiTextBoundaryType in the
handling of the GetTextAtOffset method.

The existing AtSpiAdaptor::qAccessibleBoundaryType
method is renamed to
AtSpiAdaptor::qAccessibleBoundaryTypeFromAtspiBoundaryType
to clearer distinguish it from the newly introduced
AtSpiAdaptor::qAccessibleBoundaryTypeFromAtspiTextGranularity.

No similar new alternatives have been added
to AT-SPI for GetTextBeforeOffset and GetTextAfterOffset.

[1] 56220f05bc

Fixes: QTBUG-105811
Change-Id: I674a760e80c349baea89dcb4ac7aecdef9b2b45f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 02:07:54 +02:00
Michael Weghorn
45121669f5 a11y atspi: Handle AT-SPI Text's ScrollSubstringTo
This implements handling for the ScrollSubstringTo
method from the AT-SPI Text interface by calling
QAccessibleTextInterface::scrollToSubstring with
the given text offsets.

While the AT-SPI method has an additional parameter
for the scroll type that specifies where on screen
to place the given substring (s. doc at [1]), there
is no equivalent in
QAccessibleTextInterface::scrollToSubstring,
so ignore that parameter.

[1] https://lazka.github.io/pgi-docs/Atspi-2.0/classes/Text.html#Atspi.Text.scroll_substring_to

Fixes: QTBUG-105854
Change-Id: I390e1316c5c55cb646a299499a5f87c9c6945a44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 02:07:54 +02:00
Ivan Solovev
88974b0a3e tst_qscopedpointer: port away from deprecated APIs
The QScopedPointer::take() call in comparison() test was used to
avoid a double-deletion error, because the test is creating two
QScopedPointer instances referencing the same memory.

Avoid the take() call by providing a custom DummyDeleter and
managing the memory by the extarnal std::unique_ptr.

As the test now has no test-cases for QScopedPointer::take()
calls, create a new test for this deprecated API, and guard
it with QT_DEPRECATED_SINCE checks.

Task-number: QTBUG-104858
Change-Id: Iecc28d44d76c9ce5835e6b1a1df7db30e2a9ca25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-27 02:07:54 +02:00
Ivan Solovev
378e2e1064 tst_qmap: port away from deprecated APIs
The most common changes are:
* removing the explicit tests for deprecated APIs
* QMultiMap::insertMulti() -> QMultiMap::insert()
* QMultiMap::insert(QMultiMap) -> QMultiMap::unite(QMultiMap)

Add separate tests for the deprecated APIs, and guard them
with QT_DEPRECATED_SINCE() checks.

Task-number: QTBUG-104858
Change-Id: Ifb79212d07f20028d93d75f2b32ec3785cc93b22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-27 02:07:54 +02:00
Ivan Solovev
aafd2c3fba tst_qstring: port away from deprecated APIs
* QVariant::Type -> QMetaType::Type.
* Guard the test for deprecated fromUtf16(const ushort *) overload with
  QT_DEPRECATED_SINCE check.
* Use fromUtf16(const char16_t *) overload in other places.

As a drive-by: fix formatting in the affected lines.

Task-number: QTBUG-104858
Change-Id: I9fa3a935bca36e97f934f673e2fc07b451c72872
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-27 02:07:54 +02:00
Mikolaj Boc
f35e5a44b0 Implement mouse capture on WASM
This fixes dock widget undocking - previously, without the capture, any
widget that the mouse accidentally entered would get the event,
resulting in re-docking problems, cursor issues etc.

Fixes: QTBUG-105621
Pick-to: 6.4
Change-Id: Ia1f2c91578018f2ae9df903bc0730200ede17d32
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-27 00:10:34 +02:00