Fix compiling with --no-accessibility
Adds missing QT_NO_ACCESSIBILITY checks where required to build without accessibility support. Change-Id: Id98ecdcb9b351289b21dc2d382100d0b63857db9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This commit is contained in:
parent
99b8b647e3
commit
006a49b19a
@ -260,6 +260,8 @@ QPlatformInputContext *QPlatformIntegration::inputContext() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
||||
/*!
|
||||
Returns the platforms accessibility.
|
||||
|
||||
@ -270,6 +272,8 @@ QPlatformAccessibility *QPlatformIntegration::accessibility() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
QVariant QPlatformIntegration::styleHint(StyleHint hint) const
|
||||
{
|
||||
switch (hint) {
|
||||
|
@ -105,7 +105,9 @@ public:
|
||||
virtual QPlatformDrag *drag() const;
|
||||
#endif
|
||||
virtual QPlatformInputContext *inputContext() const;
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
virtual QPlatformAccessibility *accessibility() const;
|
||||
#endif
|
||||
|
||||
// Access native handles. The window handle is already available from Wid;
|
||||
virtual QPlatformNativeInterface *nativeInterface() const;
|
||||
|
@ -82,7 +82,9 @@
|
||||
|
||||
#include <QtGui/QOpenGLContext>
|
||||
#include <QtGui/QScreen>
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include <QtGui/QPlatformAccessibility>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -113,7 +115,9 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters)
|
||||
|
||||
m_fontDatabase.reset(new QGenericUnixFontDatabase());
|
||||
m_inputContext.reset(QPlatformInputContextFactory::create());
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
m_accessibility.reset(new QPlatformAccessibility());
|
||||
#endif
|
||||
|
||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
||||
m_sharedGraphicsCache.reset(new QXcbSharedGraphicsCache);
|
||||
@ -246,10 +250,12 @@ QPlatformInputContext *QXcbIntegration::inputContext() const
|
||||
return m_inputContext.data();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QPlatformAccessibility *QXcbIntegration::accessibility() const
|
||||
{
|
||||
return m_accessibility.data();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
||||
static bool sharedGraphicsCacheDisabled()
|
||||
|
@ -77,7 +77,9 @@ public:
|
||||
|
||||
QPlatformInputContext *inputContext() const;
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QPlatformAccessibility *accessibility() const;
|
||||
#endif
|
||||
|
||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
||||
QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const;
|
||||
@ -97,7 +99,9 @@ private:
|
||||
QScopedPointer<QPlatformInputContext> m_inputContext;
|
||||
QAbstractEventDispatcher *m_eventDispatcher;
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QScopedPointer<QPlatformAccessibility> m_accessibility;
|
||||
#endif
|
||||
|
||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
||||
QScopedPointer<QPlatformSharedGraphicsCache> m_sharedGraphicsCache;
|
||||
|
@ -43,7 +43,9 @@
|
||||
|
||||
#include "private/qwidget_p.h"
|
||||
#include "private/qapplication_p.h"
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include <QtGui/qaccessible.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -60,12 +62,14 @@ QWidgetWindow::QWidgetWindow(QWidget *widget)
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QAccessibleInterface *QWidgetWindow::accessibleRoot() const
|
||||
{
|
||||
if (m_widget)
|
||||
return QAccessible::queryAccessibleInterface(m_widget);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
QObject *QWidgetWindow::focusObject() const
|
||||
{
|
||||
|
@ -62,7 +62,9 @@ public:
|
||||
QWidgetWindow(QWidget *widget);
|
||||
|
||||
QWidget *widget() const { return m_widget; }
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QAccessibleInterface *accessibleRoot() const;
|
||||
#endif
|
||||
|
||||
QObject *focusObject() const;
|
||||
protected:
|
||||
|
@ -359,8 +359,10 @@ void QTabBarPrivate::init()
|
||||
#endif
|
||||
q->setFocusPolicy(Qt::TabFocus);
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
leftB->setAccessibleName(QTabBar::tr("Scroll Left"));
|
||||
rightB->setAccessibleName(QTabBar::tr("Scroll Right"));
|
||||
#endif
|
||||
q->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
elideMode = Qt::TextElideMode(q->style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, q));
|
||||
useScrollButtons = !q->style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, q);
|
||||
@ -1737,7 +1739,7 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
|
||||
if (d->pressedIndex != -1
|
||||
&& event->buttons() == Qt::NoButton)
|
||||
d->moveTabFinished(d->pressedIndex);
|
||||
|
||||
|
||||
// Start drag
|
||||
if (!d->dragInProgress && d->pressedIndex != -1) {
|
||||
if ((event->pos() - d->dragStartPosition).manhattanLength() > QApplication::startDragDistance()) {
|
||||
|
@ -197,8 +197,9 @@ protected:
|
||||
void changeEvent(QEvent *);
|
||||
void initStyleOption(QStyleOptionTab *option, int tabIndex) const;
|
||||
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
friend class QAccessibleTabBar;
|
||||
#endif
|
||||
private:
|
||||
Q_DISABLE_COPY(QTabBar)
|
||||
Q_DECLARE_PRIVATE(QTabBar)
|
||||
|
Loading…
x
Reference in New Issue
Block a user