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: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>bb10
parent
558c5c849c
commit
2c90973ebf
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue