Make QStatusBar text available via accessibility.
UNTESTED cause the build fails for me (unrelated to this patch). Change-Id: Ie6836596b6fbaf93baa21d7008509774f1379f5c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>bb10
parent
727c55c094
commit
eb5b23748b
|
|
@ -156,7 +156,7 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
|||
iface = new QAccessibleGroupBox(widget);
|
||||
#endif
|
||||
} else if (classname == QLatin1String("QStatusBar")) {
|
||||
iface = new QAccessibleWidget(widget, QAccessible::StatusBar);
|
||||
iface = new QAccessibleDisplay(widget);
|
||||
#ifndef QT_NO_PROGRESSBAR
|
||||
} else if (classname == QLatin1String("QProgressBar")) {
|
||||
iface = new QAccessibleProgressBar(widget);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include <qcheckbox.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qprogressbar.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include <qmenu.h>
|
||||
|
|
@ -377,6 +378,8 @@ QAccessible::Role QAccessibleDisplay::role() const
|
|||
} else if (qobject_cast<QProgressBar*>(object())) {
|
||||
return QAccessible::ProgressBar;
|
||||
#endif
|
||||
} else if (qobject_cast<QStatusBar*>(object())) {
|
||||
return QAccessible::StatusBar;
|
||||
}
|
||||
return QAccessibleWidget::role();
|
||||
}
|
||||
|
|
@ -398,6 +401,8 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
|
|||
else
|
||||
str = QString::number(l->intValue());
|
||||
#endif
|
||||
} else if (qobject_cast<QStatusBar*>(object())) {
|
||||
return qobject_cast<QStatusBar*>(object())->currentMessage();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,10 @@
|
|||
#include "qsizegrip.h"
|
||||
#include "qmainwindow.h"
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include "qaccessible.h"
|
||||
#endif
|
||||
|
||||
#include <private/qlayoutengine_p.h>
|
||||
#include <private/qwidget_p.h>
|
||||
|
||||
|
|
@ -641,6 +645,14 @@ void QStatusBar::hideOrShow()
|
|||
}
|
||||
|
||||
emit messageChanged(d->tempItem);
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
if (QAccessible::isActive()) {
|
||||
QAccessibleEvent event(this, QAccessible::NameChanged);
|
||||
QAccessible::updateAccessibility(&event);
|
||||
}
|
||||
#endif
|
||||
|
||||
repaint(d->messageRect());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue