Merge pull request #2870 from kb-1000/fix-accessibility
Add checks for QT_NO_ACCESSIBILITY to prevent build issues with Qt without accessibility
This commit is contained in:
commit
e27309d08a
@ -535,7 +535,9 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
qDebug() << "<> Settings loaded.";
|
qDebug() << "<> Settings loaded.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
QAccessible::installFactory(groupViewAccessibleFactory);
|
QAccessible::installFactory(groupViewAccessibleFactory);
|
||||||
|
#endif /* !QT_NO_ACCESSIBILITY */
|
||||||
|
|
||||||
// load translations
|
// load translations
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include <qaccessible.h>
|
#include <qaccessible.h>
|
||||||
#include <qheaderview.h>
|
#include <qheaderview.h>
|
||||||
|
|
||||||
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
|
|
||||||
QAccessibleInterface *groupViewAccessibleFactory(const QString &classname, QObject *object)
|
QAccessibleInterface *groupViewAccessibleFactory(const QString &classname, QObject *object)
|
||||||
{
|
{
|
||||||
QAccessibleInterface *iface = 0;
|
QAccessibleInterface *iface = 0;
|
||||||
@ -772,3 +774,5 @@ QAccessibleInterface *AccessibleGroupViewItem::child(int) const
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* !QT_NO_ACCESSIBILITY */
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <qtguiglobal.h>
|
||||||
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
#include "GroupView.h"
|
#include "GroupView.h"
|
||||||
#include "QtCore/qpointer.h"
|
#include "QtCore/qpointer.h"
|
||||||
#include <QtGui/qaccessible.h>
|
#include <QtGui/qaccessible.h>
|
||||||
@ -114,3 +116,4 @@ private:
|
|||||||
|
|
||||||
friend class AccessibleGroupView;
|
friend class AccessibleGroupView;
|
||||||
};
|
};
|
||||||
|
#endif /* !QT_NO_ACCESSIBILITY */
|
||||||
|
@ -93,11 +93,13 @@ void GroupView::currentChanged(const QModelIndex& current, const QModelIndex& pr
|
|||||||
{
|
{
|
||||||
QAbstractItemView::currentChanged(current, previous);
|
QAbstractItemView::currentChanged(current, previous);
|
||||||
// TODO: for accessibility support, implement+register a factory, steal QAccessibleTable from Qt and return an instance of it for GroupView.
|
// TODO: for accessibility support, implement+register a factory, steal QAccessibleTable from Qt and return an instance of it for GroupView.
|
||||||
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
if (QAccessible::isActive() && current.isValid()) {
|
if (QAccessible::isActive() && current.isValid()) {
|
||||||
QAccessibleEvent event(this, QAccessible::Focus);
|
QAccessibleEvent event(this, QAccessible::Focus);
|
||||||
event.setChild(current.row());
|
event.setChild(current.row());
|
||||||
QAccessible::updateAccessibility(&event);
|
QAccessible::updateAccessibility(&event);
|
||||||
}
|
}
|
||||||
|
#endif /* !QT_NO_ACCESSIBILITY */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +82,9 @@ void VersionListView::setEmptyMode(VersionListView::EmptyMode mode)
|
|||||||
|
|
||||||
void VersionListView::updateEmptyViewPort()
|
void VersionListView::updateEmptyViewPort()
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
setAccessibleDescription(currentEmptyString());
|
setAccessibleDescription(currentEmptyString());
|
||||||
|
#endif /* !QT_NO_ACCESSIBILITY */
|
||||||
|
|
||||||
if(!m_itemCount)
|
if(!m_itemCount)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user