This bridges the newly introduced QAccessibleSelectionInterface
to AT-SPI by exposing the AT-SPI Selection interface for
objects implementing QAccessibleSelectionInterface and
implementing the methods of the AT-SPI Selection
interface.
Fixes: QTBUG-105909
Change-Id: Ia05cef6c7dad8675ba8573f662f4338d301cf0e3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
`dlopen` feature is used in qlibraryinfo.cpp without `library` feature.
Change condition that adds libdl library to make sure that we can build without `library` feature.
Pick-to: 6.4
Change-Id: I5051e6b2e0a8daae5f7e269ed8980df99ecaa192
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The problem is caused by GCC 13 having an intrinsic for is_convertible,
and that (correctly) checks for incomplete types. We then manage to
trigger the instantiation of the QAnyStringView converting constructor from isUtf16 etc.,
and that triggers the enable_if and is_convertible. The fix is to move
the Tag definition earlier, and to eagerly SFINAE away the Tag type so
that the converting constructor rejects it. Otherwise, the converting
constructor is considered a candidate for comparisons of Tags, and gets
instantiated for overload resolution.
Fixes: QTBUG-108136
Change-Id: I9b0c0f7ac771cdbf6a9c35a3d3b0ea01b88b970e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The qtUpdateDpi function is a module function, not a scope function
(regardless of it being window-scope self or QtLoader-scope self).
Therefore it should be executed with module as this.
Fixes: QTBUG-108112
Pick-to: 6.4
Change-Id: Ib4604a43dbdd0caa114d3d892ea97b5ee4c9a9a8
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
It's in the way of the planned QtCore std::span reimplementation of
the same name.
Task-number: QTBUG-108124
Change-Id: I55d9391d72644c02e4e4143f4ad2f6756404dcc7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This frees up the QSpan name for the planned QtCore std::span
reimplementation, also called QSpan.
This is binary compatible because QSpan was just a typedef and because
it's all private API.
Task-number: QTBUG-108124
Change-Id: I3b5c1ea82673934e2d1eb490fddeae3f8e6a6ea3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
saveRestoreGeometry() somtimes creates a 29px offset when debugged in
Qt Creator, which makes the test fail.
This patch adds a code comment to make developers aware of this fact.
Pick-to: 6.2 6.4
Change-Id: I920bd02eb7543faf8b25a0a242b888f3a3745e2a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Nothing in this class uses it, so there's no reason to document the
typedef. It will just confuse both the compiler and the user when we
add QSpan (a std::span implementation).
Pick-to: 6.4 6.2
Task-number: QTBUG-108124
Change-Id: Iff0249d2e12a05fca15998a046a0b1bf607b60be
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
multipleToplevelFocusCheck() occasionally failed on XCB because
QApplication::activeWindow() was nullptr immediately after
qWaitForWindowActive() returned true.
This patch replaces QCOMPARE on QGuiApplicaiton::activeWindow() with
QTRY_COMPARE in order to continue spinning the event loop until the
condition has been met. It adds QWidget::activateWindow after show()
to ensure focus is acquired also when another window has received
focus in the meanwhile.
Pick-to: 6.2 6.4
Change-Id: If84eb8b77c5a6b16af271334a1fe5eb92c05644b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This adds a new QAccessibleSelectionInterface
that implements support for handling selections,
both retrieving information about the current selection
as well as modifying the selection, thus providing
the necessary foundation for exposing selections
to assistive technology.
This is similar to AT-SPI's Selection interface [1],
but uses QAccessibleInterface pointers instead of
child indices as parameters for methods.
Bridging this newly introduced interface to AT-SPI
will be done in a follow-up change.
The concept for selection handling in Microsoft's
UI Automation looks similar, so bridging this to the
corresponding UIA interfaces ISelectionProvider [2],
ISelectionItemProvider [3] and ISelectionProvider2 [4]
should also be reasonably straightforward.
At this point, this is only meant to be used for
handling selection of direct children as is the
concept in AT-SPI's Selection and presumably
in UIA as well. (The ISelectionItemProvider and
ISelectionProvider doc speaks of "child controls
of containers" etc., but doesn't explicitly mention
that this is only for direct children or whether
grand children are also allowed.)
(The proposed API itself could
also be used to support selection of objects
that are no direct children, but the practical
use of that is unclear and it would make mapping/
bridging to platform a11y layers tricky.)
[5] demonstrates a sample implementation of the
QAccessibleSelectionInterface for the Qt-based
UI variants of LibreOffice (screencast that
shows the use of the interface attached to
QTBUG-105909).
This interface is marked \preliminary until:
1. There is a working a11y bridge for macOS/VoiceOver
2. There is a working a11y bridge for Windows/UI Automation
3. There is a working a11y bridge for linux/AT-SPI
4. There is at least one implementation (e.g. QAccessibleTable)
that implements it successfully (second candidate:
Qt Quick TableView [6])
[1] https://lazka.github.io/pgi-docs/Atspi-2.0/classes/Selection.html
[2] https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-iselectionprovider
[3] https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-iselectionitemprovider
[4] https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-iselectionprovider2
[5] https://gerrit.libreoffice.org/c/core/+/138750
[6] https://doc-snapshots.qt.io/qt6-dev/qml-qtquick-tableview.html
[ChangeLog][QtGui][QAccessibleSelectionInterface] Added new
preliminary QAccessibleSelectionInterface that can be used to expose
selections to assistive technology.
Task-number: QTBUG-105909
Change-Id: If77beacd94fa3eb663f0fbb2373f12382bab2ee3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
The test function raise() occasionally failed because of unexpected
paint events being counted.
This is due to a QTRY_VERIFY returning after consumption of the first
paint event. If more than one paint event got posted, it will be
delivered and counted when no more paint events are expected.
This patch ensures that all paint events are consumed before resetting
the count and expecting no more paint events.
Fixes: QTBUG-68175
Pick-to: 6.2 6.4
Change-Id: I3e91a34e851da4bd01c7429e824d2b9101077a06
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Which can be used by Qt Creator and Assistant.
Task-number: QTBUG-97125
Task-number: QTCREATORBUG-26557
Change-Id: I03e5ac0a15f84101c73887724693e9eb27670754
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
The color dialog implementation lazily initializes the widget hierarchy,
so that they are not created if we're using a native dialog. But unlike
QFileDialog, which does the same, QColorDialog failed to handle the case
where the native helper could not show a native dialog.
We now correctly lazy initialize the widget hierarchy if the native
show fails.
The WA_DontShowOnScreen state management has been left out, as it
needs some general refactoring. This patch doesn't fix, or regress,
any logic related to WA_DontShowOnScreen.
Task-number: QTBUG-108153
Change-Id: Icbd506617a2fe302bb61aab977e7c8ea4bd64878
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The "Show Details..." button is not plumbed in any way to the native
dialog, so when added to a native dialog it will just result in the
dialog being dismissed, instead of revealing any extra content in
the native dialog.
Both the iOS and Android native message dialog implementations add
the details text directly to the dialog, without any action to
explicitly reveal it.
Task-number: QTBUG-108153
Change-Id: I92e00c59b7836f633be44caebd534a47ac58be00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The QDialogPrivate::nativeDialogInUse member is used to track whether
a native dialog will be used down the line when the dialog is shown,
or if a native dialog is actively showing or has been shown once.
The former case applies to QFileDialog and QColorDialog, which both
set nativeDialogInUse based on the result of creating a platform
dialog helper in Q(File|Color)DialogPrivate::init(), and then use
that information to avoid creating a widget hierarchy if not needed.
The latter case applies when the native dialog is attempted to be
shown(), where failure to show the native dialog results in the
nativeDialogInUse member being set to false.
The QFontDialog and QMessageBox subclasses do not rely on the former
mechanism, and will only have nativeDialogInUse set to true if the
native dialog has been actively shown at least once.
The QPlatformDialogHelper on the other hand, tracked by the member
QDialogPrivate::m_platformHelper, does not map 1:1 to the state of
nativeDialogInUse, as in the case of QPlatformFileDialogHelper
there is also functionality in the helper to give hints to the
widget-based non-native dialog on how to behave. As a result,
we can have a valid m_platformHelper, but with nativeDialogInUse
being false.
To decouple this and simplify the code we let QFileDialog::setOption()
reset the nativeDialogInUse based on QDialog::DontUseNativeDialog,
just like QColorDialog does, and let QFileDialogPrivate::createWidgets()
proceed without having to delete the platform helper, which would
otherwise be necessary to reset nativeDialogInUse.
The only side effect of this is that a widget-based non-native
dialog will still have a QPlatformFileDialogHelper alive, but
since this dialog is not going to be shown this should not be
an issue in practice.
Task-number: QTBUG-108153
Change-Id: I96af6cfa715717c0907fe840aa86d4e5b280d54c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The uses of the click_cocoa_button() function was removed in 2012,
in ba21ca7b5b.
Change-Id: If7abfc56bb307cfbf9f6628cec9c7267a8a1f31f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The handling of a digit was done in two parts, separating the case for
the first digit from the handling of later digits. Nothing in the
else/if chain between involved digits, so the latter can move to the
front and be combined with the former.
Change-Id: I4c93515f36452721bdef472cc2f0af7ceeb00527
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Checking the value of last, instead of the index, prepares the way for
using QStringIterator here.
Change-Id: Ided0530413211e918acd406ebdb37f16006ef07d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remember last iteration's character, if only to align with
validateChars(); this replaces some calls to result->last(), that all
happen where last can't have been a grouping character, so it's OK to
let last be set to ',' as far as these points in code are concerned.
Change-Id: I24112c25e5620bb0b056aaeb78c7a2a18b09e8fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If grouping isn't allowed, return early on hitting any.
Make the elision of grouping from the converted string easier to see.
Change-Id: I452d1e2b64612cd3ce534907a4b9aac652669ba5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Checking for list separators and percent sign was a distraction; none
of the callers will allow a string including those. The QString
methods, that have to cope with bases other than ten, are all now
routed via other methods, so numberToCLocale() no longer has to care
about letters as possible digits (although 'e' remains a return from
numericToCLocale(), as exponent).
It does still need to accept the letters of inf and nan, so retain a
check for them, but simplify the processing of ascii as it only needs
to get them right. We can also return false on invalid character,
rather than breaking out of the loop and leaving other conditions to
catch the error.
Change-Id: I49f46b2f116d11a310ed3514a0f0e09a3e90c8ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Convert the checks on the number options to use it. Also group local
variables by what part of the work they're involved in.
Change-Id: I420c95ad45b2cb2a6b31c0227544e90bd0985584
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This tests that strings using the first Unicode code-point of such a
multi-character token don't get recognized as "valid" number strings.
This would catch an implementation issue if the parsing code
mistakenly matched against only the first code-point of each "single
character" token.
It also adds tests of integer formatting, with multi-character sign,
and reworks some QStringView().toString()s to use u"..."_s.
Task-number: QTBUG-107801
Change-Id: I7b868ce2955bb322b3ecfc200438a21437090a0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Based on those for QString, but with locale variation and exercising
some of the locales with multi-character signs and exponents.
Pick-to: 6.4 6.2 5.15
Change-Id: Id0253449f9abcc154285f89337aa0e26dd69900d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Based on the tests for QString::number(), but run in reverse, with
some embelishments. Also moved some shared code from number_*_data()
to their shared number_integer_common template.
Pick-to: 6.4 6.2 5.15
Change-Id: I74e7082372166c3cdbcd6bcbc31f9003e07cbcbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Glib is written in C and predates C99 (though not really, glib 2.0 was
released in 2002), so it defines gboolean as int, a 4-byte type. C++'s
bool is a 1-byte type, so this caused a buffer overflow.
Problem introduced in 2b77e779ce
("QGtk3Theme: implement appearance function to detect dark themes").
Pick-to: 6.2 6.4
Change-Id: Ieba79baf5ac34264a988fffd172650701fa54da8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Testing with 11 and 12 does not produce the warning.
Change-Id: I3d74c753055744deb8acfffd17243f3bd60e6855
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Upon programmatic window state changes, windowStateChange was fired
once in QWindow::setWindowStates and once when the visual state had
been changed by the window interface.
This patch adds if guards to ensure that the singal is fired only once.
It adds a corresponding autotest to tst_QWindow.
tst_QWidget::resizePropagation() is adapted to no longer expect double
signal emission.
Fixes: QTBUG-102478
Pick-to: 6.4 6.2
Change-Id: If093c0a883d76d8a676e4fab90db6b0676452267
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When a complex object (i.e. one with children that are themselves not
fully exposed objects) gets focus, then we need to inform the
accessibility system about which child object actually has focus. This
was only done for item views, but not for other complex widgets.
An editable QComboBoxes is the focus proxy for its line edit. The line
edit never gets focus itself (QComboBox forwards relevant events),
and is the accessible child item with index 1. So when an editable
combobox gets focus, it needs to raise the automation event for the
line edit child.
Implement QAccessibleComboBox::focusChild to return the interface to the
lineedit for editable comboboxes so that the UI Automation bridge can
correctly notify about the focus being moved to an editable text input
field.
Fixes: QTBUG-107572
Pick-to: 6.4 6.2
Change-Id: Id60e2791ec859365255baa9bfd01547979cd2b44
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Revert: e99a883bd3
Revert: 33238ea2c6
These two commits made the drawing of the cursor incomprehensible,
but their purpose was to fix the problem of abnormal cursor drawing
when QScriptAnalysis::Object is present. Because objects require
some special handling, they can be specially aligned or floated.
Anyway, the alignment is already reflected by ascent and descent,
and when drawing, y = position.y() + (sl.y + sl.base() - base).toReal();
works fine. So roll them back now.
We just need to specially consider the case where the QScriptItem is a
QScriptAnalysis::Object, keeping the base and descent the same as the row.
Task-number: QTBUG-92468
Task-number: QTBUG-86823
Task-number: QTBUG-96288
Pick-to: 6.2 6.4
Change-Id: I6d9a0e00fbc3823e0cc8e0e8bd061da5782d1f8a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
If pos < 0, the code assumes it should count from end of string, i.e.
pos += size(); if pos is still < 0, do nothing.
Change-Id: I5a90a082ec2833835ce0240d40a271f711a33f7e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is no user for these at this point: QOpenGLWidget does not
need any of these by nature, whereas QQuickWidget is also currently
in the works-as-is category, it has no need to communicate the need
for additional Vulkan device extensions for example.
Pick-to: 6.4
Task-number: QTBUG-108277
Change-Id: Idc09552027377a21a0e904fbb9bfbd95c3d0e0a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
For a11y purposes, a table needs to be mapped into a logical
accessibility hierarchy. There are several ways of doing this mapping,
and unfortunately macOS expects something different than what
QAccessibleInterface does.
So suppose we have a a 2x2 QTableView with both horizontal and vertical
header like this (the names reflect the QAccessible::Role names):
+-----------+--------------+--------------+
| | ColumnHeader | ColumnHeader |
+-----------+--------------+--------------+
| RowHeader | Cell | Cell |
+-----------+--------------+--------------+
| RowHeader | Cell | Cell |
+-----------+--------------+--------------+
In order to be presented to the screen reader on a platform, it goes
through two rounds of mapping:
QAccessibleInterface will have all headers and cells as direct children of the table:
- Table
+- ColumnHeader
+- ColumnHeader
+- RowHeader
+- Cell
+- Cell
+- RowHeader
+- Cell
+- Cell
macOS expects a deeper hierarchy:
- AXTable [QAccessible::Table]
+- AXRow [Qt:no eqiuivalent]
+- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever)
+- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever)
+- AXRow
+- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever)
+- [QAccessible::Cell] (The content of the cell, e.g. AXButton, AXGroup or whatever)
+- AXColumn (this seems to just store the geometry of the column)
+- AXColumn (this seems to just store the geometry of the column)
+- AXGroup (this represents the column headers)
+- AXSortButton (clicking a header cell will trigger sorting)
+- AXSortButton (clicking a header cell will trigger sorting)
It's unclear to me how RowHeaders are mapped (they are rarer than
ColumnHeaders, I expect to find them in e.g. spreadsheet applications).
I haven't found any native usage of them. So this patch simply ignores
them.
Notice that macOS have a three layer deep hierarchy to represent a table
(Table->Row->Cell), while QAccessibleInterface has a two-layer deep
hierarchy (Table->Row/Cell).
In the macOS bridge we therefore need to "inject" the Row/Column element
to be "between" the table and the cell.
The table will take ownership of all row and column elements that are
children of the table. These elements are not inserted into the cache
(it would be pointless, since the cache is basically just a mapping
between the QAccessibleInterface -> QMacAccessibilityElement, and the
row and column elements does not have a corresponding
QAccessibleInterface to be mapped from).
The rows and columns are therefore also created as soon as the table
element is initialized, and they are stored in two NSMutableArray
members of QMacAccessibilityElement.
A table is constructed like any other accessibility element, with a
valid axid and synthesizedRole set to nil.
Each child row and column element is constructed with the same axid as the
parent table element, and they will have the synthesizedRole set to
either NSAccessibilityRow or NSAccessibilityColumn.
With the synthesizedRole member we can then identify if we are a row,
column or the actual table, and implement their respective behaviors.
Notice that the child row/column is created with the parent's table axid
in order for them to have a way of finding their parent table element.
(there is no 'parent' member variable in QMacAccessibilityElement)
This glorious scheme isn't pretty, but seems to work.
Fixes: QTBUG-37207
Change-Id: I7c2451e629f5331b9a0ed61dc22c6e74a82cc173
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QListView::currentChanged sends an accessible focus event even if the
list view doesn't have focus. For screen readers like Orca, accessible
focus events will be ignored if the target item does not have focus
when screen reader receives the event.
This corrects the behavior by calling QAbstractItemView::currentChanged
before sending an accessible focus event.
Pick-to: 6.4
Change-Id: I71732f62e2f27d7856b4781b268495b88b24b715
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Fix the syncqt issue when two modules are created in the same
CMakeLists.txt and share the build directory. In this case the
second module in the dependency chain rewrites
'module_headers[_generated]' files, so syncqt is not able to
proccess these files correctly.
Amends b89d63515b
Task-number: QTBUG-87480
Change-Id: Ibdcb66e96bdaabadc1c51611f5ed4a637d2f797f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When comparing a glyphIndex with a hard coded number, the number is
cast to an int, whereas the glyphIndex is an unsigned int.
That causes a compiler warning.
This patch forces the numbers to be cast to an unsigned int.
Change-Id: I8a31124c6afacfc4ecfb13caf2cb8133dad44a21
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Debug serials and detatch numbers of deep and shallow detatch in test
function cacheKey, if it fails.
That implicitly removes a compiler warning about these variables being
unused.
Change-Id: I481f4b63e3ed0d50fb442dffc658b97d913059bc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
And add license headers and some minor fixes for warnings in the
example and test.
Task-number: QTBUG-90498
Change-Id: I34592f7f2844c92c25a6a676c8ac1ffca9e03c6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The usage of the helpers was removed in 2011,
in bf8dfc394a.
Change-Id: I950812982148fd76bcc65c4781a144c21cb3c901
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We do that by passing the full list of results to the logger, to a
virtual that is present in the base class to call the existing
function. For all but the plain logger, we'll just print multiple
results. The plain logger now prints:
RESULT : tst_MyClass::QString_toInt()
383 nsecs per iteration (total: 3,837,324, iterations: 10000)
1,069 CPU cycles per iteration (total: 10,692,457, iterations: 10000)
3,123 instructions per iteration (total: 31,230,101, iterations: 10000)
536 branch instructions per iteration (total: 5,360,022, iterations: 10000)
Change-Id: I3c79b7e08fa346988dfefffd17203cb5802693dd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Avoids having lots of buffers that occupy the stack.
Change-Id: I3c79b7e08fa346988dfefffd17203c5045a7fc86
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
To allow removing the MACOS && IOS ifdefs from Qt Quick. The check is
taken care of by the QRhi Metal backend instead.
The logic is now slightly more sophisticated than just outright
skipping the whole feature: we know that the problems (crash on
M1/M2, and suspicious, constant blob size increases also on Macs
with Intel graphics once upgraded to macOS 13) are triggered when
new render/compute pipelines are registered to a MTLBinaryArchive
that already loaded some data from a file serialized in a previous
run of the application. Therefore, we just skip registering new
pipelines when we believe it is not going to be safe. The rest of
the persistent pipeline cache support is left intact and operates
normally.
Task-number: QTBUG-106703
Task-number: QTBUG-108216
Change-Id: Id3cc931dfbd940a3e6820ee9294459e4993e9ca7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The WinRT NetworkStatusChanged callback may happen during or slightly
before we unregister our token, which we usually follow up by destroying
the object. So we have to avoid potentially doing work on a deallocated
object.
Do this using the old QPointer-trick. Neither me nor reporter can
reproduce it locally, so this is only a best-measure.
Further problems may be that the storage for the lambda has already
been destroyed and repurposed, in which case the pointer may be valid,
but junk, which would lead to another crash. But this is unavoidable as
long as MS does not synchronize callbacks with (un)registering new
callbacks. To attempt combatting this we hold our own lock around
unregistration and the "meat" of the callback.
Pick-to: 6.4 6.4.1
Fixes: QTBUG-108218
Change-Id: Iacf8b8f458cca3152ff395e9a38e8df193534f46
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Implementors are expected to return whether the converter can convert
both ways between a mime and a uti. However, this is implied in the
mimeForUti and utiForMime functions, and almost all converter implemented
canConvert by returning mimeForUti(uti) == mime.
A notable exception is the QMacMimeTypeName implementation, which can
only convert from from mime to uti using hard-coded special format names
and dummy data to provide place holders for drag'n'drop operations that
originate in Qt. That converter returned always false from canConvert,
but mapped the special "application/x-qt-mime-type-name" mime type to
the special "com.trolltech.qt.MimeTypeName" uti. Since nobody ever
requests data as "com.trolltech.qt.MimeTypeName", we still always ignore
that converter. The uti is then special-cased in the QMacClipboard code.
Lower-level code where only mime type or UTI are known can still call
the virtuals directly and check whether the returned string is empty,
which indicates that the converter does not support the conversion.
As a drive-by, fix coding style and variable naming.
Change-Id: I3d5d60faa82f8b31d9873c9da0097a308b9eeb50
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
During construction of a QStyle, QApplication might not yet be
initialized, e.g. when calling QApplication::setStyle("macOS") before
constructing QApplication. In that case, we cannot access the platform
theme.
We don't just want to skip initializing the small font either though.
Store the smallSystemFont as a std::optional so that we can initialize
it once, when the first widget gets polished.
As a drive-by, remove the unused miniSystemFont variable.
Fixes: QTBUG-108047
Pick-to: 6.4 6.2
Change-Id: Id750770a563611fdbc6c7031fe102a99ea692be7
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>