Skip to content

Commit

Permalink
Merge branch '6.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
hmartinez82 committed Nov 3, 2024
2 parents 58f6ea9 + bee83b7 commit eeaed80
Showing 1 changed file with 72 additions and 43 deletions.
115 changes: 72 additions & 43 deletions Patches/qt-ui-automation-id-qtbase.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/qtbase/src/gui/accessible/qaccessible.h b/qtbase/src/gui/accessible/qaccessible.h
index 521cfb855b..0f5a8ad128 100644
--- a/qtbase/src/gui/accessible/qaccessible.h
+++ b/qtbase/src/gui/accessible/qaccessible.h
@@ -138,14 +138,15 @@ public:
diff --git a/qtbase/src/gui/accessible/qaccessible_base.h b/qtbase/src/gui/accessible/qaccessible_base.h
index ac50c2626e..ea8b86bfe9 100644
--- a/qtbase/src/gui/accessible/qaccessible_base.h
+++ b/qtbase/src/gui/accessible/qaccessible_base.h
@@ -97,14 +97,15 @@ public:
NameChanged = 0x800C,
DescriptionChanged = 0x800D,
ValueChanged = 0x800E,
Expand All @@ -18,7 +18,7 @@ index 521cfb855b..0f5a8ad128 100644

// 64 bit enums seem hard on some platforms (windows...)
// which makes using a bit field a sensible alternative
@@ -360,14 +361,15 @@ public:
@@ -319,14 +320,15 @@ public:
enum Text {
Name = 0,
Description,
Expand All @@ -35,10 +35,10 @@ index 521cfb855b..0f5a8ad128 100644
Labelled = 0x00000002,
Controller = 0x00000004,
diff --git a/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp b/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
index 0903f5a618..fe99d01240 100644
index 001cb8505b..212bd0e202 100644
--- a/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
+++ b/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
@@ -166,14 +166,17 @@ void QWindowsUiaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event
@@ -137,14 +137,17 @@ void QWindowsUiaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event
break;
case QAccessible::ValueChanged:
QWindowsUiaMainProvider::notifyValueChange(static_cast<QAccessibleValueChangeEvent *>(event));
Expand All @@ -57,13 +57,13 @@ index 0903f5a618..fe99d01240 100644
case QAccessible::TextInserted:
case QAccessible::TextRemoved:
diff --git a/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
index 171a3c268b..77e96b8d60 100644
index cd92cd18a0..e93d73c21d 100644
--- a/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
+++ b/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
@@ -220,14 +220,27 @@ void QWindowsUiaMainProvider::notifyNameChange(QAccessibleEvent *event)
setVariantString(accessible->text(QAccessible::Name), &newVal);
QWindowsUiaWrapper::instance()->raiseAutomationPropertyChangedEvent(provider, UIA_NamePropertyId, oldVal, newVal);
::SysFreeString(newVal.bstrVal);
@@ -169,14 +169,27 @@ void QWindowsUiaMainProvider::notifyNameChange(QAccessibleEvent *event)
QWindowsUiaWrapper::instance()->raiseAutomationPropertyChangedEvent(provider, UIA_NamePropertyId, oldVal, newVal);
::SysFreeString(newVal.bstrVal);
}
}
}
}
Expand All @@ -88,28 +88,41 @@ index 171a3c268b..77e96b8d60 100644
QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_SelectionItem_ElementSelectedEventId);
}
}
@@ -416,15 +429,15 @@ HRESULT QWindowsUiaMainProvider::GetPropertyValue(PROPERTYID idProp, VARIANT *pR
break;
case UIA_AccessKeyPropertyId:
// Accelerator key.
setVariantString(accessible->text(QAccessible::Accelerator), pRetVal);
break;
case UIA_AutomationIdPropertyId:
// Automation ID, which can be used by tools to select a specific control in the UI.
- setVariantString(automationIdForAccessible(accessible), pRetVal);
+ setVariantString(accessible->text(QAccessible::AutomationId), pRetVal);
break;
case UIA_ClassNamePropertyId:
// Class name.
if (QObject *o = accessible->object()) {
QString className = QLatin1String(o->metaObject()->className());
setVariantString(className, pRetVal);
}
@@ -467,28 +480,15 @@ HRESULT QWindowsUiaMainProvider::GetPropertyValue(PROPERTYID idProp, VARIANT *pR
}
return S_OK;
}

// Generates an ID based on the name of the controls and their parents.
QString QWindowsUiaMainProvider::automationIdForAccessible(const QAccessibleInterface *accessible)
{
- QString result;
- if (accessible) {
- QObject *obj = accessible->object();
- while (obj) {
- QString name = obj->objectName();
- if (name.isEmpty())
- return result;
- if (!result.isEmpty())
- result.prepend(u'.');
- result.prepend(name);
- obj = obj->parent();
- }
- }
- return result;
+ return accessible->text(QAccessible::AutomationId);
}

HRESULT QWindowsUiaMainProvider::get_HostRawElementProvider(IRawElementProviderSimple **pRetVal)
{
qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;

if (!pRetVal)
diff --git a/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h b/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
index f7320388f7..e3de692172 100644
index 5659a28e35..a912368ca0 100644
--- a/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
+++ b/qtbase/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
@@ -65,14 +65,15 @@ public:
@@ -29,14 +29,15 @@ public:
static QWindowsUiaMainProvider *providerForAccessible(QAccessibleInterface *accessible);
explicit QWindowsUiaMainProvider(QAccessibleInterface *a, int initialRefCount = 1);
virtual ~QWindowsUiaMainProvider();
Expand All @@ -126,10 +139,10 @@ index f7320388f7..e3de692172 100644
ULONG STDMETHODCALLTYPE AddRef() override;
ULONG STDMETHODCALLTYPE Release() override;
diff --git a/qtbase/src/widgets/accessible/qaccessiblewidget.cpp b/qtbase/src/widgets/accessible/qaccessiblewidget.cpp
index ae545a5ce2..57d4962f46 100644
index b0bb12ea86..bbac328e76 100644
--- a/qtbase/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/qtbase/src/widgets/accessible/qaccessiblewidget.cpp
@@ -438,14 +438,16 @@ QString QAccessibleWidget::text(QAccessible::Text t) const
@@ -389,14 +389,16 @@ QString QAccessibleWidget::text(QAccessible::Text t) const
#endif
break;
case QAccessible::Accelerator:
Expand All @@ -147,10 +160,10 @@ index ae545a5ce2..57d4962f46 100644

/*! \reimp */
diff --git a/qtbase/src/widgets/kernel/qwidget.cpp b/qtbase/src/widgets/kernel/qwidget.cpp
index cfc3f6a7d5..93caf2d5f1 100644
index 83e072a941..01a9f86ab6 100644
--- a/qtbase/src/widgets/kernel/qwidget.cpp
+++ b/qtbase/src/widgets/kernel/qwidget.cpp
@@ -11449,14 +11449,28 @@ void QWidget::setAccessibleDescription(const QString &description)
@@ -11723,14 +11723,28 @@ void QWidget::setAccessibleDescription(const QString &description)
}

QString QWidget::accessibleDescription() const
Expand All @@ -172,21 +185,37 @@ index cfc3f6a7d5..93caf2d5f1 100644
+ Q_D(const QWidget);
+ return d->automationId;
+}
#endif // QT_NO_ACCESSIBILITY
#endif // QT_CONFIG(accessibility)

#ifndef QT_NO_SHORTCUT
/*!
Adds a shortcut to Qt's shortcut system that watches for the given
\a key sequence in the given \a context. If the \a context is
Qt::ApplicationShortcut, the shortcut applies to the application as a
diff --git a/qtbase/src/widgets/kernel/qwidget.h b/qtbase/src/widgets/kernel/qwidget.h
index c1c679c026..e7893ba3e7 100644
index d2b20c6e6a..787be4e7c9 100644
--- a/qtbase/src/widgets/kernel/qwidget.h
+++ b/qtbase/src/widgets/kernel/qwidget.h
@@ -410,14 +410,16 @@ public:
@@ -162,14 +162,15 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice
#endif
#if QT_CONFIG(whatsthis)
Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis)
#endif
#if QT_CONFIG(accessibility)
Q_PROPERTY(QString accessibleName READ accessibleName WRITE setAccessibleName)
Q_PROPERTY(QString accessibleDescription READ accessibleDescription WRITE setAccessibleDescription)
+ Q_PROPERTY(QString automationId READ automationId WRITE setAutomationId)
#endif
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection RESET unsetLayoutDirection)
QDOC_PROPERTY(Qt::WindowFlags windowFlags READ windowFlags WRITE setWindowFlags)
Q_PROPERTY(bool autoFillBackground READ autoFillBackground WRITE setAutoFillBackground)
#ifndef QT_NO_STYLE_STYLESHEET
Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
#endif
@@ -402,14 +403,16 @@ public:
QString whatsThis() const;
#endif
#ifndef QT_NO_ACCESSIBILITY
#if QT_CONFIG(accessibility)
QString accessibleName() const;
void setAccessibleName(const QString &name);
QString accessibleDescription() const;
Expand All @@ -201,15 +230,15 @@ index c1c679c026..e7893ba3e7 100644

void setLocale(const QLocale &locale);
diff --git a/qtbase/src/widgets/kernel/qwidget_p.h b/qtbase/src/widgets/kernel/qwidget_p.h
index f79acb0912..9c05098eb1 100644
index cf0618bca6..8ed431ee7c 100644
--- a/qtbase/src/widgets/kernel/qwidget_p.h
+++ b/qtbase/src/widgets/kernel/qwidget_p.h
@@ -708,14 +708,15 @@ public:
@@ -670,14 +670,15 @@ public:
#endif
#if QT_CONFIG(whatsthis)
QString whatsThis;
#endif
#ifndef QT_NO_ACCESSIBILITY
#if QT_CONFIG(accessibility)
QString accessibleName;
QString accessibleDescription;
+ QString automationId;
Expand Down

0 comments on commit eeaed80

Please sign in to comment.