Fixed QT_NO_ACCESSIBILITY build.

Change-Id: I14229753fc2e3b54da8a285ae9d27201b73e24be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Bjoern Breitmeyer 2013-01-30 14:02:28 +01:00 committed by The Qt Project
parent e95a758236
commit ad05af534d
4 changed files with 8 additions and 10 deletions

View File

@ -39,6 +39,7 @@
**
****************************************************************************/
#ifndef QT_NO_ACCESSIBILITY
#ifndef QACCESSIBLE_H
#define QACCESSIBLE_H
@ -681,3 +682,4 @@ QT_END_NAMESPACE
QT_END_HEADER
#endif // QACCESSIBLE_H
#endif //!QT_NO_ACCESSIBILITY

View File

@ -60,7 +60,9 @@
#include <QtCore/private/qthread_p.h>
#include <QtCore/qdir.h>
#include <QtDebug>
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include <qpalette.h>
#include <qscreen.h>
#include "qsessionmanager.h"

View File

@ -86,17 +86,13 @@ qreal dpiScaled(qreal value)
#endif
}
#ifndef QT_NO_ACCESSIBILITY
bool isInstanceOf(QObject *obj, QAccessible::Role role)
{
bool match = false;
#ifndef QT_NO_ACCESSIBILITY
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(obj);
match = iface && iface->role() == role;
delete iface;
#else
Q_UNUSED(obj)
Q_UNUSED(role)
#endif // QT_NO_ACCESSIBILITY
return match;
}
@ -104,19 +100,15 @@ bool isInstanceOf(QObject *obj, QAccessible::Role role)
bool hasAncestor(QObject *obj, QAccessible::Role role)
{
bool found = false;
#ifndef QT_NO_ACCESSIBILITY
QObject *parent = obj ? obj->parent() : 0;
while (parent && !found) {
if (isInstanceOf(parent, role))
found = true;
parent = parent->parent();
}
#else
Q_UNUSED(obj)
Q_UNUSED(role)
#endif // QT_NO_ACCESSIBILITY
return found;
}
#endif // QT_NO_ACCESSIBILITY
#ifndef QT_NO_DIAL

View File

@ -82,8 +82,10 @@ namespace QStyleHelper
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
int left = 0, int top = 0, int right = 0,
int bottom = 0);
#ifndef QT_NO_ACCESSIBILITY
bool isInstanceOf(QObject *obj, QAccessible::Role role);
bool hasAncestor(QObject *obj, QAccessible::Role role);
#endif
}