summaryrefslogtreecommitdiffstats
path: root/src/widgets/accessible
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-26 16:08:55 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-26 16:14:54 +0200
commitaadfe7d634de04519102c5827ca885dc2e2199c9 (patch)
treed92db346ca95332b177036a53f1f6beb2e24fb74 /src/widgets/accessible
parent4b6c1448047362b8c38d265e6414f0e3e59b8d37 (diff)
parenta732e16d5fd9dbf8a0289fec9f948b12e9ba2c19 (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
Diffstat (limited to 'src/widgets/accessible')
-rw-r--r--src/widgets/accessible/complexwidgets.cpp8
-rw-r--r--src/widgets/accessible/complexwidgets_p.h4
-rw-r--r--src/widgets/accessible/qaccessiblemenu.cpp18
-rw-r--r--src/widgets/accessible/qaccessiblemenu_p.h8
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp4
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory.cpp20
-rw-r--r--src/widgets/accessible/qaccessiblewidgets.cpp31
-rw-r--r--src/widgets/accessible/qaccessiblewidgets_p.h12
-rw-r--r--src/widgets/accessible/rangecontrols.cpp15
-rw-r--r--src/widgets/accessible/rangecontrols_p.h8
-rw-r--r--src/widgets/accessible/simplewidgets.cpp23
-rw-r--r--src/widgets/accessible/simplewidgets_p.h4
12 files changed, 93 insertions, 62 deletions
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index 94ad011533..6cdc06d702 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -52,7 +52,9 @@
#if QT_CONFIG(combobox)
#include <qcombobox.h>
#endif
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtooltip.h>
@@ -60,7 +62,9 @@
#include <qwhatsthis.h>
#endif
#include <QAbstractScrollArea>
+#if QT_CONFIG(scrollarea)
#include <QScrollArea>
+#endif
#if QT_CONFIG(scrollbar)
#include <QScrollBar>
#endif
@@ -388,7 +392,7 @@ QStringList QAccessibleComboBox::keyBindingsForAction(const QString &/*actionNam
#endif // QT_CONFIG(combobox)
-#ifndef QT_NO_SCROLLAREA
+#if QT_CONFIG(scrollarea)
// ======================= QAccessibleAbstractScrollArea =======================
QAccessibleAbstractScrollArea::QAccessibleAbstractScrollArea(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::Client)
@@ -497,7 +501,7 @@ QAccessibleScrollArea::QAccessibleScrollArea(QWidget *widget)
{
Q_ASSERT(qobject_cast<QScrollArea *>(widget));
}
-#endif // QT_NO_SCROLLAREA
+#endif // QT_CONFIG(scrollarea)
QT_END_NAMESPACE
diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h
index c842490603..96db2dab70 100644
--- a/src/widgets/accessible/complexwidgets_p.h
+++ b/src/widgets/accessible/complexwidgets_p.h
@@ -70,7 +70,7 @@ class QTitleBar;
class QAbstractScrollArea;
class QScrollArea;
-#ifndef QT_NO_SCROLLAREA
+#if QT_CONFIG(scrollarea)
class QAccessibleAbstractScrollArea : public QAccessibleWidget
{
public:
@@ -105,7 +105,7 @@ class QAccessibleScrollArea : public QAccessibleAbstractScrollArea
public:
explicit QAccessibleScrollArea(QWidget *widget);
};
-#endif // QT_NO_SCROLLAREA
+#endif // QT_CONFIG(scrollarea)
#if QT_CONFIG(tabbar)
class QAccessibleTabBar : public QAccessibleWidget
diff --git a/src/widgets/accessible/qaccessiblemenu.cpp b/src/widgets/accessible/qaccessiblemenu.cpp
index 2391f74c2f..8b3353f625 100644
--- a/src/widgets/accessible/qaccessiblemenu.cpp
+++ b/src/widgets/accessible/qaccessiblemenu.cpp
@@ -39,8 +39,12 @@
#include "qaccessiblemenu_p.h"
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
+#if QT_CONFIG(menubar)
#include <qmenubar.h>
+#endif
#include <QtWidgets/QAction>
#include <qstyle.h>
@@ -48,7 +52,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QString qt_accStripAmp(const QString &text);
QString qt_accHotKey(const QString &text);
@@ -139,7 +143,7 @@ int QAccessibleMenu::indexOfChild( const QAccessibleInterface *child) const
return -1;
}
-#ifndef QT_NO_MENUBAR
+#if QT_CONFIG(menubar)
QAccessibleMenuBar::QAccessibleMenuBar(QWidget *w)
: QAccessibleWidget(w, QAccessible::MenuBar)
{
@@ -173,7 +177,7 @@ int QAccessibleMenuBar::indexOfChild(const QAccessibleInterface *child) const
return -1;
}
-#endif // QT_NO_MENUBAR
+#endif // QT_CONFIG(menubar)
QAccessibleMenuItem::QAccessibleMenuItem(QWidget *owner, QAction *action)
: m_action(action), m_owner(owner)
@@ -253,13 +257,13 @@ QRect QAccessibleMenuItem::rect() const
{
QRect rect;
QWidget *own = owner();
-#ifndef QT_NO_MENUBAR
+#if QT_CONFIG(menubar)
if (QMenuBar *menuBar = qobject_cast<QMenuBar*>(own)) {
rect = menuBar->actionGeometry(m_action);
QPoint globalPos = menuBar->mapToGlobal(QPoint(0,0));
rect = rect.translated(globalPos);
} else
-#endif // QT_NO_MENUBAR
+#endif // QT_CONFIG(menubar)
if (QMenu *menu = qobject_cast<QMenu*>(own)) {
rect = menu->actionGeometry(m_action);
QPoint globalPos = menu->mapToGlobal(QPoint(0,0));
@@ -289,7 +293,7 @@ QAccessible::State QAccessibleMenuItem::state() const
if (QMenu *menu = qobject_cast<QMenu*>(own)) {
if (menu->activeAction() == m_action)
s.focused = true;
-#ifndef QT_NO_MENUBAR
+#if QT_CONFIG(menubar)
} else if (QMenuBar *menuBar = qobject_cast<QMenuBar*>(own)) {
if (menuBar->activeAction() == m_action)
s.focused = true;
@@ -387,7 +391,7 @@ QWidget *QAccessibleMenuItem::owner() const
return m_owner;
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
QT_END_NAMESPACE
diff --git a/src/widgets/accessible/qaccessiblemenu_p.h b/src/widgets/accessible/qaccessiblemenu_p.h
index 4372ae4dcc..9acd2a42f9 100644
--- a/src/widgets/accessible/qaccessiblemenu_p.h
+++ b/src/widgets/accessible/qaccessiblemenu_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
class QMenu;
class QMenuBar;
class QAction;
@@ -82,7 +82,7 @@ protected:
QMenu *menu() const;
};
-#ifndef QT_NO_MENUBAR
+#if QT_CONFIG(menubar)
class QAccessibleMenuBar : public QAccessibleWidget
{
public:
@@ -96,7 +96,7 @@ public:
protected:
QMenuBar *menuBar() const;
};
-#endif // QT_NO_MENUBAR
+#endif // QT_CONFIG(menubar)
class QAccessibleMenuItem : public QAccessibleInterface, public QAccessibleActionInterface
@@ -136,7 +136,7 @@ private:
QPointer<QWidget> m_owner; // can hold either QMenu or the QMenuBar that contains the action
};
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index e3dd7383b2..c96d213e7b 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -60,7 +60,9 @@
#include <QRubberBand>
#endif
#include <QFocusFrame>
+#if QT_CONFIG(menu)
#include <QMenu>
+#endif
#include <QtWidgets/private/qwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -72,7 +74,7 @@ static QList<QWidget*> childWidgets(const QWidget *widget)
QWidget *w = qobject_cast<QWidget *>(o);
if (w && !w->isWindow()
&& !qobject_cast<QFocusFrame*>(w)
-#if !defined(QT_NO_MENU)
+#if QT_CONFIG(menu)
&& !qobject_cast<QMenu*>(w)
#endif
&& w->objectName() != QLatin1String("qt_rubberband")
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
index 3fbc9714f5..0bac45de27 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp
+++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
@@ -76,7 +76,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
return iface;
if (false) {
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
} else if (classname == QLatin1String("QLineEdit")) {
if (widget->objectName() == QLatin1String("qt_spinbox_lineedit"))
iface = 0;
@@ -87,7 +87,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QComboBox")) {
iface = new QAccessibleComboBox(widget);
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
} else if (classname == QLatin1String("QAbstractSpinBox")) {
iface = new QAccessibleAbstractSpinBox(widget);
} else if (classname == QLatin1String("QSpinBox")) {
@@ -99,7 +99,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QScrollBar")) {
iface = new QAccessibleScrollBar(widget);
#endif
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
} else if (classname == QLatin1String("QAbstractSlider")) {
iface = new QAccessibleAbstractSlider(widget);
} else if (classname == QLatin1String("QSlider")) {
@@ -120,7 +120,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
iface = new QAccessibleWidget(widget, QAccessible::Dialog);
} else if (classname == QLatin1String("QMessageBox")) {
iface = new QAccessibleWidget(widget, QAccessible::AlertMessage);
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
} else if (classname == QLatin1String("QMainWindow")) {
iface = new QAccessibleMainWindow(widget);
#endif
@@ -138,11 +138,11 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
#endif
} else if (classname == QLatin1String("QToolBar")) {
iface = new QAccessibleWidget(widget, QAccessible::ToolBar, widget->windowTitle());
-#ifndef QT_NO_MENUBAR
+#if QT_CONFIG(menubar)
} else if (classname == QLatin1String("QMenuBar")) {
iface = new QAccessibleMenuBar(widget);
#endif
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
} else if (classname == QLatin1String("QMenu")) {
iface = new QAccessibleMenu(widget);
#endif
@@ -167,7 +167,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QSplitterHandle")) {
iface = new QAccessibleWidget(widget, QAccessible::Grip);
#endif
-#if !defined(QT_NO_TEXTEDIT) && !defined(QT_NO_CURSOR)
+#if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR)
} else if (classname == QLatin1String("QTextEdit")) {
iface = new QAccessibleTextEdit(widget);
} else if (classname == QLatin1String("QPlainTextEdit")) {
@@ -177,7 +177,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
iface = new QAccessibleDisplay(widget, QAccessible::ToolTip);
} else if (classname == QLatin1String("QFrame")) {
iface = new QAccessibleWidget(widget, QAccessible::Border);
-#ifndef QT_NO_STACKEDWIDGET
+#if QT_CONFIG(stackedwidget)
} else if (classname == QLatin1String("QStackedWidget")) {
iface = new QAccessibleStackedWidget(widget);
#endif
@@ -185,7 +185,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QToolBox")) {
iface = new QAccessibleToolBox(widget);
#endif
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
} else if (classname == QLatin1String("QMdiArea")) {
iface = new QAccessibleMdiArea(widget);
} else if (classname == QLatin1String("QMdiSubWindow")) {
@@ -207,7 +207,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QTextBrowser")) {
iface = new QAccessibleTextBrowser(widget);
#endif
-#ifndef QT_NO_SCROLLAREA
+#if QT_CONFIG(scrollarea)
} else if (classname == QLatin1String("QAbstractScrollArea")) {
iface = new QAccessibleAbstractScrollArea(widget);
} else if (classname == QLatin1String("QScrollArea")) {
diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp
index 4e7ba78620..f869ab1129 100644
--- a/src/widgets/accessible/qaccessiblewidgets.cpp
+++ b/src/widgets/accessible/qaccessiblewidgets.cpp
@@ -41,23 +41,29 @@
#include "qabstracttextdocumentlayout.h"
#include "qapplication.h"
#include "qclipboard.h"
-#include "qtextedit.h"
-#include "private/qtextedit_p.h"
#include "qtextdocument.h"
#include "qtextobject.h"
+#if QT_CONFIG(textedit)
#include "qplaintextedit.h"
+#include "qtextedit.h"
+#include "private/qtextedit_p.h"
+#endif
#include "qtextboundaryfinder.h"
#if QT_CONFIG(scrollbar)
#include "qscrollbar.h"
#endif
#include "qdebug.h"
#include <QApplication>
+#if QT_CONFIG(stackedwidget)
#include <QStackedWidget>
+#endif
#if QT_CONFIG(toolbox)
#include <QToolBox>
#endif
+#if QT_CONFIG(mdiarea)
#include <QMdiArea>
#include <QMdiSubWindow>
+#endif
#if QT_CONFIG(dialogbuttonbox)
#include <QDialogButtonBox>
#endif
@@ -78,8 +84,13 @@
#include <QDockWidget>
#include <private/qdockwidget_p.h>
#endif
+#if QT_CONFIG(mainwindow)
#include <QMainWindow>
+#endif
#include <QFocusFrame>
+#if QT_CONFIG(menu)
+#include <QMenu>
+#endif
#ifndef QT_NO_ACCESSIBILITY
@@ -111,7 +122,7 @@ QList<QWidget*> childWidgets(const QWidget *widget)
return widgets;
}
-#if !defined(QT_NO_TEXTEDIT) && !defined(QT_NO_CURSOR)
+#if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR)
QAccessiblePlainTextEdit::QAccessiblePlainTextEdit(QWidget* o)
:QAccessibleTextWidget(o)
@@ -308,9 +319,9 @@ void QAccessibleTextEdit::scrollToSubstring(int startIndex, int endIndex)
qWarning("AccessibleTextEdit::scrollToSubstring failed!");
}
-#endif // QT_NO_TEXTEDIT && QT_NO_CURSOR
+#endif // QT_CONFIG(textedit) && QT_NO_CURSOR
-#ifndef QT_NO_STACKEDWIDGET
+#if QT_CONFIG(stackedwidget)
// ======================= QAccessibleStackedWidget ======================
QAccessibleStackedWidget::QAccessibleStackedWidget(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::LayeredPane)
@@ -356,7 +367,7 @@ QStackedWidget *QAccessibleStackedWidget::stackedWidget() const
{
return static_cast<QStackedWidget *>(object());
}
-#endif // QT_NO_STACKEDWIDGET
+#endif // QT_CONFIG(stackedwidget)
#if QT_CONFIG(toolbox)
// ======================= QAccessibleToolBox ======================
@@ -373,7 +384,7 @@ QToolBox * QAccessibleToolBox::toolBox() const
#endif // QT_CONFIG(toolbox)
// ======================= QAccessibleMdiArea ======================
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
QAccessibleMdiArea::QAccessibleMdiArea(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::LayeredPane)
{
@@ -493,7 +504,7 @@ QMdiSubWindow *QAccessibleMdiSubWindow::mdiSubWindow() const
{
return static_cast<QMdiSubWindow *>(object());
}
-#endif // QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
#if QT_CONFIG(dialogbuttonbox)
// ======================= QAccessibleDialogButtonBox ======================
@@ -1088,7 +1099,7 @@ void QAccessibleTextWidget::replaceText(int startOffset, int endOffset, const QS
#endif // QT_NO_CURSOR
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::Window) { }
@@ -1137,7 +1148,7 @@ QMainWindow *QAccessibleMainWindow::mainWindow() const
return qobject_cast<QMainWindow *>(object());
}
-#endif //QT_NO_MAINWINDOW
+#endif // QT_CONFIG(mainwindow)
QT_END_NAMESPACE
diff --git a/src/widgets/accessible/qaccessiblewidgets_p.h b/src/widgets/accessible/qaccessiblewidgets_p.h
index e663d70de6..87f0b888a0 100644
--- a/src/widgets/accessible/qaccessiblewidgets_p.h
+++ b/src/widgets/accessible/qaccessiblewidgets_p.h
@@ -132,7 +132,7 @@ protected:
virtual QWidget *viewport() const = 0;
};
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
class QAccessiblePlainTextEdit : public QAccessibleTextWidget
{
public:
@@ -184,7 +184,7 @@ protected:
QTextDocument *textDocument() const override;
QWidget *viewport() const override;
};
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
#endif //QT_NO_CURSOR
class QAccessibleStackedWidget : public QAccessibleWidget
@@ -216,7 +216,7 @@ protected:
QToolBox *toolBox() const;
};
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
class QAccessibleMdiArea : public QAccessibleWidget
{
public:
@@ -246,7 +246,7 @@ public:
protected:
QMdiSubWindow *mdiSubWindow() const;
};
-#endif // QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
#if QT_CONFIG(dialogbuttonbox)
class QAccessibleDialogButtonBox : public QAccessibleWidget
@@ -304,7 +304,7 @@ protected:
#endif // QT_CONFIG(dockwidget)
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
class QAccessibleMainWindow : public QAccessibleWidget
{
public:
@@ -317,7 +317,7 @@ public:
QMainWindow *mainWindow() const;
};
-#endif //QT_NO_MAINWINDOW
+#endif // QT_CONFIG(mainwindow)
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/widgets/accessible/rangecontrols.cpp b/src/widgets/accessible/rangecontrols.cpp
index 4aa948ed33..b5b8608418 100644
--- a/src/widgets/accessible/rangecontrols.cpp
+++ b/src/widgets/accessible/rangecontrols.cpp
@@ -39,11 +39,15 @@
#include "rangecontrols_p.h"
+#if QT_CONFIG(slider)
#include <qslider.h>
+#endif
#if QT_CONFIG(dial)
#include <qdial.h>
#endif
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
@@ -51,8 +55,9 @@
#include <qstyleoption.h>
#include <qdebug.h>
#include <qglobal.h>
-#include <QDoubleSpinBox>
+#if QT_CONFIG(lineedit)
#include <QtWidgets/qlineedit.h>
+#endif
#include <qmath.h>
#include <private/qmath_p.h>
@@ -62,7 +67,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w)
: QAccessibleWidget(w, QAccessible::SpinBox), lineEdit(nullptr)
{
@@ -285,7 +290,7 @@ QString QAccessibleDoubleSpinBox::text(QAccessible::Text textType) const
return QAccessibleWidget::text(textType);
}
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
#if QT_CONFIG(scrollbar)
/*!
@@ -322,7 +327,7 @@ QString QAccessibleScrollBar::text(QAccessible::Text t) const
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
/*!
\class QAccessibleSlider
\brief The QAccessibleSlider class implements the QAccessibleInterface for sliders.
@@ -399,7 +404,7 @@ QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
return static_cast<QAbstractSlider *>(object());
}
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(dial)
// ======================================= QAccessibleDial ======================================
diff --git a/src/widgets/accessible/rangecontrols_p.h b/src/widgets/accessible/rangecontrols_p.h
index 41c3747c05..1eada8e456 100644
--- a/src/widgets/accessible/rangecontrols_p.h
+++ b/src/widgets/accessible/rangecontrols_p.h
@@ -67,7 +67,7 @@ class QDoubleSpinBox;
class QDial;
class QAccessibleLineEdit;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
class QAccessibleAbstractSpinBox:
public QAccessibleWidget,
public QAccessibleValueInterface,
@@ -141,7 +141,7 @@ public:
protected:
QDoubleSpinBox *doubleSpinBox() const;
};
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
#if QT_CONFIG(slider)
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
@@ -174,7 +174,7 @@ protected:
};
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
class QAccessibleSlider : public QAccessibleAbstractSlider
{
public:
@@ -184,7 +184,7 @@ public:
protected:
QSlider *slider() const;
};
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(dial)
class QAccessibleDial : public QAccessibleAbstractSlider
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index b6fe003452..73de51ff45 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -60,7 +60,9 @@
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#if QT_CONFIG(label)
#include <qlabel.h>
#endif
@@ -70,14 +72,17 @@
#if QT_CONFIG(lcdnumber)
#include <qlcdnumber.h>
#endif
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
#include <private/qlineedit_p.h>
+#endif
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtextdocument.h>
#include <qwindow.h>
#include <private/qwindowcontainer_p.h>
#include <QtCore/qvarlengtharray.h>
+#include <QtGui/qvalidator.h>
#ifdef Q_OS_MAC
#include <qfocusframe.h>
@@ -175,7 +180,7 @@ QAccessible::State QAccessibleButton::state() const
if (pb) {
if (pb->isDefault())
state.defaultButton = true;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (pb->menu())
state.hasPopup = true;
#endif
@@ -214,7 +219,7 @@ QAccessible::Role QAccessibleButton::role() const
{
QAbstractButton *ab = button();
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (QPushButton *pb = qobject_cast<QPushButton*>(ab)) {
if (pb->menu())
return QAccessible::ButtonMenu;
@@ -257,7 +262,7 @@ void QAccessibleButton::doAction(const QString &actionName)
return;
if (actionName == pressAction() ||
actionName == showMenuAction()) {
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QPushButton *pb = qobject_cast<QPushButton*>(object());
if (pb && pb->menu())
pb->showMenu();
@@ -311,7 +316,7 @@ QToolButton *QAccessibleToolButton::toolButton() const
*/
bool QAccessibleToolButton::isSplitButton() const
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
return toolButton()->menu() && toolButton()->popupMode() == QToolButton::MenuButtonPopup;
#else
return false;
@@ -323,7 +328,7 @@ QAccessible::State QAccessibleToolButton::state() const
QAccessible::State st = QAccessibleButton::state();
if (toolButton()->autoRaise())
st.hotTracked = true;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (toolButton()->menu())
st.hasPopup = true;
#endif
@@ -337,7 +342,7 @@ int QAccessibleToolButton::childCount() const
QAccessible::Role QAccessibleToolButton::role() const
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QAbstractButton *ab = button();
QToolButton *tb = qobject_cast<QToolButton*>(ab);
if (!tb->menu())
@@ -351,7 +356,7 @@ QAccessible::Role QAccessibleToolButton::role() const
QAccessibleInterface *QAccessibleToolButton::child(int index) const
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (index == 0 && toolButton()->menu())
{
return QAccessible::queryAccessibleInterface(toolButton()->menu());
@@ -658,7 +663,7 @@ QStringList QAccessibleGroupBox::keyBindingsForAction(const QString &) const
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
/*!
\class QAccessibleLineEdit
\brief The QAccessibleLineEdit class implements the QAccessibleInterface for widgets with editable text
@@ -895,7 +900,7 @@ void QAccessibleLineEdit::replaceText(int startOffset, int endOffset, const QStr
lineEdit()->setText(lineEdit()->text().replace(startOffset, endOffset - startOffset, text));
}
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#if QT_CONFIG(progressbar)
QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o)
diff --git a/src/widgets/accessible/simplewidgets_p.h b/src/widgets/accessible/simplewidgets_p.h
index 08ce1a9d77..fcd0e7df47 100644
--- a/src/widgets/accessible/simplewidgets_p.h
+++ b/src/widgets/accessible/simplewidgets_p.h
@@ -148,7 +148,7 @@ private:
};
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface, public QAccessibleEditableTextInterface
{
public:
@@ -188,7 +188,7 @@ protected:
QLineEdit *lineEdit() const;
friend class QAccessibleAbstractSpinBox;
};
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#if QT_CONFIG(progressbar)
class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface