Commit 2c90973e authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

QAccessibleMenuItem: Implement QAccessibleInterface::window().


The window is required to be able to determine the correct
scale factor for the screen when High DPI scaling is active.

Change-Id: I8f776684396d055754093f62e0d33bd7e23cb52b
Task-number: QTBUG-52943
Reviewed-by: default avatarFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Showing with 16 additions and 0 deletions
......@@ -225,6 +225,20 @@ QObject *QAccessibleMenuItem::object() const
return m_action;
}
/*! \reimp */
QWindow *QAccessibleMenuItem::window() const
{
QWindow *result = Q_NULLPTR;
if (!m_owner.isNull()) {
result = m_owner->windowHandle();
if (!result) {
if (const QWidget *nativeParent = m_owner->nativeParentWidget())
result = nativeParent->windowHandle();
}
}
return result;
}
QRect QAccessibleMenuItem::rect() const
{
QRect rect;
......
......@@ -108,6 +108,8 @@ public:
QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
QObject * object() const Q_DECL_OVERRIDE;
QWindow *window() const Q_DECL_OVERRIDE;
QRect rect() const Q_DECL_OVERRIDE;
QAccessible::Role role() const Q_DECL_OVERRIDE;
void setText(QAccessible::Text t, const QString & text) Q_DECL_OVERRIDE;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment