Create a class to contain accessibilty enums.
This is needed in order to expose the enums to qml. Do not inherit QAccessible. Change-Id: I220a0ea3add2d790e4fa6e93ce3deda762859e1a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>bb10
parent
59fb032839
commit
1e37a053ed
|
|
@ -859,7 +859,7 @@ const QAccessibleInterface *other, int otherChild) const
|
|||
*/
|
||||
QAccessible::Relation QAccessibleInterface::relationTo(const QAccessibleInterface *) const
|
||||
{
|
||||
return Unrelated;
|
||||
return QAccessible::Unrelated;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -871,7 +871,7 @@ QAccessible::Relation QAccessibleInterface::relationTo(const QAccessibleInterfac
|
|||
*/
|
||||
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > QAccessibleInterface::relations() const
|
||||
{
|
||||
return QVector<QPair<QAccessibleInterface*, Relation> >();
|
||||
return QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -1191,7 +1191,7 @@ QWindow *QAccessibleInterface::window() const
|
|||
|
||||
Returns an invalid QVariant if the object doesn't support the action.
|
||||
*/
|
||||
QVariant QAccessibleInterface::invokeMethod(Method method, const QVariantList ¶ms)
|
||||
QVariant QAccessibleInterface::invokeMethod(QAccessible::Method method, const QVariantList ¶ms)
|
||||
{
|
||||
Q_UNUSED(method)
|
||||
Q_UNUSED(params)
|
||||
|
|
|
|||
|
|
@ -62,9 +62,16 @@ QT_MODULE(Gui)
|
|||
class QAccessibleInterface;
|
||||
class QWindow;
|
||||
|
||||
// We need to inherit QObject to expose the enums to QML.
|
||||
class Q_GUI_EXPORT QAccessible
|
||||
#ifndef qdoc
|
||||
:public QObject
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(Role Event State)
|
||||
public:
|
||||
|
||||
enum Event {
|
||||
SoundPlayed = 0x0001,
|
||||
Alert = 0x0002,
|
||||
|
|
@ -141,6 +148,7 @@ public:
|
|||
AcceleratorChanged = 0x80C0
|
||||
};
|
||||
|
||||
|
||||
enum StateFlag {
|
||||
Normal = 0x00000000,
|
||||
Unavailable = 0x00000001,
|
||||
|
|
@ -152,11 +160,11 @@ public:
|
|||
ReadOnly = 0x00000040,
|
||||
HotTracked = 0x00000080,
|
||||
DefaultButton = 0x00000100,
|
||||
// #### Qt5 Expandable
|
||||
Expanded = 0x00000200,
|
||||
Collapsed = 0x00000400,
|
||||
Busy = 0x00000800,
|
||||
// Floating = 0x00001000,
|
||||
Expandable = 0x00001000,
|
||||
Marqueed = 0x00002000,
|
||||
Animated = 0x00004000,
|
||||
Invisible = 0x00008000,
|
||||
|
|
@ -180,6 +188,7 @@ public:
|
|||
};
|
||||
Q_DECLARE_FLAGS(State, StateFlag)
|
||||
|
||||
|
||||
enum Role {
|
||||
NoRole = 0x00000000,
|
||||
TitleBar = 0x00000001,
|
||||
|
|
@ -224,7 +233,10 @@ public:
|
|||
Graphic = 0x00000028,
|
||||
StaticText = 0x00000029,
|
||||
EditableText = 0x0000002A, // Editable, selectable, etc.
|
||||
PushButton = 0x0000002B,
|
||||
Button = 0x0000002B,
|
||||
#ifndef qdoc
|
||||
PushButton = Button, // deprecated
|
||||
#endif
|
||||
CheckBox = 0x0000002C,
|
||||
RadioButton = 0x0000002D,
|
||||
ComboBox = 0x0000002E,
|
||||
|
|
@ -321,6 +333,12 @@ public:
|
|||
private:
|
||||
static UpdateHandler updateHandler;
|
||||
static RootObjectHandler rootObjectHandler;
|
||||
|
||||
/*! @internal
|
||||
This class is purely a collection of enums and static functions,
|
||||
it is not supposed to be instantiated.
|
||||
*/
|
||||
QAccessible() {}
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::State)
|
||||
|
|
@ -338,7 +356,7 @@ class QAccessibleImageInterface;
|
|||
class QAccessibleTableInterface;
|
||||
class QAccessibleTableCellInterface;
|
||||
|
||||
class Q_GUI_EXPORT QAccessibleInterface : public QAccessible
|
||||
class Q_GUI_EXPORT QAccessibleInterface
|
||||
{
|
||||
public:
|
||||
virtual ~QAccessibleInterface() {}
|
||||
|
|
@ -348,8 +366,8 @@ public:
|
|||
virtual QWindow *window() const;
|
||||
|
||||
// relations
|
||||
virtual Relation relationTo(const QAccessibleInterface *other) const;
|
||||
virtual QVector<QPair<QAccessibleInterface*, Relation> > relations() const;
|
||||
virtual QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
virtual QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations() const;
|
||||
|
||||
virtual int childAt(int x, int y) const = 0;
|
||||
|
||||
|
|
@ -358,22 +376,23 @@ public:
|
|||
virtual QAccessibleInterface *child(int index) const = 0;
|
||||
virtual int childCount() const = 0;
|
||||
virtual int indexOfChild(const QAccessibleInterface *) const = 0;
|
||||
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const = 0;
|
||||
virtual int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const = 0;
|
||||
|
||||
// properties and state
|
||||
virtual QString text(Text t) const = 0;
|
||||
virtual void setText(Text t, const QString &text) = 0;
|
||||
virtual QString text(QAccessible::Text t) const = 0;
|
||||
virtual void setText(QAccessible::Text t, const QString &text) = 0;
|
||||
virtual QRect rect() const = 0;
|
||||
virtual Role role() const = 0;
|
||||
virtual State state() const = 0;
|
||||
virtual QAccessible::Role role() const = 0;
|
||||
virtual QAccessible::State state() const = 0;
|
||||
// FIXME virtual QSet<QAccessible::State> states() const = 0;
|
||||
|
||||
virtual QColor foregroundColor() const;
|
||||
virtual QColor backgroundColor() const;
|
||||
|
||||
virtual QVariant invokeMethod(Method method, const QVariantList ¶ms = QVariantList());
|
||||
virtual QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms = QVariantList());
|
||||
|
||||
inline QSet<Method> supportedMethods()
|
||||
{ return qvariant_cast<QSet<Method> >(invokeMethod(ListSupportedMethods)); }
|
||||
inline QSet<QAccessible::Method> supportedMethods()
|
||||
{ return qvariant_cast<QSet<QAccessible::Method> >(invokeMethod(QAccessible::ListSupportedMethods)); }
|
||||
|
||||
inline QAccessibleTextInterface *textInterface()
|
||||
{ return reinterpret_cast<QAccessibleTextInterface *>(interface_cast(QAccessible::TextInterface)); }
|
||||
|
|
|
|||
|
|
@ -184,9 +184,6 @@ public:
|
|||
virtual void rowColumnExtents(int *row, int *column, int *rowExtents, int *columnExtents, bool *selected) const = 0;
|
||||
// Returns a reference to the accessbile of the containing table.
|
||||
virtual QAccessibleInterface* table() const = 0;
|
||||
|
||||
// #### Qt5 this should not be here but part of the state
|
||||
virtual bool isExpandable() const = 0;
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QAccessibleTableInterface
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ QRect QAccessibleObject::rect() const
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
void QAccessibleObject::setText(Text, const QString &)
|
||||
void QAccessibleObject::setText(QAccessible::Text, const QString &)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -231,13 +231,13 @@ QAccessible::Relation QAccessibleApplication::relationTo(const QAccessibleInterf
|
|||
{
|
||||
QObject *o = other ? other->object() : 0;
|
||||
if (!o)
|
||||
return Unrelated;
|
||||
return QAccessible::Unrelated;
|
||||
|
||||
if(o == object()) {
|
||||
return Self;
|
||||
return QAccessible::Self;
|
||||
}
|
||||
|
||||
return Unrelated;
|
||||
return QAccessible::Unrelated;
|
||||
}
|
||||
|
||||
QAccessibleInterface *QAccessibleApplication::parent() const
|
||||
|
|
@ -254,7 +254,7 @@ QAccessibleInterface *QAccessibleApplication::child(int index) const
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
int QAccessibleApplication::navigate(RelationFlag relation, int,
|
||||
int QAccessibleApplication::navigate(QAccessible::RelationFlag relation, int,
|
||||
QAccessibleInterface **target) const
|
||||
{
|
||||
if (!target)
|
||||
|
|
@ -264,16 +264,16 @@ int QAccessibleApplication::navigate(RelationFlag relation, int,
|
|||
QObject *targetObject = 0;
|
||||
|
||||
switch (relation) {
|
||||
case Self:
|
||||
case QAccessible::Self:
|
||||
targetObject = object();
|
||||
break;
|
||||
case FocusChild:
|
||||
case QAccessible::FocusChild:
|
||||
if (QWindow *window = QGuiApplication::activeWindow()) {
|
||||
*target = window->accessibleRoot();
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case Ancestor:
|
||||
case QAccessible::Ancestor:
|
||||
*target = parent();
|
||||
return 0;
|
||||
default:
|
||||
|
|
@ -284,12 +284,12 @@ int QAccessibleApplication::navigate(RelationFlag relation, int,
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
QString QAccessibleApplication::text(Text t) const
|
||||
QString QAccessibleApplication::text(QAccessible::Text t) const
|
||||
{
|
||||
switch (t) {
|
||||
case Name:
|
||||
case QAccessible::Name:
|
||||
return QGuiApplication::applicationName();
|
||||
case Description:
|
||||
case QAccessible::Description:
|
||||
return QGuiApplication::applicationFilePath();
|
||||
default:
|
||||
break;
|
||||
|
|
@ -300,13 +300,13 @@ QString QAccessibleApplication::text(Text t) const
|
|||
/*! \reimp */
|
||||
QAccessible::Role QAccessibleApplication::role() const
|
||||
{
|
||||
return Application;
|
||||
return QAccessible::Application;
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
QAccessible::State QAccessibleApplication::state() const
|
||||
{
|
||||
return QGuiApplication::activeWindow() ? Focused : Normal;
|
||||
return QGuiApplication::activeWindow() ? QAccessible::Focused : QAccessible::Normal;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public:
|
|||
|
||||
// properties
|
||||
QRect rect() const;
|
||||
void setText(Text t, const QString &text);
|
||||
void setText(QAccessible::Text t, const QString &text);
|
||||
|
||||
protected:
|
||||
virtual ~QAccessibleObject();
|
||||
|
|
@ -85,18 +85,18 @@ public:
|
|||
// relations
|
||||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface*) const;
|
||||
Relation relationTo(const QAccessibleInterface *other) const;
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
|
||||
// navigation
|
||||
QAccessibleInterface *parent() const;
|
||||
int childAt(int x, int y) const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
int navigate(RelationFlag, int, QAccessibleInterface **) const;
|
||||
int navigate(QAccessible::RelationFlag, int, QAccessibleInterface **) const;
|
||||
|
||||
// properties and state
|
||||
QString text(Text t) const;
|
||||
Role role() const;
|
||||
State state() const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
QAccessible::Role role() const;
|
||||
QAccessible::State state() const;
|
||||
};
|
||||
|
||||
#endif // QT_NO_ACCESSIBILITY
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ QT_MODULE(Gui)
|
|||
class QStringList;
|
||||
class QAccessibleInterface;
|
||||
|
||||
struct Q_GUI_EXPORT QAccessibleFactoryInterface : public QAccessible, public QFactoryInterface
|
||||
struct Q_GUI_EXPORT QAccessibleFactoryInterface : public QFactoryInterface
|
||||
{
|
||||
virtual QAccessibleInterface* create(const QString &key, QObject *object) = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ QString QAccessibleItemRow::text_helper(int child) const
|
|||
return value;
|
||||
}
|
||||
|
||||
QString QAccessibleItemRow::text(Text t, int child) const
|
||||
QString QAccessibleItemRow::text(QAccessible::Text t, int child) const
|
||||
{
|
||||
QString value;
|
||||
if (t == Name) {
|
||||
|
|
@ -339,7 +339,7 @@ QString QAccessibleItemRow::text(Text t, int child) const
|
|||
return value;
|
||||
}
|
||||
|
||||
void QAccessibleItemRow::setText(Text t, int child, const QString &text)
|
||||
void QAccessibleItemRow::setText(QAccessible::Text t, int child, const QString &text)
|
||||
{
|
||||
if (m_header) {
|
||||
if (child)
|
||||
|
|
@ -966,7 +966,7 @@ int QAccessibleItemView::childCount() const
|
|||
}
|
||||
}
|
||||
|
||||
QString QAccessibleItemView::text(Text t, int child) const
|
||||
QString QAccessibleItemView::text(QAccessible::Text t, int child) const
|
||||
{
|
||||
if (atViewport()) {
|
||||
if (!child)
|
||||
|
|
@ -983,7 +983,7 @@ QString QAccessibleItemView::text(Text t, int child) const
|
|||
}
|
||||
}
|
||||
|
||||
void QAccessibleItemView::setText(Text t, int child, const QString &text)
|
||||
void QAccessibleItemView::setText(QAccessible::Text t, int child, const QString &text)
|
||||
{
|
||||
if (atViewport()) {
|
||||
if (!child) {
|
||||
|
|
@ -1386,7 +1386,7 @@ int QAccessibleHeader::childCount() const
|
|||
return header()->count();
|
||||
}
|
||||
|
||||
QString QAccessibleHeader::text(Text t, int child) const
|
||||
QString QAccessibleHeader::text(QAccessible::Text t, int child) const
|
||||
{
|
||||
QString str;
|
||||
|
||||
|
|
@ -1464,10 +1464,10 @@ public:
|
|||
}
|
||||
|
||||
QObject *object() const { return 0; }
|
||||
Role role() const { return QAccessible::PageTab; }
|
||||
State state() const {
|
||||
QAccessible::Role role() const { return QAccessible::PageTab; }
|
||||
QAccessible::State state() const {
|
||||
QAccessibleInterface *parentInterface = parent();
|
||||
State state = parentInterface->state();
|
||||
QAccessible::State state = parentInterface->state();
|
||||
delete parentInterface;
|
||||
return state;
|
||||
}
|
||||
|
|
@ -1487,14 +1487,14 @@ public:
|
|||
int childCount() const { return 0; }
|
||||
int indexOfChild(const QAccessibleInterface *) const { return -1; }
|
||||
|
||||
QString text(Text) const { return qt_accStripAmp(m_parent->tabText(m_index)); }
|
||||
void setText(Text, const QString &) {}
|
||||
QString text(QAccessible::Text) const { return qt_accStripAmp(m_parent->tabText(m_index)); }
|
||||
void setText(QAccessible::Text, const QString &) {}
|
||||
|
||||
QAccessibleInterface *parent() const {
|
||||
return QAccessible::queryAccessibleInterface(m_parent);
|
||||
}
|
||||
QAccessibleInterface *child(int) const { return 0; }
|
||||
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
{
|
||||
if (relation == QAccessible::Ancestor && index == 1) {
|
||||
*iface = parent();
|
||||
|
|
@ -1502,7 +1502,7 @@ public:
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
Relation relationTo(const QAccessibleInterface *) const
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *) const
|
||||
{
|
||||
return QAccessible::Unrelated;
|
||||
}
|
||||
|
|
@ -1533,7 +1533,7 @@ private:
|
|||
Constructs a QAccessibleTabBar object for \a w.
|
||||
*/
|
||||
QAccessibleTabBar::QAccessibleTabBar(QWidget *w)
|
||||
: QAccessibleWidget(w, PageTabList)
|
||||
: QAccessibleWidget(w, QAccessible::PageTabList)
|
||||
{
|
||||
Q_ASSERT(tabBar());
|
||||
}
|
||||
|
|
@ -1544,7 +1544,7 @@ QTabBar *QAccessibleTabBar::tabBar() const
|
|||
return qobject_cast<QTabBar*>(object());
|
||||
}
|
||||
|
||||
int QAccessibleTabBar::navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleTabBar::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
if (rel == QAccessible::Child) {
|
||||
*target = child(entry - 1);
|
||||
|
|
@ -1590,7 +1590,7 @@ int QAccessibleTabBar::childCount() const
|
|||
return tabBar()->count() + 2;
|
||||
}
|
||||
|
||||
QString QAccessibleTabBar::text(Text t) const
|
||||
QString QAccessibleTabBar::text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == QAccessible::Name) {
|
||||
return qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex()));
|
||||
|
|
@ -1648,7 +1648,7 @@ QVector<int> QAccessibleTabBar::selection() const
|
|||
Constructs a QAccessibleComboBox object for \a w.
|
||||
*/
|
||||
QAccessibleComboBox::QAccessibleComboBox(QWidget *w)
|
||||
: QAccessibleWidget(w, ComboBox)
|
||||
: QAccessibleWidget(w, QAccessible::ComboBox)
|
||||
{
|
||||
Q_ASSERT(comboBox());
|
||||
}
|
||||
|
|
@ -1696,24 +1696,24 @@ int QAccessibleComboBox::indexOfChild(const QAccessibleInterface *child) const
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
QString QAccessibleComboBox::text(Text t) const
|
||||
QString QAccessibleComboBox::text(QAccessible::Text t) const
|
||||
{
|
||||
QString str;
|
||||
|
||||
switch (t) {
|
||||
case Name:
|
||||
case QAccessible::Name:
|
||||
#ifndef Q_OS_UNIX // on Linux we use relations for this, name is text (fall through to Value)
|
||||
str = QAccessibleWidget::text(t);
|
||||
break;
|
||||
#endif
|
||||
case Value:
|
||||
case QAccessible::Value:
|
||||
if (comboBox()->isEditable())
|
||||
str = comboBox()->lineEdit()->text();
|
||||
else
|
||||
str = comboBox()->currentText();
|
||||
break;
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
case Accelerator:
|
||||
case QAccessible::Accelerator:
|
||||
str = (QString)QKeySequence(Qt::Key_Down);
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -1770,7 +1770,7 @@ static inline void removeInvisibleWidgetsFromList(QWidgetList *list)
|
|||
#ifndef QT_NO_SCROLLAREA
|
||||
// ======================= QAccessibleAbstractScrollArea =======================
|
||||
QAccessibleAbstractScrollArea::QAccessibleAbstractScrollArea(QWidget *widget)
|
||||
: QAccessibleWidget(widget, Client)
|
||||
: QAccessibleWidget(widget, QAccessible::Client)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QAbstractScrollArea *>(widget));
|
||||
}
|
||||
|
|
@ -1805,7 +1805,7 @@ bool QAccessibleAbstractScrollArea::isValid() const
|
|||
return (QAccessibleWidget::isValid() && abstractScrollArea() && abstractScrollArea()->viewport());
|
||||
}
|
||||
|
||||
int QAccessibleAbstractScrollArea::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleAbstractScrollArea::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
if (!target)
|
||||
return -1;
|
||||
|
|
@ -1815,8 +1815,8 @@ int QAccessibleAbstractScrollArea::navigate(RelationFlag relation, int entry, QA
|
|||
QWidget *targetWidget = 0;
|
||||
QWidget *entryWidget = 0;
|
||||
|
||||
if (relation == Child ||
|
||||
relation == Left || relation == Up || relation == Right || relation == Down) {
|
||||
if (relation == QAccessible::Child ||
|
||||
relation == QAccessible::Left || relation == QAccessible::Up || relation == QAccessible::Right || relation == QAccessible::Down) {
|
||||
QWidgetList children = accessibleChildren();
|
||||
if (entry < 0 || entry > children.count())
|
||||
return -1;
|
||||
|
|
@ -1832,12 +1832,12 @@ int QAccessibleAbstractScrollArea::navigate(RelationFlag relation, int entry, QA
|
|||
// It might be possible to make it more general, but I'll leave that as an exercise
|
||||
// to the reader. :-)
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
if (entry > 0) {
|
||||
*target = child(entry - 1);
|
||||
return *target ? 0 : -1;
|
||||
}
|
||||
case Left:
|
||||
case QAccessible::Left:
|
||||
if (entry < 1)
|
||||
break;
|
||||
switch (entryElement) {
|
||||
|
|
@ -1861,7 +1861,7 @@ int QAccessibleAbstractScrollArea::navigate(RelationFlag relation, int entry, QA
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case Right:
|
||||
case QAccessible::Right:
|
||||
if (entry < 1)
|
||||
break;
|
||||
switch (entryElement) {
|
||||
|
|
@ -1884,7 +1884,7 @@ int QAccessibleAbstractScrollArea::navigate(RelationFlag relation, int entry, QA
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case Up:
|
||||
case QAccessible::Up:
|
||||
if (entry < 1)
|
||||
break;
|
||||
switch (entryElement) {
|
||||
|
|
@ -1898,7 +1898,7 @@ int QAccessibleAbstractScrollArea::navigate(RelationFlag relation, int entry, QA
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case Down:
|
||||
case QAccessible::Down:
|
||||
if (entry < 1)
|
||||
break;
|
||||
switch (entryElement) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public:
|
|||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
bool isValid() const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
// int childAt(int x, int y) const;
|
||||
|
||||
//protected:
|
||||
|
|
@ -109,7 +109,7 @@ public:
|
|||
int childCount() const;
|
||||
|
||||
QRect rect(int child) const;
|
||||
QString text(Text t, int child) const;
|
||||
QString text(QAccessible::Text t, int child) const;
|
||||
Role role(int child) const;
|
||||
State state(int child) const;
|
||||
|
||||
|
|
@ -123,8 +123,8 @@ class QAccessibleItemRow: public QAccessibleInterface
|
|||
public:
|
||||
QAccessibleItemRow(QAbstractItemView *view, const QModelIndex &index = QModelIndex(), bool isHeader = false);
|
||||
QRect rect(int child) const;
|
||||
QString text(Text t, int child) const;
|
||||
void setText(Text t, int child, const QString &text);
|
||||
QString text(QAccessible::Text t, int child) const;
|
||||
void setText(QAccessible::Text t, int child, const QString &text);
|
||||
bool isValid() const;
|
||||
QObject *object() const;
|
||||
Role role(int child) const;
|
||||
|
|
@ -138,7 +138,7 @@ public:
|
|||
int childAt(int x, int y) const;
|
||||
QAccessibleInterface *parent() const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
|
||||
int userActionCount(int child) const;
|
||||
QString actionText(int action, Text t, int child) const;
|
||||
|
|
@ -170,14 +170,14 @@ public:
|
|||
QRect rect(int child) const;
|
||||
int childAt(int x, int y) const;
|
||||
int childCount() const;
|
||||
QString text(Text t, int child) const;
|
||||
void setText(Text t, int child, const QString &text);
|
||||
QString text(QAccessible::Text t, int child) const;
|
||||
void setText(QAccessible::Text t, int child, const QString &text);
|
||||
int indexOfChild(const QAccessibleInterface *iface) const;
|
||||
|
||||
QModelIndex childIndex(int child) const;
|
||||
int entryFromIndex(const QModelIndex &index) const;
|
||||
bool isValid() const;
|
||||
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
|
||||
QAccessibleInterface *accessibleAt(int row, int column);
|
||||
QAccessibleInterface *caption();
|
||||
|
|
@ -234,14 +234,14 @@ public:
|
|||
explicit QAccessibleTabBar(QWidget *w);
|
||||
|
||||
int childCount() const;
|
||||
QString text(Text t) const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
|
||||
bool setSelected(int child, bool on, bool extend);
|
||||
QVector<int> selection() const;
|
||||
|
||||
QAccessibleInterface* child(int index) const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const;
|
||||
|
||||
protected:
|
||||
QTabBar *tabBar() const;
|
||||
|
|
@ -259,7 +259,7 @@ public:
|
|||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
QAccessibleInterface* child(int index) const;
|
||||
|
||||
QString text(Text t) const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
|
||||
// QAccessibleActionInterface
|
||||
QStringList actionNames() const;
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
QString QAccessibleTable::text(Text t) const
|
||||
QString QAccessibleTable::text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == QAccessible::Description)
|
||||
return view->accessibleDescription();
|
||||
|
|
@ -443,11 +443,11 @@ QAccessibleInterface *QAccessibleTable::child(int index) const
|
|||
return childFromLogical(index + 1);
|
||||
}
|
||||
|
||||
int QAccessibleTable::navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
int QAccessibleTable::navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
{
|
||||
*iface = 0;
|
||||
switch (relation) {
|
||||
case Ancestor: {
|
||||
case QAccessible::Ancestor: {
|
||||
*iface = parent();
|
||||
return *iface ? 0 : -1;
|
||||
}
|
||||
|
|
@ -551,7 +551,7 @@ int QAccessibleTree::indexOfChild(const QAccessibleInterface *iface) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
int QAccessibleTree::navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
int QAccessibleTree::navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
{
|
||||
switch (relation) {
|
||||
case QAccessible::Child: {
|
||||
|
|
@ -724,41 +724,38 @@ QAccessible::Role QAccessibleTableCell::role() const
|
|||
|
||||
QAccessible::State QAccessibleTableCell::state() const
|
||||
{
|
||||
State st = Normal;
|
||||
|
||||
QAccessible::State st = QAccessible::Normal;
|
||||
QRect globalRect = view->rect();
|
||||
globalRect.translate(view->mapToGlobal(QPoint(0,0)));
|
||||
if (!globalRect.intersects(rect()))
|
||||
st |= Invisible;
|
||||
st |= QAccessible::Invisible;
|
||||
|
||||
if (view->selectionModel()->isSelected(m_index))
|
||||
st |= Selected;
|
||||
st |= QAccessible::Selected;
|
||||
if (view->selectionModel()->currentIndex() == m_index)
|
||||
st |= Focused;
|
||||
st |= QAccessible::Focused;
|
||||
if (m_index.model()->data(m_index, Qt::CheckStateRole).toInt() == Qt::Checked)
|
||||
st |= Checked;
|
||||
st |= QAccessible::Checked;
|
||||
|
||||
Qt::ItemFlags flags = m_index.flags();
|
||||
if (flags & Qt::ItemIsSelectable) {
|
||||
st |= Selectable;
|
||||
st |= Focusable;
|
||||
st |= QAccessible::Selectable;
|
||||
st |= QAccessible::Focusable;
|
||||
if (view->selectionMode() == QAbstractItemView::MultiSelection)
|
||||
st |= MultiSelectable;
|
||||
st |= QAccessible::MultiSelectable;
|
||||
if (view->selectionMode() == QAbstractItemView::ExtendedSelection)
|
||||
st |= ExtSelectable;
|
||||
st |= QAccessible::ExtSelectable;
|
||||
}
|
||||
if (m_role == QAccessible::TreeItem) {
|
||||
const QTreeView *treeView = qobject_cast<const QTreeView*>(view);
|
||||
if (treeView->model()->hasChildren(m_index))
|
||||
st |= QAccessible::Expandable;
|
||||
if (treeView->isExpanded(m_index))
|
||||
st |= Expanded;
|
||||
st |= QAccessible::Expanded;
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
bool QAccessibleTableCell::isExpandable() const
|
||||
{
|
||||
return view->model()->hasChildren(m_index);
|
||||
}
|
||||
|
||||
QRect QAccessibleTableCell::rect() const
|
||||
{
|
||||
|
|
@ -771,7 +768,7 @@ QRect QAccessibleTableCell::rect() const
|
|||
return r;
|
||||
}
|
||||
|
||||
QString QAccessibleTableCell::text(Text t) const
|
||||
QString QAccessibleTableCell::text(QAccessible::Text t) const
|
||||
{
|
||||
QAbstractItemModel *model = view->model();
|
||||
QString value;
|
||||
|
|
@ -791,7 +788,7 @@ QString QAccessibleTableCell::text(Text t) const
|
|||
return value;
|
||||
}
|
||||
|
||||
void QAccessibleTableCell::setText(Text /*t*/, const QString &text)
|
||||
void QAccessibleTableCell::setText(QAccessible::Text /*t*/, const QString &text)
|
||||
{
|
||||
if (!(m_index.flags() & Qt::ItemIsEditable))
|
||||
return;
|
||||
|
|
@ -820,9 +817,9 @@ QAccessibleInterface *QAccessibleTableCell::child(int) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
int QAccessibleTableCell::navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
int QAccessibleTableCell::navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
{
|
||||
if (relation == Ancestor && index == 1) {
|
||||
if (relation == QAccessible::Ancestor && index == 1) {
|
||||
*iface = parent();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -833,12 +830,12 @@ int QAccessibleTableCell::navigate(RelationFlag relation, int index, QAccessible
|
|||
|
||||
switch (relation) {
|
||||
|
||||
case Child: {
|
||||
case QAccessible::Child: {
|
||||
return -1;
|
||||
}
|
||||
case Sibling:
|
||||
case QAccessible::Sibling:
|
||||
if (index > 0) {
|
||||
QAccessibleInterface *parent = queryAccessibleInterface(view);
|
||||
QAccessibleInterface *parent = QAccessible::queryAccessibleInterface(view);
|
||||
*iface = parent->child(index - 1);
|
||||
delete parent;
|
||||
return *iface ? 0 : -1;
|
||||
|
|
@ -934,7 +931,7 @@ QRect QAccessibleTableHeaderCell::rect() const
|
|||
: QRect(zero.x(), zero.y() + sectionPos, header->width(), sectionSize);
|
||||
}
|
||||
|
||||
QString QAccessibleTableHeaderCell::text(Text t) const
|
||||
QString QAccessibleTableHeaderCell::text(QAccessible::Text t) const
|
||||
{
|
||||
QAbstractItemModel *model = view->model();
|
||||
QString value;
|
||||
|
|
@ -954,7 +951,7 @@ QString QAccessibleTableHeaderCell::text(Text t) const
|
|||
return value;
|
||||
}
|
||||
|
||||
void QAccessibleTableHeaderCell::setText(Text, const QString &)
|
||||
void QAccessibleTableHeaderCell::setText(QAccessible::Text, const QString &)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -981,7 +978,7 @@ QAccessibleInterface *QAccessibleTableHeaderCell::child(int) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
int QAccessibleTableHeaderCell::navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
int QAccessibleTableHeaderCell::navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const
|
||||
{
|
||||
if (relation == QAccessible::Ancestor && index == 1) {
|
||||
*iface = parent();
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ public:
|
|||
virtual ~QAccessibleTable();
|
||||
|
||||
QObject *object() const { return view; }
|
||||
Role role() const;
|
||||
State state() const;
|
||||
QString text(Text t) const;
|
||||
QAccessible::Role role() const;
|
||||
QAccessible::State state() const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
QRect rect() const;
|
||||
|
||||
int childAt(int x, int y) const;
|
||||
|
|
@ -77,10 +77,10 @@ public:
|
|||
|
||||
QAccessibleInterface *parent() const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
Relation relationTo(const QAccessibleInterface *other) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
|
||||
QVariant invokeMethod(Method, const QVariantList &) { return QVariant(); }
|
||||
QVariant invokeMethod(QAccessible::Method, const QVariantList &) { return QVariant(); }
|
||||
void *interface_cast(QAccessible::InterfaceType t);
|
||||
|
||||
// table interface
|
||||
|
|
@ -159,8 +159,8 @@ public:
|
|||
|
||||
int rowCount() const;
|
||||
|
||||
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
Relation relationTo(const QAccessibleInterface *other) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
|
||||
// table interface
|
||||
QAccessibleInterface *cellAt(int row, int column) const;
|
||||
|
|
@ -179,8 +179,8 @@ public:
|
|||
|
||||
void *interface_cast(QAccessible::InterfaceType t);
|
||||
QObject *object() const { return 0; }
|
||||
Role role() const;
|
||||
State state() const;
|
||||
QAccessible::Role role() const;
|
||||
QAccessible::State state() const;
|
||||
QRect rect() const;
|
||||
bool isValid() const;
|
||||
|
||||
|
|
@ -188,15 +188,13 @@ public:
|
|||
int childCount() const { return 0; }
|
||||
int indexOfChild(const QAccessibleInterface *) const { return -1; }
|
||||
|
||||
QString text(Text t) const;
|
||||
void setText(Text t, const QString &text);
|
||||
QString text(QAccessible::Text t) const;
|
||||
void setText(QAccessible::Text t, const QString &text);
|
||||
|
||||
QAccessibleInterface *parent() const;
|
||||
QAccessibleInterface *child(int) const;
|
||||
int navigate(RelationFlag relation, int m_index, QAccessibleInterface **iface) const;
|
||||
Relation relationTo(const QAccessibleInterface *other) const;
|
||||
|
||||
bool isExpandable() const;
|
||||
int navigate(QAccessible::RelationFlag relation, int m_index, QAccessibleInterface **iface) const;
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
|
||||
// cell interface
|
||||
virtual int columnExtent() const;
|
||||
|
|
@ -228,8 +226,8 @@ public:
|
|||
QAccessibleTableHeaderCell(QAbstractItemView *view, int index, Qt::Orientation orientation);
|
||||
|
||||
QObject *object() const { return 0; }
|
||||
Role role() const;
|
||||
State state() const;
|
||||
QAccessible::Role role() const;
|
||||
QAccessible::State state() const;
|
||||
QRect rect() const;
|
||||
bool isValid() const;
|
||||
|
||||
|
|
@ -237,13 +235,13 @@ public:
|
|||
int childCount() const { return 0; }
|
||||
int indexOfChild(const QAccessibleInterface *) const { return -1; }
|
||||
|
||||
QString text(Text t) const;
|
||||
void setText(Text t, const QString &text);
|
||||
QString text(QAccessible::Text t) const;
|
||||
void setText(QAccessible::Text t, const QString &text);
|
||||
|
||||
QAccessibleInterface *parent() const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const;
|
||||
QAccessible::Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
|
||||
|
||||
private:
|
||||
QAbstractItemView *view;
|
||||
|
|
@ -265,8 +263,8 @@ public:
|
|||
{}
|
||||
|
||||
QObject *object() const { return 0; }
|
||||
Role role() const { return QAccessible::Pane; }
|
||||
State state() const { return QAccessible::Normal; }
|
||||
QAccessible::Role role() const { return QAccessible::Pane; }
|
||||
QAccessible::State state() const { return QAccessible::Normal; }
|
||||
QRect rect() const { return QRect(); }
|
||||
bool isValid() const { return true; }
|
||||
|
||||
|
|
@ -274,8 +272,8 @@ public:
|
|||
int childCount() const { return 0; }
|
||||
int indexOfChild(const QAccessibleInterface *) const { return -1; }
|
||||
|
||||
QString text(Text) const { return QString(); }
|
||||
void setText(Text, const QString &) {}
|
||||
QString text(QAccessible::Text) const { return QString(); }
|
||||
void setText(QAccessible::Text, const QString &) {}
|
||||
|
||||
QAccessibleInterface *parent() const {
|
||||
return QAccessible::queryAccessibleInterface(view);
|
||||
|
|
@ -283,7 +281,7 @@ public:
|
|||
QAccessibleInterface *child(int) const {
|
||||
return 0;
|
||||
}
|
||||
int navigate(RelationFlag relation, int, QAccessibleInterface **iface) const
|
||||
int navigate(QAccessible::RelationFlag relation, int, QAccessibleInterface **iface) const
|
||||
{
|
||||
if (relation == QAccessible::Ancestor) {
|
||||
*iface = parent();
|
||||
|
|
@ -291,7 +289,7 @@ public:
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
Relation relationTo(int, const QAccessibleInterface *, int) const
|
||||
QAccessible::Relation relationTo(int, const QAccessibleInterface *, int) const
|
||||
{
|
||||
return QAccessible::Unrelated;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,41 +193,41 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
|||
#endif
|
||||
#ifndef QT_NO_TOOLBUTTON
|
||||
} else if (classname == QLatin1String("QToolButton")) {
|
||||
Role role = NoRole;
|
||||
QAccessible::Role role = QAccessible::NoRole;
|
||||
#ifndef QT_NO_MENU
|
||||
QToolButton *tb = qobject_cast<QToolButton*>(widget);
|
||||
if (!tb->menu())
|
||||
role = tb->isCheckable() ? CheckBox : PushButton;
|
||||
role = tb->isCheckable() ? QAccessible::CheckBox : QAccessible::PushButton;
|
||||
else if (!tb->popupMode() != QToolButton::DelayedPopup)
|
||||
role = ButtonDropDown;
|
||||
role = QAccessible::ButtonDropDown;
|
||||
else
|
||||
#endif
|
||||
role = ButtonMenu;
|
||||
role = QAccessible::ButtonMenu;
|
||||
iface = new QAccessibleToolButton(widget, role);
|
||||
#endif // QT_NO_TOOLBUTTON
|
||||
} else if (classname == QLatin1String("QCheckBox")) {
|
||||
iface = new QAccessibleButton(widget, CheckBox);
|
||||
iface = new QAccessibleButton(widget, QAccessible::CheckBox);
|
||||
} else if (classname == QLatin1String("QRadioButton")) {
|
||||
iface = new QAccessibleButton(widget, RadioButton);
|
||||
iface = new QAccessibleButton(widget, QAccessible::RadioButton);
|
||||
} else if (classname == QLatin1String("QPushButton")) {
|
||||
Role role = NoRole;
|
||||
QAccessible::Role role = QAccessible::NoRole;
|
||||
QPushButton *pb = qobject_cast<QPushButton*>(widget);
|
||||
#ifndef QT_NO_MENU
|
||||
if (pb->menu())
|
||||
role = ButtonMenu;
|
||||
role = QAccessible::ButtonMenu;
|
||||
else
|
||||
#endif
|
||||
if (pb->isCheckable())
|
||||
role = CheckBox;
|
||||
role = QAccessible::CheckBox;
|
||||
else
|
||||
role = PushButton;
|
||||
role = QAccessible::PushButton;
|
||||
iface = new QAccessibleButton(widget, role);
|
||||
} else if (classname == QLatin1String("QAbstractButton")) {
|
||||
iface = new QAccessibleButton(widget, PushButton);
|
||||
iface = new QAccessibleButton(widget, QAccessible::PushButton);
|
||||
} else if (classname == QLatin1String("QDialog")) {
|
||||
iface = new QAccessibleWidget(widget, Dialog);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::Dialog);
|
||||
} else if (classname == QLatin1String("QMessageBox")) {
|
||||
iface = new QAccessibleWidget(widget, AlertMessage);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::AlertMessage);
|
||||
#ifndef QT_NO_MAINWINDOW
|
||||
} else if (classname == QLatin1String("QMainWindow")) {
|
||||
iface = new QAccessibleMainWindow(widget);
|
||||
|
|
@ -235,15 +235,15 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
|||
} else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
|
||||
iface = new QAccessibleDisplay(widget);
|
||||
} else if (classname == QLatin1String("QGroupBox")) {
|
||||
iface = new QAccessibleDisplay(widget, Grouping);
|
||||
iface = new QAccessibleDisplay(widget, QAccessible::Grouping);
|
||||
} else if (classname == QLatin1String("QStatusBar")) {
|
||||
iface = new QAccessibleWidget(widget, StatusBar);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::StatusBar);
|
||||
#ifndef QT_NO_PROGRESSBAR
|
||||
} else if (classname == QLatin1String("QProgressBar")) {
|
||||
iface = new QAccessibleProgressBar(widget);
|
||||
#endif
|
||||
} else if (classname == QLatin1String("QToolBar")) {
|
||||
iface = new QAccessibleWidget(widget, ToolBar, widget->windowTitle());
|
||||
iface = new QAccessibleWidget(widget, QAccessible::ToolBar, widget->windowTitle());
|
||||
#ifndef QT_NO_MENUBAR
|
||||
} else if (classname == QLatin1String("QMenuBar")) {
|
||||
iface = new QAccessibleMenuBar(widget);
|
||||
|
|
@ -275,23 +275,23 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
|||
iface = new QAccessibleTabBar(widget);
|
||||
#endif
|
||||
} else if (classname == QLatin1String("QWorkspaceChild")) {
|
||||
iface = new QAccessibleWidget(widget, Window);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::Window);
|
||||
} else if (classname == QLatin1String("QSizeGrip")) {
|
||||
iface = new QAccessibleWidget(widget, Grip);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::Grip);
|
||||
#ifndef QT_NO_SPLITTER
|
||||
} else if (classname == QLatin1String("QSplitter")) {
|
||||
iface = new QAccessibleWidget(widget, Splitter);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::Splitter);
|
||||
} else if (classname == QLatin1String("QSplitterHandle")) {
|
||||
iface = new QAccessibleWidget(widget, Grip);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::Grip);
|
||||
#endif
|
||||
#ifndef QT_NO_TEXTEDIT
|
||||
} else if (classname == QLatin1String("QTextEdit")) {
|
||||
iface = new QAccessibleTextEdit(widget);
|
||||
#endif
|
||||
} else if (classname == QLatin1String("QTipLabel")) {
|
||||
iface = new QAccessibleDisplay(widget, ToolTip);
|
||||
iface = new QAccessibleDisplay(widget, QAccessible::ToolTip);
|
||||
} else if (classname == QLatin1String("QFrame")) {
|
||||
iface = new QAccessibleWidget(widget, Border);
|
||||
iface = new QAccessibleWidget(widget, QAccessible::Border);
|
||||
#ifndef QT_NO_STACKEDWIDGET
|
||||
} else if (classname == QLatin1String("QStackedWidget")) {
|
||||
iface = new QAccessibleStackedWidget(widget);
|
||||
|
|
|
|||
|
|
@ -79,20 +79,20 @@ int QAccessibleMenu::childAt(int x, int y) const
|
|||
return menu()->actions().indexOf(act) + 1;
|
||||
}
|
||||
|
||||
QString QAccessibleMenu::text(Text t) const
|
||||
QString QAccessibleMenu::text(QAccessible::Text t) const
|
||||
{
|
||||
QString tx = QAccessibleWidget::text(t);
|
||||
if (!tx.isEmpty())
|
||||
return tx;
|
||||
|
||||
if (t == Name)
|
||||
if (t == QAccessible::Name)
|
||||
return menu()->windowTitle();
|
||||
return tx;
|
||||
}
|
||||
|
||||
QAccessible::Role QAccessibleMenu::role() const
|
||||
{
|
||||
return PopupMenu;
|
||||
return QAccessible::PopupMenu;
|
||||
}
|
||||
|
||||
QAccessibleInterface *QAccessibleMenu::child(int index) const
|
||||
|
|
@ -111,14 +111,14 @@ QAccessibleInterface *QAccessibleMenu::parent() const
|
|||
return QAccessibleWidget::parent();
|
||||
}
|
||||
|
||||
int QAccessibleMenu::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleMenu::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
Q_ASSERT(entry >= 0);
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
*target = child(entry - 1);
|
||||
return *target ? 0 : -1;
|
||||
case Ancestor:
|
||||
case QAccessible::Ancestor:
|
||||
*target = parent();
|
||||
return *target ? 0 : -1;
|
||||
default:
|
||||
|
|
@ -129,8 +129,8 @@ int QAccessibleMenu::navigate(RelationFlag relation, int entry, QAccessibleInter
|
|||
int QAccessibleMenu::indexOfChild( const QAccessibleInterface *child) const
|
||||
{
|
||||
int index = -1;
|
||||
Role r = child->role();
|
||||
if ((r == MenuItem || r == Separator) && menu()) {
|
||||
QAccessible::Role r = child->role();
|
||||
if ((r == QAccessible::MenuItem || r == QAccessible::Separator) && menu()) {
|
||||
index = menu()->actions().indexOf(qobject_cast<QAction*>(child->object()));
|
||||
if (index != -1)
|
||||
++index;
|
||||
|
|
@ -140,7 +140,7 @@ int QAccessibleMenu::indexOfChild( const QAccessibleInterface *child) const
|
|||
|
||||
#ifndef QT_NO_MENUBAR
|
||||
QAccessibleMenuBar::QAccessibleMenuBar(QWidget *w)
|
||||
: QAccessibleWidget(w, MenuBar)
|
||||
: QAccessibleWidget(w, QAccessible::MenuBar)
|
||||
{
|
||||
Q_ASSERT(menuBar());
|
||||
}
|
||||
|
|
@ -162,9 +162,9 @@ QAccessibleInterface *QAccessibleMenuBar::child(int index) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
int QAccessibleMenuBar::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleMenuBar::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
if (relation == Child) {
|
||||
if (relation == QAccessible::Child) {
|
||||
*target = child(entry - 1);
|
||||
return *target ? 0 : -1;
|
||||
}
|
||||
|
|
@ -174,8 +174,8 @@ int QAccessibleMenuBar::navigate(RelationFlag relation, int entry, QAccessibleIn
|
|||
int QAccessibleMenuBar::indexOfChild(const QAccessibleInterface *child) const
|
||||
{
|
||||
int index = -1;
|
||||
Role r = child->role();
|
||||
if ((r == MenuItem || r == Separator) && menuBar()) {
|
||||
QAccessible::Role r = child->role();
|
||||
if ((r == QAccessible::MenuItem || r == QAccessible::Separator) && menuBar()) {
|
||||
index = menuBar()->actions().indexOf(qobject_cast<QAction*>(child->object()));
|
||||
if (index != -1)
|
||||
++index;
|
||||
|
|
@ -214,7 +214,7 @@ int QAccessibleMenuItem::childCount() const
|
|||
int QAccessibleMenuItem::indexOfChild(const QAccessibleInterface * child) const
|
||||
{
|
||||
Q_ASSERT(child == 0);
|
||||
if (child->role() == PopupMenu && child->object() == m_action->menu())
|
||||
if (child->role() == QAccessible::PopupMenu && child->object() == m_action->menu())
|
||||
return 1;
|
||||
|
||||
return -1;
|
||||
|
|
@ -237,7 +237,7 @@ QAccessibleInterface *QAccessibleMenuItem::child(int index) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
int QAccessibleMenuItem::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleMenuItem::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
*target = 0;
|
||||
if (entry < 0) {
|
||||
|
|
@ -245,26 +245,26 @@ int QAccessibleMenuItem::navigate(RelationFlag relation, int entry, QAccessibleI
|
|||
}
|
||||
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
*target = child(entry - 1);
|
||||
break;
|
||||
case Ancestor:
|
||||
case QAccessible::Ancestor:
|
||||
*target = parent();
|
||||
break;
|
||||
case Up:
|
||||
case Down:{
|
||||
case QAccessible::Up:
|
||||
case QAccessible::Down:{
|
||||
QAccessibleInterface *parentIface = parent();
|
||||
if (parentIface) {
|
||||
int index = parentIface->indexOfChild(this);
|
||||
if (index != -1) {
|
||||
index += (relation == Down ? +1 : -1);
|
||||
index += (relation == QAccessible::Down ? +1 : -1);
|
||||
*target = parentIface->child(index - 1);
|
||||
}
|
||||
}
|
||||
delete parentIface;
|
||||
break;
|
||||
}
|
||||
case Sibling: {
|
||||
case QAccessible::Sibling: {
|
||||
QAccessibleInterface *parentIface = parent();
|
||||
if (parentIface)
|
||||
*target = parentIface->child(entry - 1);
|
||||
|
|
@ -312,59 +312,59 @@ QRect QAccessibleMenuItem::rect() const
|
|||
QAccessible::Relation QAccessibleMenuItem::relationTo(const QAccessibleInterface *other) const
|
||||
{
|
||||
if (other->object() == owner()) {
|
||||
return Child;
|
||||
return QAccessible::Child;
|
||||
}
|
||||
Q_UNUSED(other)
|
||||
// ###
|
||||
return Unrelated;
|
||||
return QAccessible::Unrelated;
|
||||
}
|
||||
|
||||
QAccessible::Role QAccessibleMenuItem::role() const
|
||||
{
|
||||
return m_action->isSeparator() ? Separator : MenuItem;
|
||||
return m_action->isSeparator() ? QAccessible::Separator : QAccessible::MenuItem;
|
||||
}
|
||||
|
||||
void QAccessibleMenuItem::setText ( Text /*t*/, const QString & /*text */)
|
||||
void QAccessibleMenuItem::setText(QAccessible::Text /*t*/, const QString & /*text */)
|
||||
{
|
||||
}
|
||||
|
||||
QAccessible::State QAccessibleMenuItem::state() const
|
||||
{
|
||||
QAccessible::State s = Normal;
|
||||
QAccessible::State s = QAccessible::Normal;
|
||||
QWidget *own = owner();
|
||||
|
||||
if (own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false) {
|
||||
s |= Invisible;
|
||||
s |= QAccessible::Invisible;
|
||||
}
|
||||
|
||||
if (QMenu *menu = qobject_cast<QMenu*>(own)) {
|
||||
if (menu->activeAction() == m_action)
|
||||
s |= Focused;
|
||||
s |= QAccessible::Focused;
|
||||
#ifndef QT_NO_MENUBAR
|
||||
} else if (QMenuBar *menuBar = qobject_cast<QMenuBar*>(own)) {
|
||||
if (menuBar->activeAction() == m_action)
|
||||
s |= Focused;
|
||||
s |= QAccessible::Focused;
|
||||
#endif
|
||||
}
|
||||
if (own->style()->styleHint(QStyle::SH_Menu_MouseTracking))
|
||||
s |= HotTracked;
|
||||
s |= QAccessible::HotTracked;
|
||||
if (m_action->isSeparator() || !m_action->isEnabled())
|
||||
s |= Unavailable;
|
||||
s |= QAccessible::Unavailable;
|
||||
if (m_action->isChecked())
|
||||
s |= Checked;
|
||||
s |= QAccessible::Checked;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
QString QAccessibleMenuItem::text(Text t) const
|
||||
QString QAccessibleMenuItem::text(QAccessible::Text t) const
|
||||
{
|
||||
QString str;
|
||||
switch (t) {
|
||||
case Name:
|
||||
case QAccessible::Name:
|
||||
str = m_action->text();
|
||||
str = qt_accStripAmp(str);
|
||||
break;
|
||||
case Accelerator: {
|
||||
case QAccessible::Accelerator: {
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
QKeySequence key = m_action->shortcut();
|
||||
if (!key.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ public:
|
|||
int childCount() const;
|
||||
int childAt(int x, int y) const;
|
||||
|
||||
QString text(Text t) const;
|
||||
Role role() const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
QAccessible::Role role() const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
QAccessibleInterface *parent() const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int indexOfChild( const QAccessibleInterface *child ) const;
|
||||
|
||||
protected:
|
||||
|
|
@ -81,7 +81,7 @@ public:
|
|||
QAccessibleInterface *child(int index) const;
|
||||
int childCount() const;
|
||||
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ static int qTextBlockPosition(QTextBlock block)
|
|||
Constructs a QAccessibleTextEdit object for a \a widget.
|
||||
*/
|
||||
QAccessibleTextEdit::QAccessibleTextEdit(QWidget *o)
|
||||
: QAccessibleWidget(o, EditableText)
|
||||
: QAccessibleWidget(o, QAccessible::EditableText)
|
||||
{
|
||||
Q_ASSERT(widget()->inherits("QTextEdit"));
|
||||
}
|
||||
|
|
@ -262,17 +262,17 @@ QTextEdit *QAccessibleTextEdit::textEdit() const
|
|||
return static_cast<QTextEdit *>(widget());
|
||||
}
|
||||
|
||||
QString QAccessibleTextEdit::text(Text t) const
|
||||
QString QAccessibleTextEdit::text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == Value)
|
||||
if (t == QAccessible::Value)
|
||||
return textEdit()->toPlainText();
|
||||
|
||||
return QAccessibleWidget::text(t);
|
||||
}
|
||||
|
||||
void QAccessibleTextEdit::setText(Text t, const QString &text)
|
||||
void QAccessibleTextEdit::setText(QAccessible::Text t, const QString &text)
|
||||
{
|
||||
if (t != Value) {
|
||||
if (t != QAccessible::Value) {
|
||||
QAccessibleWidget::setText(t, text);
|
||||
return;
|
||||
}
|
||||
|
|
@ -286,16 +286,16 @@ QVariant QAccessibleTextEdit::invokeMethod(QAccessible::Method method,
|
|||
const QVariantList ¶ms)
|
||||
{
|
||||
switch (method) {
|
||||
case ListSupportedMethods: {
|
||||
case QAccessible::ListSupportedMethods: {
|
||||
QSet<QAccessible::Method> set;
|
||||
set << ListSupportedMethods << SetCursorPosition << GetCursorPosition;
|
||||
set << QAccessible::ListSupportedMethods << QAccessible::SetCursorPosition << QAccessible::GetCursorPosition;
|
||||
return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
|
||||
QAccessibleWidget::invokeMethod(method, params)));
|
||||
}
|
||||
case SetCursorPosition:
|
||||
case QAccessible::SetCursorPosition:
|
||||
setCursorPosition(params.value(0).toInt());
|
||||
return true;
|
||||
case GetCursorPosition:
|
||||
case QAccessible::GetCursorPosition:
|
||||
return textEdit()->textCursor().position();
|
||||
default:
|
||||
return QAccessibleWidget::invokeMethod(method, params);
|
||||
|
|
@ -711,7 +711,7 @@ void QAccessibleTextEdit::setAttributes(int startOffset, int endOffset, const QS
|
|||
#ifndef QT_NO_STACKEDWIDGET
|
||||
// ======================= QAccessibleStackedWidget ======================
|
||||
QAccessibleStackedWidget::QAccessibleStackedWidget(QWidget *widget)
|
||||
: QAccessibleWidget(widget, LayeredPane)
|
||||
: QAccessibleWidget(widget, QAccessible::LayeredPane)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QStackedWidget *>(widget));
|
||||
}
|
||||
|
|
@ -759,10 +759,10 @@ QAccessibleInterface *QAccessibleStackedWidget::child(int index) const
|
|||
return QAccessible::queryAccessibleInterface(stackedWidget()->widget(index));
|
||||
}
|
||||
|
||||
int QAccessibleStackedWidget::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleStackedWidget::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
*target = child(entry - 1);
|
||||
return *target ? 0 : -1;
|
||||
default:
|
||||
|
|
@ -779,7 +779,7 @@ QStackedWidget *QAccessibleStackedWidget::stackedWidget() const
|
|||
#ifndef QT_NO_TOOLBOX
|
||||
// ======================= QAccessibleToolBox ======================
|
||||
QAccessibleToolBox::QAccessibleToolBox(QWidget *widget)
|
||||
: QAccessibleWidget(widget, LayeredPane)
|
||||
: QAccessibleWidget(widget, QAccessible::LayeredPane)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QToolBox *>(widget));
|
||||
}
|
||||
|
|
@ -793,7 +793,7 @@ QToolBox * QAccessibleToolBox::toolBox() const
|
|||
// ======================= QAccessibleMdiArea ======================
|
||||
#ifndef QT_NO_MDIAREA
|
||||
QAccessibleMdiArea::QAccessibleMdiArea(QWidget *widget)
|
||||
: QAccessibleWidget(widget, LayeredPane)
|
||||
: QAccessibleWidget(widget, QAccessible::LayeredPane)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QMdiArea *>(widget));
|
||||
}
|
||||
|
|
@ -815,21 +815,21 @@ int QAccessibleMdiArea::indexOfChild(const QAccessibleInterface *child) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
int QAccessibleMdiArea::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleMdiArea::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
*target = 0;
|
||||
QWidget *targetObject = 0;
|
||||
QList<QMdiSubWindow *> subWindows = mdiArea()->subWindowList();
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
if (entry < 1 || subWindows.isEmpty() || entry > subWindows.count())
|
||||
return -1;
|
||||
targetObject = subWindows.at(entry - 1);
|
||||
break;
|
||||
case Up:
|
||||
case Down:
|
||||
case Left:
|
||||
case Right:
|
||||
case QAccessible::Up:
|
||||
case QAccessible::Down:
|
||||
case QAccessible::Left:
|
||||
case QAccessible::Right:
|
||||
targetObject = mdiAreaNavigate(mdiArea(), relation, entry);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -851,7 +851,7 @@ QAccessibleMdiSubWindow::QAccessibleMdiSubWindow(QWidget *widget)
|
|||
Q_ASSERT(qobject_cast<QMdiSubWindow *>(widget));
|
||||
}
|
||||
|
||||
QString QAccessibleMdiSubWindow::text(Text textType) const
|
||||
QString QAccessibleMdiSubWindow::text(QAccessible::Text textType) const
|
||||
{
|
||||
if (textType == QAccessible::Name) {
|
||||
QString title = mdiSubWindow()->windowTitle();
|
||||
|
|
@ -861,7 +861,7 @@ QString QAccessibleMdiSubWindow::text(Text textType) const
|
|||
return QAccessibleWidget::text(textType);
|
||||
}
|
||||
|
||||
void QAccessibleMdiSubWindow::setText(Text textType, const QString &text)
|
||||
void QAccessibleMdiSubWindow::setText(QAccessible::Text textType, const QString &text)
|
||||
{
|
||||
if (textType == QAccessible::Name)
|
||||
mdiSubWindow()->setWindowTitle(text);
|
||||
|
|
@ -900,7 +900,7 @@ int QAccessibleMdiSubWindow::indexOfChild(const QAccessibleInterface *child) con
|
|||
return -1;
|
||||
}
|
||||
|
||||
int QAccessibleMdiSubWindow::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleMdiSubWindow::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
*target = 0;
|
||||
|
||||
|
|
@ -910,15 +910,15 @@ int QAccessibleMdiSubWindow::navigate(RelationFlag relation, int entry, QAccessi
|
|||
QWidget *targetObject = 0;
|
||||
QMdiSubWindow *source = mdiSubWindow();
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
if (entry != 1 || !source->widget())
|
||||
return -1;
|
||||
targetObject = source->widget();
|
||||
break;
|
||||
case Up:
|
||||
case Down:
|
||||
case Left:
|
||||
case Right: {
|
||||
case QAccessible::Up:
|
||||
case QAccessible::Down:
|
||||
case QAccessible::Left:
|
||||
case QAccessible::Right: {
|
||||
if (entry != 0)
|
||||
break;
|
||||
QWidget *parent = source->parentWidget();
|
||||
|
|
@ -981,7 +981,7 @@ QMdiSubWindow *QAccessibleMdiSubWindow::mdiSubWindow() const
|
|||
// ======================= QAccessibleWorkspace ======================
|
||||
#ifndef QT_NO_WORKSPACE
|
||||
QAccessibleWorkspace::QAccessibleWorkspace(QWidget *widget)
|
||||
: QAccessibleWidget(widget, LayeredPane)
|
||||
: QAccessibleWidget(widget, QAccessible::LayeredPane)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QWorkspace *>(widget));
|
||||
}
|
||||
|
|
@ -1003,21 +1003,21 @@ int QAccessibleWorkspace::indexOfChild(const QAccessibleInterface *child) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
int QAccessibleWorkspace::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleWorkspace::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
*target = 0;
|
||||
QWidget *targetObject = 0;
|
||||
QWidgetList subWindows = workspace()->windowList();
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
if (entry < 1 || subWindows.isEmpty() || entry > subWindows.count())
|
||||
return -1;
|
||||
targetObject = subWindows.at(entry - 1);
|
||||
break;
|
||||
case Up:
|
||||
case Down:
|
||||
case Left:
|
||||
case Right:
|
||||
case QAccessible::Up:
|
||||
case QAccessible::Down:
|
||||
case QAccessible::Left:
|
||||
case QAccessible::Right:
|
||||
targetObject = mdiAreaNavigate(workspace(), relation, entry);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1036,7 +1036,7 @@ QWorkspace *QAccessibleWorkspace::workspace() const
|
|||
#ifndef QT_NO_DIALOGBUTTONBOX
|
||||
// ======================= QAccessibleDialogButtonBox ======================
|
||||
QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
|
||||
: QAccessibleWidget(widget, Grouping)
|
||||
: QAccessibleWidget(widget, QAccessible::Grouping)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QDialogButtonBox*>(widget));
|
||||
}
|
||||
|
|
@ -1063,7 +1063,7 @@ QAccessible::Role QAccessibleTextBrowser::role() const
|
|||
#ifndef QT_NO_CALENDARWIDGET
|
||||
// ===================== QAccessibleCalendarWidget ========================
|
||||
QAccessibleCalendarWidget::QAccessibleCalendarWidget(QWidget *widget)
|
||||
: QAccessibleWidget(widget, Table)
|
||||
: QAccessibleWidget(widget, QAccessible::Table)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QCalendarWidget *>(widget));
|
||||
}
|
||||
|
|
@ -1093,33 +1093,33 @@ QAccessibleInterface *QAccessibleCalendarWidget::child(int index) const
|
|||
return 0;
|
||||
|
||||
if (childCount() > 1 && index == 0)
|
||||
return queryAccessibleInterface(navigationBar());
|
||||
return QAccessible::queryAccessibleInterface(navigationBar());
|
||||
|
||||
return queryAccessibleInterface(calendarView());
|
||||
return QAccessible::queryAccessibleInterface(calendarView());
|
||||
}
|
||||
|
||||
int QAccessibleCalendarWidget::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleCalendarWidget::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
*target = 0;
|
||||
if (entry <= 0 || entry > childCount())
|
||||
return QAccessibleWidget::navigate(relation, entry, target);
|
||||
QWidget *targetWidget = 0;
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
*target = child(entry - 1);
|
||||
return *target ? 0 : -1;
|
||||
case Up:
|
||||
case QAccessible::Up:
|
||||
if (entry == 2)
|
||||
targetWidget = navigationBar();
|
||||
break;
|
||||
case Down:
|
||||
case QAccessible::Down:
|
||||
if (entry == 1 && childCount() == 2)
|
||||
targetWidget = calendarView();
|
||||
break;
|
||||
default:
|
||||
return QAccessibleWidget::navigate(relation, entry, target);
|
||||
}
|
||||
*target = queryAccessibleInterface(targetWidget);
|
||||
*target = QAccessible::queryAccessibleInterface(targetWidget);
|
||||
return *target ? 0 : -1;
|
||||
}
|
||||
|
||||
|
|
@ -1149,7 +1149,7 @@ QWidget *QAccessibleCalendarWidget::navigationBar() const
|
|||
|
||||
#ifndef QT_NO_DOCKWIDGET
|
||||
QAccessibleDockWidget::QAccessibleDockWidget(QWidget *widget)
|
||||
: QAccessibleWidget(widget, Window)
|
||||
: QAccessibleWidget(widget, QAccessible::Window)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -1172,7 +1172,7 @@ int QAccessibleDockWidget::childCount() const
|
|||
int QAccessibleDockWidget::indexOfChild(const QAccessibleInterface *child) const
|
||||
{
|
||||
if (child) {
|
||||
if (child->role() == TitleBar) {
|
||||
if (child->role() == QAccessible::TitleBar) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2; //###
|
||||
|
|
@ -1183,7 +1183,7 @@ int QAccessibleDockWidget::indexOfChild(const QAccessibleInterface *child) const
|
|||
|
||||
QAccessible::Role QAccessibleDockWidget::role() const
|
||||
{
|
||||
return Window;
|
||||
return QAccessible::Window;
|
||||
}
|
||||
|
||||
QRect QAccessibleDockWidget::rect() const
|
||||
|
|
@ -1237,13 +1237,13 @@ QAccessibleInterface *QAccessibleTitleBar::child(int index) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
int QAccessibleTitleBar::navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const
|
||||
int QAccessibleTitleBar::navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **iface) const
|
||||
{
|
||||
switch (relation) {
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
*iface = child(entry - 1);
|
||||
return *iface ? 0 : -1;
|
||||
case FocusChild:
|
||||
case QAccessible::FocusChild:
|
||||
// ###
|
||||
if (entry >= 1) {
|
||||
QDockWidgetLayout *layout = dockWidgetLayout();
|
||||
|
|
@ -1261,7 +1261,7 @@ int QAccessibleTitleBar::navigate(RelationFlag relation, int entry, QAccessibleI
|
|||
return role > QDockWidgetLayout::FloatButton ? -1 : index;
|
||||
}
|
||||
break;
|
||||
case Ancestor:
|
||||
case QAccessible::Ancestor:
|
||||
*iface = parent();
|
||||
return iface ? 0 : -1;
|
||||
default:
|
||||
|
|
@ -1273,7 +1273,7 @@ int QAccessibleTitleBar::navigate(RelationFlag relation, int entry, QAccessibleI
|
|||
|
||||
QAccessible::Relation QAccessibleTitleBar::relationTo(const QAccessibleInterface * /*otherChild*/) const
|
||||
{
|
||||
return Unrelated; //###
|
||||
return QAccessible::Unrelated; //###
|
||||
}
|
||||
|
||||
int QAccessibleTitleBar::indexOfChild(const QAccessibleInterface * /*child*/) const
|
||||
|
|
@ -1293,9 +1293,9 @@ int QAccessibleTitleBar::childCount() const
|
|||
return count;
|
||||
}
|
||||
|
||||
QString QAccessibleTitleBar::text(Text t) const
|
||||
QString QAccessibleTitleBar::text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == Name || t == Value) {
|
||||
if (t == QAccessible::Name || t == QAccessible::Value) {
|
||||
return qt_accStripAmp(dockWidget()->windowTitle());
|
||||
}
|
||||
return QString();
|
||||
|
|
@ -1303,17 +1303,17 @@ QString QAccessibleTitleBar::text(Text t) const
|
|||
|
||||
QAccessible::State QAccessibleTitleBar::state() const
|
||||
{
|
||||
QAccessible::State state = Normal;
|
||||
QAccessible::State state = QAccessible::Normal;
|
||||
|
||||
QDockWidget *w = dockWidget();
|
||||
if (w->testAttribute(Qt::WA_WState_Visible) == false)
|
||||
state |= Invisible;
|
||||
state |= QAccessible::Invisible;
|
||||
if (w->focusPolicy() != Qt::NoFocus && w->isActiveWindow())
|
||||
state |= Focusable;
|
||||
state |= QAccessible::Focusable;
|
||||
if (w->hasFocus())
|
||||
state |= Focused;
|
||||
state |= QAccessible::Focused;
|
||||
if (!w->isEnabled())
|
||||
state |= Unavailable;
|
||||
state |= QAccessible::Unavailable;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
|
@ -1418,10 +1418,10 @@ QDockWidget *QAccessibleTitleBar::dockWidget() const
|
|||
|
||||
QAccessible::Role QAccessibleTitleBar::role() const
|
||||
{
|
||||
return TitleBar;
|
||||
return QAccessible::TitleBar;
|
||||
}
|
||||
|
||||
void QAccessibleTitleBar::setText(Text /*t*/, const QString &/*text*/)
|
||||
void QAccessibleTitleBar::setText(QAccessible::Text /*t*/, const QString &/*text*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1434,7 +1434,7 @@ bool QAccessibleTitleBar::isValid() const
|
|||
|
||||
#ifndef QT_NO_MAINWINDOW
|
||||
QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget)
|
||||
: QAccessibleWidget(widget, Window) { }
|
||||
: QAccessibleWidget(widget, QAccessible::Window) { }
|
||||
|
||||
QVariant QAccessibleMainWindow::invokeMethod(QAccessible::Method /*method*/, int /*child*/, const QVariantList & /*params*/)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ class QAccessibleTextEdit : public QAccessibleWidget, public QAccessibleTextInte
|
|||
public:
|
||||
explicit QAccessibleTextEdit(QWidget *o);
|
||||
|
||||
QString text(Text t) const;
|
||||
void setText(Text t, const QString &text);
|
||||
QString text(QAccessible::Text t) const;
|
||||
void setText(QAccessible::Text t, const QString &text);
|
||||
|
||||
QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
|
||||
void *interface_cast(QAccessible::InterfaceType t);
|
||||
|
|
@ -126,7 +126,7 @@ public:
|
|||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
|
||||
protected:
|
||||
QStackedWidget *stackedWidget() const;
|
||||
|
|
@ -155,7 +155,7 @@ public:
|
|||
|
||||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
|
||||
protected:
|
||||
QMdiArea *mdiArea() const;
|
||||
|
|
@ -166,12 +166,12 @@ class QAccessibleMdiSubWindow : public QAccessibleWidget
|
|||
public:
|
||||
explicit QAccessibleMdiSubWindow(QWidget *widget);
|
||||
|
||||
QString text(Text textType) const;
|
||||
void setText(Text textType, const QString &text);
|
||||
State state() const;
|
||||
QString text(QAccessible::Text textType) const;
|
||||
void setText(QAccessible::Text textType, const QString &text);
|
||||
QAccessible::State state() const;
|
||||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
QRect rect() const;
|
||||
int childAt(int x, int y) const;
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ public:
|
|||
|
||||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
|
||||
protected:
|
||||
QWorkspace *workspace() const;
|
||||
|
|
@ -209,7 +209,7 @@ class QAccessibleTextBrowser : public QAccessibleTextEdit
|
|||
public:
|
||||
explicit QAccessibleTextBrowser(QWidget *widget);
|
||||
|
||||
Role role() const;
|
||||
QAccessible::Role role() const;
|
||||
};
|
||||
#endif // QT_NO_TEXTBROWSER
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ public:
|
|||
|
||||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
||||
|
||||
QAccessibleInterface *child(int index) const;
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ public:
|
|||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
int childCount() const;
|
||||
QRect rect () const;
|
||||
Role role() const;
|
||||
QAccessible::Role role() const;
|
||||
|
||||
QDockWidget *dockWidget() const;
|
||||
};
|
||||
|
|
@ -257,15 +257,15 @@ public:
|
|||
|
||||
QAccessibleInterface *parent() const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
|
||||
int navigate(QAccessible::RelationFlag relation, int entry, QAccessibleInterface **iface) const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
int childCount() const;
|
||||
Relation relationTo(const QAccessibleInterface *other) const;
|
||||
void setText(Text t, const QString &text);
|
||||
QString text(Text t) const;
|
||||
Role role() const;
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
void setText(QAccessible::Text t, const QString &text);
|
||||
QString text(QAccessible::Text t) const;
|
||||
QAccessible::Role role() const;
|
||||
QRect rect () const;
|
||||
State state() const;
|
||||
QAccessible::State state() const;
|
||||
int childAt(int x, int y) const;
|
||||
QObject *object() const;
|
||||
bool isValid() const;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ extern QStyleOptionSlider Q_GUI_EXPORT qt_qsliderStyleOption(QSlider *slider);
|
|||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w)
|
||||
: QAccessibleWidget(w, SpinBox)
|
||||
: QAccessibleWidget(w, QAccessible::SpinBox)
|
||||
{
|
||||
Q_ASSERT(abstractSpinBox());
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ QAbstractSpinBox *QAccessibleAbstractSpinBox::abstractSpinBox() const
|
|||
return qobject_cast<QAbstractSpinBox*>(object());
|
||||
}
|
||||
|
||||
QString QAccessibleAbstractSpinBox::text(Text t) const
|
||||
QString QAccessibleAbstractSpinBox::text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == QAccessible::Value)
|
||||
return abstractSpinBox()->text();
|
||||
|
|
@ -167,9 +167,9 @@ QDoubleSpinBox *QAccessibleDoubleSpinBox::doubleSpinBox() const
|
|||
return static_cast<QDoubleSpinBox*>(object());
|
||||
}
|
||||
|
||||
QString QAccessibleDoubleSpinBox::text(Text textType) const
|
||||
QString QAccessibleDoubleSpinBox::text(QAccessible::Text textType) const
|
||||
{
|
||||
if (textType == Value)
|
||||
if (textType == QAccessible::Value)
|
||||
return doubleSpinBox()->textFromValue(doubleSpinBox()->value());
|
||||
return QAccessibleWidget::text(textType);
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ QString QAccessibleDoubleSpinBox::text(Text textType) const
|
|||
\a name is propagated to the QAccessibleWidget constructor.
|
||||
*/
|
||||
QAccessibleScrollBar::QAccessibleScrollBar(QWidget *w)
|
||||
: QAccessibleAbstractSlider(w, ScrollBar)
|
||||
: QAccessibleAbstractSlider(w, QAccessible::ScrollBar)
|
||||
{
|
||||
Q_ASSERT(scrollBar());
|
||||
addControllingSignal(QLatin1String("valueChanged(int)"));
|
||||
|
|
@ -202,9 +202,9 @@ QScrollBar *QAccessibleScrollBar::scrollBar() const
|
|||
return qobject_cast<QScrollBar*>(object());
|
||||
}
|
||||
|
||||
QString QAccessibleScrollBar::text(Text t) const
|
||||
QString QAccessibleScrollBar::text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == Value)
|
||||
if (t == QAccessible::Value)
|
||||
return QString::number(scrollBar()->value());
|
||||
return QAccessibleAbstractSlider::text(t);
|
||||
}
|
||||
|
|
@ -237,15 +237,15 @@ QSlider *QAccessibleSlider::slider() const
|
|||
return qobject_cast<QSlider*>(object());
|
||||
}
|
||||
|
||||
QString QAccessibleSlider::text(Text t) const
|
||||
QString QAccessibleSlider::text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == Value)
|
||||
if (t == QAccessible::Value)
|
||||
return QString::number(slider()->value());
|
||||
|
||||
return QAccessibleAbstractSlider::text(t);
|
||||
}
|
||||
|
||||
QAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, Role r)
|
||||
QAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, QAccessible::Role r)
|
||||
: QAccessibleWidget(w, r)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QAbstractSlider *>(w));
|
||||
|
|
@ -288,15 +288,15 @@ QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
|
|||
#ifndef QT_NO_DIAL
|
||||
// ======================================= QAccessibleDial ======================================
|
||||
QAccessibleDial::QAccessibleDial(QWidget *widget)
|
||||
: QAccessibleAbstractSlider(widget, Dial)
|
||||
: QAccessibleAbstractSlider(widget, QAccessible::Dial)
|
||||
{
|
||||
Q_ASSERT(qobject_cast<QDial *>(widget));
|
||||
addControllingSignal(QLatin1String("valueChanged(int)"));
|
||||
}
|
||||
|
||||
QString QAccessibleDial::text(Text textType) const
|
||||
QString QAccessibleDial::text(QAccessible::Text textType) const
|
||||
{
|
||||
if (textType == Value)
|
||||
if (textType == QAccessible::Value)
|
||||
return QString::number(dial()->value());
|
||||
|
||||
return QAccessibleAbstractSlider::text(textType);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class QAccessibleAbstractSpinBox: public QAccessibleWidget, public QAccessibleVa
|
|||
public:
|
||||
explicit QAccessibleAbstractSpinBox(QWidget *w);
|
||||
|
||||
QString text(Text t) const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
void *interface_cast(QAccessible::InterfaceType t);
|
||||
|
||||
// QAccessibleValueInterface
|
||||
|
|
@ -92,7 +92,7 @@ class QAccessibleDoubleSpinBox : public QAccessibleAbstractSpinBox
|
|||
public:
|
||||
explicit QAccessibleDoubleSpinBox(QWidget *widget);
|
||||
|
||||
QString text(Text t) const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
|
||||
protected:
|
||||
QDoubleSpinBox *doubleSpinBox() const;
|
||||
|
|
@ -102,7 +102,7 @@ protected:
|
|||
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
|
||||
{
|
||||
public:
|
||||
explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider);
|
||||
explicit QAccessibleAbstractSlider(QWidget *w, QAccessible::Role r = QAccessible::Slider);
|
||||
void *interface_cast(QAccessible::InterfaceType t);
|
||||
|
||||
// QAccessibleValueInterface
|
||||
|
|
@ -120,7 +120,7 @@ class QAccessibleScrollBar : public QAccessibleAbstractSlider
|
|||
{
|
||||
public:
|
||||
explicit QAccessibleScrollBar(QWidget *w);
|
||||
QString text(Text t) const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
|
||||
protected:
|
||||
QScrollBar *scrollBar() const;
|
||||
|
|
@ -132,7 +132,7 @@ class QAccessibleSlider : public QAccessibleAbstractSlider
|
|||
{
|
||||
public:
|
||||
explicit QAccessibleSlider(QWidget *w);
|
||||
QString text(Text t) const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
|
||||
protected:
|
||||
QSlider *slider() const;
|
||||
|
|
@ -145,7 +145,7 @@ class QAccessibleDial : public QAccessibleAbstractSlider
|
|||
public:
|
||||
explicit QAccessibleDial(QWidget *w);
|
||||
|
||||
QString text(Text textType) const;
|
||||
QString text(QAccessible::Text textType) const;
|
||||
|
||||
protected:
|
||||
QDial *dial() const;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::Bounda
|
|||
Creates a QAccessibleButton object for \a w.
|
||||
\a role is propagated to the QAccessibleWidget constructor.
|
||||
*/
|
||||
QAccessibleButton::QAccessibleButton(QWidget *w, Role role)
|
||||
QAccessibleButton::QAccessibleButton(QWidget *w, QAccessible::Role role)
|
||||
: QAccessibleWidget(w, role)
|
||||
{
|
||||
Q_ASSERT(button());
|
||||
|
|
@ -105,11 +105,11 @@ QAbstractButton *QAccessibleButton::button() const
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
QString QAccessibleButton::text(Text t) const
|
||||
QString QAccessibleButton::text(QAccessible::Text t) const
|
||||
{
|
||||
QString str;
|
||||
switch (t) {
|
||||
case Accelerator:
|
||||
case QAccessible::Accelerator:
|
||||
{
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
QPushButton *pb = qobject_cast<QPushButton*>(object());
|
||||
|
|
@ -120,7 +120,7 @@ QString QAccessibleButton::text(Text t) const
|
|||
str = qt_accHotKey(button()->text());
|
||||
}
|
||||
break;
|
||||
case Name:
|
||||
case QAccessible::Name:
|
||||
str = widget()->accessibleName();
|
||||
if (str.isEmpty())
|
||||
str = button()->text();
|
||||
|
|
@ -135,23 +135,23 @@ QString QAccessibleButton::text(Text t) const
|
|||
|
||||
QAccessible::State QAccessibleButton::state() const
|
||||
{
|
||||
State state = QAccessibleWidget::state();
|
||||
QAccessible::State state = QAccessibleWidget::state();
|
||||
|
||||
QAbstractButton *b = button();
|
||||
QCheckBox *cb = qobject_cast<QCheckBox *>(b);
|
||||
if (b->isChecked())
|
||||
state |= Checked;
|
||||
state |= QAccessible::Checked;
|
||||
else if (cb && cb->checkState() == Qt::PartiallyChecked)
|
||||
state |= Mixed;
|
||||
state |= QAccessible::Mixed;
|
||||
if (b->isDown())
|
||||
state |= Pressed;
|
||||
state |= QAccessible::Pressed;
|
||||
QPushButton *pb = qobject_cast<QPushButton*>(b);
|
||||
if (pb) {
|
||||
if (pb->isDefault())
|
||||
state |= DefaultButton;
|
||||
state |= QAccessible::DefaultButton;
|
||||
#ifndef QT_NO_MENU
|
||||
if (pb->menu())
|
||||
state |= HasPopup;
|
||||
state |= QAccessible::HasPopup;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -163,15 +163,15 @@ QStringList QAccessibleButton::actionNames() const
|
|||
QStringList names;
|
||||
if (widget()->isEnabled()) {
|
||||
switch (role()) {
|
||||
case ButtonMenu:
|
||||
case QAccessible::ButtonMenu:
|
||||
names << showMenuAction();
|
||||
break;
|
||||
case RadioButton:
|
||||
case QAccessible::RadioButton:
|
||||
names << checkAction();
|
||||
break;
|
||||
default:
|
||||
if (button()->isCheckable()) {
|
||||
if (state() & Checked) {
|
||||
if (state() & QAccessible::Checked) {
|
||||
names << uncheckAction();
|
||||
} else {
|
||||
// FIXME
|
||||
|
|
@ -235,7 +235,7 @@ QStringList QAccessibleButton::keyBindingsForAction(const QString &actionName) c
|
|||
Creates a QAccessibleToolButton object for \a w.
|
||||
\a role is propagated to the QAccessibleWidget constructor.
|
||||
*/
|
||||
QAccessibleToolButton::QAccessibleToolButton(QWidget *w, Role role)
|
||||
QAccessibleToolButton::QAccessibleToolButton(QWidget *w, QAccessible::Role role)
|
||||
: QAccessibleButton(w, role)
|
||||
{
|
||||
Q_ASSERT(toolButton());
|
||||
|
|
@ -263,10 +263,10 @@ QAccessible::State QAccessibleToolButton::state() const
|
|||
{
|
||||
QAccessible::State st = QAccessibleButton::state();
|
||||
if (toolButton()->autoRaise())
|
||||
st |= HotTracked;
|
||||
st |= QAccessible::HotTracked;
|
||||
#ifndef QT_NO_MENU
|
||||
if (toolButton()->menu())
|
||||
st |= HasPopup;
|
||||
st |= QAccessible::HasPopup;
|
||||
#endif
|
||||
return st;
|
||||
}
|
||||
|
|
@ -281,7 +281,7 @@ QAccessibleInterface *QAccessibleToolButton::child(int index) const
|
|||
#ifndef QT_NO_MENU
|
||||
if (index == 0 && toolButton()->menu())
|
||||
{
|
||||
return queryAccessibleInterface(toolButton()->menu());
|
||||
return QAccessible::queryAccessibleInterface(toolButton()->menu());
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
|
@ -293,11 +293,11 @@ QAccessibleInterface *QAccessibleToolButton::child(int index) const
|
|||
Returns the button's text label, depending on the text \a t, and
|
||||
the \a child.
|
||||
*/
|
||||
QString QAccessibleToolButton::text(Text t) const
|
||||
QString QAccessibleToolButton::text(QAccessible::Text t) const
|
||||
{
|
||||
QString str;
|
||||
switch (t) {
|
||||
case Name:
|
||||
case QAccessible::Name:
|
||||
str = toolButton()->accessibleName();
|
||||
if (str.isEmpty())
|
||||
str = toolButton()->text();
|
||||
|
|
@ -362,7 +362,7 @@ void QAccessibleToolButton::doAction(const QString &actionName)
|
|||
Constructs a QAccessibleDisplay object for \a w.
|
||||
\a role is propagated to the QAccessibleWidget constructor.
|
||||
*/
|
||||
QAccessibleDisplay::QAccessibleDisplay(QWidget *w, Role role)
|
||||
QAccessibleDisplay::QAccessibleDisplay(QWidget *w, QAccessible::Role role)
|
||||
: QAccessibleWidget(w, role)
|
||||
{
|
||||
}
|
||||
|
|
@ -372,28 +372,28 @@ QAccessible::Role QAccessibleDisplay::role() const
|
|||
QLabel *l = qobject_cast<QLabel*>(object());
|
||||
if (l) {
|
||||
if (l->pixmap())
|
||||
return Graphic;
|
||||
return QAccessible::Graphic;
|
||||
#ifndef QT_NO_PICTURE
|
||||
if (l->picture())
|
||||
return Graphic;
|
||||
return QAccessible::Graphic;
|
||||
#endif
|
||||
#ifndef QT_NO_MOVIE
|
||||
if (l->movie())
|
||||
return Animation;
|
||||
return QAccessible::Animation;
|
||||
#endif
|
||||
#ifndef QT_NO_PROGRESSBAR
|
||||
} else if (qobject_cast<QProgressBar*>(object())) {
|
||||
return ProgressBar;
|
||||
return QAccessible::ProgressBar;
|
||||
#endif
|
||||
}
|
||||
return QAccessibleWidget::role();
|
||||
}
|
||||
|
||||
QString QAccessibleDisplay::text(Text t) const
|
||||
QString QAccessibleDisplay::text(QAccessible::Text t) const
|
||||
{
|
||||
QString str;
|
||||
switch (t) {
|
||||
case Name:
|
||||
case QAccessible::Name:
|
||||
str = widget()->accessibleName();
|
||||
if (str.isEmpty()) {
|
||||
if (qobject_cast<QLabel*>(object())) {
|
||||
|
|
@ -413,7 +413,7 @@ QString QAccessibleDisplay::text(Text t) const
|
|||
}
|
||||
}
|
||||
break;
|
||||
case Value:
|
||||
case QAccessible::Value:
|
||||
#ifndef QT_NO_PROGRESSBAR
|
||||
if (qobject_cast<QProgressBar*>(object()))
|
||||
str = QString::number(qobject_cast<QProgressBar*>(object())->value());
|
||||
|
|
@ -429,30 +429,30 @@ QString QAccessibleDisplay::text(Text t) const
|
|||
|
||||
QAccessible::Relation QAccessibleDisplay::relationTo(const QAccessibleInterface *other) const
|
||||
{
|
||||
Relation relation = QAccessibleWidget::relationTo(other);
|
||||
QAccessible::Relation relation = QAccessibleWidget::relationTo(other);
|
||||
|
||||
QObject *o = other->object();
|
||||
QLabel *label = qobject_cast<QLabel*>(object());
|
||||
if (label) {
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
if (o == label->buddy())
|
||||
relation |= Label;
|
||||
relation |= QAccessible::Label;
|
||||
#endif
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
} else {
|
||||
QGroupBox *groupbox = qobject_cast<QGroupBox*>(object());
|
||||
if (groupbox && !groupbox->title().isEmpty())
|
||||
if (groupbox->children().contains(o))
|
||||
relation |= Label;
|
||||
relation |= QAccessible::Label;
|
||||
#endif
|
||||
}
|
||||
return relation;
|
||||
}
|
||||
|
||||
int QAccessibleDisplay::navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
|
||||
int QAccessibleDisplay::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
|
||||
{
|
||||
*target = 0;
|
||||
if (rel == Labelled) {
|
||||
if (rel == QAccessible::Labelled) {
|
||||
QObject *targetObject = 0;
|
||||
QLabel *label = qobject_cast<QLabel*>(object());
|
||||
if (label) {
|
||||
|
|
@ -464,7 +464,7 @@ int QAccessibleDisplay::navigate(RelationFlag rel, int entry, QAccessibleInterfa
|
|||
} else {
|
||||
QGroupBox *groupbox = qobject_cast<QGroupBox*>(object());
|
||||
if (groupbox && !groupbox->title().isEmpty())
|
||||
rel = Child;
|
||||
rel = QAccessible::Child;
|
||||
#endif
|
||||
}
|
||||
*target = QAccessible::queryAccessibleInterface(targetObject);
|
||||
|
|
@ -537,7 +537,7 @@ QRect QAccessibleDisplay::imagePosition(QAccessible2::CoordinateType coordType)
|
|||
\a name is propagated to the QAccessibleWidget constructor.
|
||||
*/
|
||||
QAccessibleLineEdit::QAccessibleLineEdit(QWidget *w, const QString &name)
|
||||
: QAccessibleWidget(w, EditableText, name), QAccessibleSimpleEditableTextInterface(this)
|
||||
: QAccessibleWidget(w, QAccessible::EditableText, name), QAccessibleSimpleEditableTextInterface(this)
|
||||
{
|
||||
addControllingSignal(QLatin1String("textChanged(const QString&)"));
|
||||
addControllingSignal(QLatin1String("returnPressed()"));
|
||||
|
|
@ -549,11 +549,11 @@ QLineEdit *QAccessibleLineEdit::lineEdit() const
|
|||
return qobject_cast<QLineEdit*>(object());
|
||||
}
|
||||
|
||||
QString QAccessibleLineEdit::text(Text t) const
|
||||
QString QAccessibleLineEdit::text(QAccessible::Text t) const
|
||||
{
|
||||
QString str;
|
||||
switch (t) {
|
||||
case Value:
|
||||
case QAccessible::Value:
|
||||
if (lineEdit()->echoMode() == QLineEdit::Normal)
|
||||
str = lineEdit()->text();
|
||||
break;
|
||||
|
|
@ -565,9 +565,9 @@ QString QAccessibleLineEdit::text(Text t) const
|
|||
return qt_accStripAmp(str);
|
||||
}
|
||||
|
||||
void QAccessibleLineEdit::setText(Text t, const QString &text)
|
||||
void QAccessibleLineEdit::setText(QAccessible::Text t, const QString &text)
|
||||
{
|
||||
if (t != Value) {
|
||||
if (t != QAccessible::Value) {
|
||||
QAccessibleWidget::setText(t, text);
|
||||
return;
|
||||
}
|
||||
|
|
@ -583,20 +583,20 @@ void QAccessibleLineEdit::setText(Text t, const QString &text)
|
|||
|
||||
QAccessible::State QAccessibleLineEdit::state() const
|
||||
{
|
||||
State state = QAccessibleWidget::state();
|
||||
QAccessible::State state = QAccessibleWidget::state();
|
||||
|
||||
QLineEdit *l = lineEdit();
|
||||
if (l->isReadOnly())
|
||||
state |= ReadOnly;
|
||||
state |= QAccessible::ReadOnly;
|
||||
if (l->echoMode() != QLineEdit::Normal)
|
||||
state |= Protected;
|
||||
state |= Selectable;
|
||||
state |= QAccessible::Protected;
|
||||
state |= QAccessible::Selectable;
|
||||
if (l->hasSelectedText())
|
||||
state |= Selected;
|
||||
state |= QAccessible::Selected;
|
||||
|
||||
if (l->contextMenuPolicy() != Qt::NoContextMenu
|
||||
&& l->contextMenuPolicy() != Qt::PreventContextMenu)
|
||||
state |= HasPopup;
|
||||
state |= QAccessible::HasPopup;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
|
@ -605,16 +605,16 @@ QVariant QAccessibleLineEdit::invokeMethod(QAccessible::Method method,
|
|||
const QVariantList ¶ms)
|
||||
{
|
||||
switch (method) {
|
||||
case ListSupportedMethods: {
|
||||
case QAccessible::ListSupportedMethods: {
|
||||
QSet<QAccessible::Method> set;
|
||||
set << ListSupportedMethods << SetCursorPosition << GetCursorPosition;
|
||||
set << QAccessible::ListSupportedMethods << QAccessible::SetCursorPosition << QAccessible::GetCursorPosition;
|
||||
return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
|
||||
QAccessibleWidget::invokeMethod(method, params)));
|
||||
}
|
||||
case SetCursorPosition:
|
||||
case QAccessible::SetCursorPosition:
|
||||
setCursorPosition(params.value(0).toInt());
|
||||
return true;
|
||||
case GetCursorPosition:
|
||||
case QAccessible::GetCursorPosition:
|
||||
return cursorPosition();
|
||||
default:
|
||||
return QAccessibleWidget::invokeMethod(method, params);
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ class QAccessibleButton : public QAccessibleWidget
|
|||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(QAccessibleButton)
|
||||
public:
|
||||
QAccessibleButton(QWidget *w, Role r);
|
||||
QAccessibleButton(QWidget *w, QAccessible::Role r);
|
||||
|
||||
QString text(Text t) const;
|
||||
State state() const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
QAccessible::State state() const;
|
||||
|
||||
QStringList actionNames() const;
|
||||
void doAction(const QString &actionName);
|
||||
|
|
@ -76,14 +76,14 @@ protected:
|
|||
class QAccessibleToolButton : public QAccessibleButton
|
||||
{
|
||||
public:
|
||||
QAccessibleToolButton(QWidget *w, Role role);
|
||||
QAccessibleToolButton(QWidget *w, QAccessible::Role role);
|
||||
|
||||
State state() const;
|
||||
QAccessible::State state() const;
|
||||
|
||||
int childCount() const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
|
||||
QString text(Text t) const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
|
||||
// QAccessibleActionInterface
|
||||
QStringList actionNames() const;
|
||||
|
|
@ -99,13 +99,13 @@ protected:
|
|||
class QAccessibleDisplay : public QAccessibleWidget, public QAccessibleImageInterface
|
||||
{
|
||||
public:
|
||||
explicit QAccessibleDisplay(QWidget *w, Role role = StaticText);
|
||||
explicit QAccessibleDisplay(QWidget *w, QAccessible::Role role = QAccessible::StaticText);
|
||||
|
||||
QString text(Text t) const;
|
||||
Role role() const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
QAccessible::Role role() const;
|
||||
|
||||
Relation relationTo(const QAccessibleInterface *other) const;
|
||||
int navigate(RelationFlag, int entry, QAccessibleInterface **target) const;
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
int navigate(QAccessible::RelationFlag, int entry, QAccessibleInterface **target) const;
|
||||
void *interface_cast(QAccessible::InterfaceType t);
|
||||
|
||||
// QAccessibleImageInterface
|
||||
|
|
@ -121,9 +121,9 @@ class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInte
|
|||
public:
|
||||
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
|
||||
|
||||
QString text(Text t) const;
|
||||
void setText(Text t, const QString &text);
|
||||
State state() const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
void setText(QAccessible::Text t, const QString &text);
|
||||
QAccessible::State state() const;
|
||||
QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
|
||||
void *interface_cast(QAccessible::InterfaceType t);
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ public:
|
|||
\a role and \a name are optional parameters that set the object's
|
||||
role and name properties.
|
||||
*/
|
||||
QAccessibleWidget::QAccessibleWidget(QWidget *w, Role role, const QString &name)
|
||||
QAccessibleWidget::QAccessibleWidget(QWidget *w, QAccessible::Role role, const QString &name)
|
||||
: QAccessibleObject(w)
|
||||
{
|
||||
Q_ASSERT(widget());
|
||||
|
|
@ -350,7 +350,7 @@ static inline bool isAncestor(const QObject *obj, const QObject *child)
|
|||
/*! \reimp */
|
||||
QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface *other) const
|
||||
{
|
||||
Relation relation = Unrelated;
|
||||
QAccessible::Relation relation = QAccessible::Unrelated;
|
||||
if (d->asking == this) // recursive call
|
||||
return relation;
|
||||
|
||||
|
|
@ -360,12 +360,12 @@ QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface *
|
|||
|
||||
QWidget *focus = widget()->focusWidget();
|
||||
if (object() == focus && isAncestor(o, focus))
|
||||
relation |= FocusChild;
|
||||
relation |= QAccessible::FocusChild;
|
||||
|
||||
QACConnectionObject *connectionObject = (QACConnectionObject*)object();
|
||||
for (int sig = 0; sig < d->primarySignals.count(); ++sig) {
|
||||
if (connectionObject->isSender(o, d->primarySignals.at(sig).toAscii())) {
|
||||
relation |= Controller;
|
||||
relation |= QAccessible::Controller;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -375,21 +375,21 @@ QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface *
|
|||
int inverse = other->relationTo(this);
|
||||
d->asking = 0;
|
||||
|
||||
if (inverse & Controller)
|
||||
relation |= Controlled;
|
||||
if (inverse & Label)
|
||||
relation |= Labelled;
|
||||
if (inverse & QAccessible::Controller)
|
||||
relation |= QAccessible::Controlled;
|
||||
if (inverse & QAccessible::Label)
|
||||
relation |= QAccessible::Labelled;
|
||||
|
||||
if(o == object()) {
|
||||
return relation | Self;
|
||||
return relation | QAccessible::Self;
|
||||
}
|
||||
|
||||
QObject *parent = object()->parent();
|
||||
if (o == parent)
|
||||
return relation | Child;
|
||||
return relation | QAccessible::Child;
|
||||
|
||||
if (o->parent() == parent) {
|
||||
relation |= Sibling;
|
||||
relation |= QAccessible::Sibling;
|
||||
QAccessibleInterface *sibIface = QAccessible::queryAccessibleInterface(o);
|
||||
Q_ASSERT(sibIface);
|
||||
QRect wg = rect();
|
||||
|
|
@ -397,7 +397,7 @@ QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface *
|
|||
if (wg.intersects(sg)) {
|
||||
QAccessibleInterface *pIface = 0;
|
||||
pIface = sibIface->parent();
|
||||
if (pIface && !((sibIface->state() | state()) & Invisible)) {
|
||||
if (pIface && !((sibIface->state() | state()) & QAccessible::Invisible)) {
|
||||
int wi = pIface->indexOfChild(this);
|
||||
int si = pIface->indexOfChild(sibIface);
|
||||
|
||||
|
|
@ -425,9 +425,9 @@ QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface *
|
|||
}
|
||||
|
||||
if (isAncestor(o, object()))
|
||||
return relation | Descendent;
|
||||
return relation | QAccessible::Descendent;
|
||||
if (isAncestor(object(), o))
|
||||
return relation | Ancestor;
|
||||
return relation | QAccessible::Ancestor;
|
||||
|
||||
return relation;
|
||||
}
|
||||
|
|
@ -449,7 +449,7 @@ QAccessibleInterface *QAccessibleWidget::child(int index) const
|
|||
}
|
||||
|
||||
/*! \reimp */
|
||||
int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
||||
int QAccessibleWidget::navigate(QAccessible::RelationFlag relation, int entry,
|
||||
QAccessibleInterface **target) const
|
||||
{
|
||||
if (!target)
|
||||
|
|
@ -460,18 +460,18 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
|
||||
switch (relation) {
|
||||
// Hierarchical
|
||||
case Self:
|
||||
case QAccessible::Self:
|
||||
targetObject = object();
|
||||
break;
|
||||
case Child:
|
||||
case QAccessible::Child:
|
||||
qWarning() << "QAccessibleWidget::navigate is deprecated for QAccessible::Child in:" << object()->metaObject()->className();
|
||||
*target = child(entry - 1);
|
||||
return *target ? 0 : -1;
|
||||
case Ancestor:
|
||||
case QAccessible::Ancestor:
|
||||
qWarning() << "QAccessibleWidget::navigate is deprecated for QAccessible::Ancestor in:" << object()->metaObject()->className();
|
||||
*target = parent();
|
||||
return *target ? 0 : -1;
|
||||
case Sibling:
|
||||
case QAccessible::Sibling:
|
||||
{
|
||||
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(parentObject());
|
||||
if (!iface)
|
||||
|
|
@ -506,7 +506,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
QAccessibleInterface *sibling = 0;
|
||||
sibling = pIface->child(i);
|
||||
Q_ASSERT(sibling);
|
||||
if ((relationTo(sibling) & Self) || (sibling->state() & QAccessible::Invisible)) {
|
||||
if ((relationTo(sibling) & QAccessible::Self) || (sibling->state() & QAccessible::Invisible)) {
|
||||
//ignore ourself and invisible siblings
|
||||
delete sibling;
|
||||
continue;
|
||||
|
|
@ -573,7 +573,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case Covers:
|
||||
case QAccessible::Covers:
|
||||
if (entry > 0) {
|
||||
QAccessibleInterface *pIface = QAccessible::queryAccessibleInterface(parentObject());
|
||||
if (!pIface)
|
||||
|
|
@ -584,7 +584,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
QAccessibleInterface *sibling = 0;
|
||||
for (int i = pIface->indexOfChild(this) + 1; i <= sibCount && entry; ++i) {
|
||||
sibling = pIface->child(i - 1);
|
||||
if (!sibling || (sibling->state() & Invisible)) {
|
||||
if (!sibling || (sibling->state() & QAccessible::Invisible)) {
|
||||
delete sibling;
|
||||
sibling = 0;
|
||||
continue;
|
||||
|
|
@ -602,7 +602,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case Covered:
|
||||
case QAccessible::Covered:
|
||||
if (entry > 0) {
|
||||
QAccessibleInterface *pIface = QAccessible::queryAccessibleInterface(parentObject());
|
||||
if (!pIface)
|
||||
|
|
@ -614,7 +614,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
for (int i = 1; i < index && entry; ++i) {
|
||||
sibling = pIface->child(i - 1);
|
||||
Q_ASSERT(sibling);
|
||||
if (!sibling || (sibling->state() & Invisible)) {
|
||||
if (!sibling || (sibling->state() & QAccessible::Invisible)) {
|
||||
delete sibling;
|
||||
sibling = 0;
|
||||
continue;
|
||||
|
|
@ -634,7 +634,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
break;
|
||||
|
||||
// Logical
|
||||
case FocusChild:
|
||||
case QAccessible::FocusChild:
|
||||
{
|
||||
if (widget()->hasFocus()) {
|
||||
targetObject = object();
|
||||
|
|
@ -657,7 +657,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
*/
|
||||
}
|
||||
break;
|
||||
case Label:
|
||||
case QAccessible::Label:
|
||||
if (entry > 0) {
|
||||
QAccessibleInterface *pIface = QAccessible::queryAccessibleInterface(parentObject());
|
||||
if (!pIface)
|
||||
|
|
@ -671,7 +671,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
for (int i = 0; i < sibCount && entry; ++i) {
|
||||
candidate = pIface->child(i);
|
||||
Q_ASSERT(candidate);
|
||||
if (candidate->relationTo(this) & Label)
|
||||
if (candidate->relationTo(this) & QAccessible::Label)
|
||||
--entry;
|
||||
if (!entry)
|
||||
break;
|
||||
|
|
@ -680,7 +680,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
candidate = 0;
|
||||
}
|
||||
if (!candidate) {
|
||||
if (pIface->relationTo(this) & Label)
|
||||
if (pIface->relationTo(this) & QAccessible::Label)
|
||||
--entry;
|
||||
if (!entry)
|
||||
candidate = pIface;
|
||||
|
|
@ -693,9 +693,9 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
return 0;
|
||||
}
|
||||
break;
|
||||
case Labelled: // only implemented in subclasses
|
||||
case QAccessible::Labelled: // only implemented in subclasses
|
||||
break;
|
||||
case Controller:
|
||||
case QAccessible::Controller:
|
||||
if (entry > 0) {
|
||||
// check all senders we are connected to,
|
||||
// and figure out which one are controllers to us
|
||||
|
|
@ -707,7 +707,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
QAccessibleInterface *candidate = QAccessible::queryAccessibleInterface(sender);
|
||||
if (!candidate)
|
||||
continue;
|
||||
if (candidate->relationTo(this) & Controller)
|
||||
if (candidate->relationTo(this) & QAccessible::Controller)
|
||||
senders << sender;
|
||||
delete candidate;
|
||||
}
|
||||
|
|
@ -715,7 +715,7 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
|
|||
targetObject = senders.at(entry-1);
|
||||
}
|
||||
break;
|
||||
case Controlled:
|
||||
case QAccessible::Controlled:
|
||||
if (entry > 0) {
|
||||
QObjectList allReceivers;
|
||||
QACConnectionObject *connectionObject = (QACConnectionObject*)object();
|
||||
|
|
@ -756,12 +756,12 @@ int QAccessibleWidget::indexOfChild(const QAccessibleInterface *child) const
|
|||
extern QString qt_setWindowTitle_helperHelper(const QString &, const QWidget*);
|
||||
|
||||
/*! \reimp */
|
||||
QString QAccessibleWidget::text(Text t) const
|
||||
QString QAccessibleWidget::text(QAccessible::Text t) const
|
||||
{
|
||||
QString str;
|
||||
|
||||
switch (t) {
|
||||
case Name:
|
||||
case QAccessible::Name:
|
||||
if (!d->name.isEmpty()) {
|
||||
str = d->name;
|
||||
} else if (!widget()->accessibleName().isEmpty()) {
|
||||
|
|
@ -775,7 +775,7 @@ QString QAccessibleWidget::text(Text t) const
|
|||
str = qt_accStripAmp(buddyString(widget()));
|
||||
}
|
||||
break;
|
||||
case Description:
|
||||
case QAccessible::Description:
|
||||
if (!d->description.isEmpty())
|
||||
str = d->description;
|
||||
else if (!widget()->accessibleDescription().isEmpty())
|
||||
|
|
@ -785,7 +785,7 @@ QString QAccessibleWidget::text(Text t) const
|
|||
str = widget()->toolTip();
|
||||
#endif
|
||||
break;
|
||||
case Help:
|
||||
case QAccessible::Help:
|
||||
if (!d->help.isEmpty())
|
||||
str = d->help;
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
|
|
@ -793,13 +793,13 @@ QString QAccessibleWidget::text(Text t) const
|
|||
str = widget()->whatsThis();
|
||||
#endif
|
||||
break;
|
||||
case Accelerator:
|
||||
case QAccessible::Accelerator:
|
||||
if (!d->accelerator.isEmpty())
|
||||
str = d->accelerator;
|
||||
else
|
||||
str = qt_accHotKey(buddyString(widget()));
|
||||
break;
|
||||
case Value:
|
||||
case QAccessible::Value:
|
||||
str = d->value;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -844,22 +844,22 @@ QAccessible::Role QAccessibleWidget::role() const
|
|||
/*! \reimp */
|
||||
QAccessible::State QAccessibleWidget::state() const
|
||||
{
|
||||
QAccessible::State state = Normal;
|
||||
QAccessible::State state = QAccessible::Normal;
|
||||
|
||||
QWidget *w = widget();
|
||||
if (w->testAttribute(Qt::WA_WState_Visible) == false)
|
||||
state |= Invisible;
|
||||
state |= QAccessible::Invisible;
|
||||
if (w->focusPolicy() != Qt::NoFocus && w->isActiveWindow())
|
||||
state |= Focusable;
|
||||
state |= QAccessible::Focusable;
|
||||
if (w->hasFocus())
|
||||
state |= Focused;
|
||||
state |= QAccessible::Focused;
|
||||
if (!w->isEnabled())
|
||||
state |= Unavailable;
|
||||
state |= QAccessible::Unavailable;
|
||||
if (w->isWindow()) {
|
||||
if (w->windowFlags() & Qt::WindowSystemMenuHint)
|
||||
state |= Movable;
|
||||
state |= QAccessible::Movable;
|
||||
if (w->minimumSize() != w->maximumSize())
|
||||
state |= Sizeable;
|
||||
state |= QAccessible::Sizeable;
|
||||
}
|
||||
|
||||
return state;
|
||||
|
|
|
|||
|
|
@ -57,23 +57,23 @@ class QAccessibleWidgetPrivate;
|
|||
class Q_WIDGETS_EXPORT QAccessibleWidget : public QAccessibleObject, public QAccessibleActionInterface
|
||||
{
|
||||
public:
|
||||
explicit QAccessibleWidget(QWidget *o, Role r = Client, const QString& name = QString());
|
||||
explicit QAccessibleWidget(QWidget *o, QAccessible::Role r = QAccessible::Client, const QString& name = QString());
|
||||
|
||||
QWindow *window() const;
|
||||
int childCount() const;
|
||||
int indexOfChild(const QAccessibleInterface *child) const;
|
||||
Relation relationTo(const QAccessibleInterface *other) const;
|
||||
QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
|
||||
|
||||
int childAt(int x, int y) const;
|
||||
QRect rect() const;
|
||||
|
||||
QAccessibleInterface *parent() const;
|
||||
QAccessibleInterface *child(int index) const;
|
||||
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const;
|
||||
int navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const;
|
||||
|
||||
QString text(Text t) const;
|
||||
Role role() const;
|
||||
State state() const;
|
||||
QString text(QAccessible::Text t) const;
|
||||
QAccessible::Role role() const;
|
||||
QAccessible::State state() const;
|
||||
|
||||
QColor foregroundColor() const;
|
||||
QColor backgroundColor() const;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ static inline int indexOfChild(QAccessibleInterface *parentInterface, QWidget *c
|
|||
{
|
||||
if (!parentInterface || !childWidget)
|
||||
return -1;
|
||||
QAccessibleInterface *childInterface = QAccessibleInterface::queryAccessibleInterface(childWidget);
|
||||
QAccessibleInterface *childInterface = QAccessible::queryAccessibleInterface(childWidget);
|
||||
if (!childInterface)
|
||||
return -1;
|
||||
int index = parentInterface->indexOfChild(childInterface);
|
||||
|
|
@ -344,9 +344,9 @@ class QtTestAccessibleWidgetIface: public QAccessibleWidget
|
|||
{
|
||||
public:
|
||||
QtTestAccessibleWidgetIface(QtTestAccessibleWidget *w): QAccessibleWidget(w) {}
|
||||
QString text(Text t) const
|
||||
QString text(QAccessible::Text t) const
|
||||
{
|
||||
if (t == Help)
|
||||
if (t == QAccessible::Help)
|
||||
return QString::fromLatin1("Help yourself");
|
||||
return QAccessibleWidget::text(t);
|
||||
}
|
||||
|
|
@ -1877,8 +1877,8 @@ void tst_QAccessibility::mdiSubWindowTest()
|
|||
QCOMPARE(interface->state(), state);
|
||||
const QRect originalGeometry = testWindow->geometry();
|
||||
testWindow->showMaximized();
|
||||
state &= ~QAccessible::Sizeable;
|
||||
state &= ~QAccessible::Movable;
|
||||
state &= (uint)~QAccessible::Sizeable;
|
||||
state &= (uint)~QAccessible::Movable;
|
||||
QCOMPARE(interface->state(), state);
|
||||
testWindow->showNormal();
|
||||
testWindow->move(-10, 0);
|
||||
|
|
@ -2526,7 +2526,7 @@ void tst_QAccessibility::listTest()
|
|||
QVERIFY(cellInterface);
|
||||
QCOMPARE(cellInterface->rowIndex(), 3);
|
||||
QCOMPARE(cellInterface->columnIndex(), 0);
|
||||
QVERIFY(!cellInterface->isExpandable());
|
||||
QVERIFY(!(cell4->state() & QAccessible::Expandable));
|
||||
|
||||
delete cell4;
|
||||
delete cell1;
|
||||
|
|
@ -2620,7 +2620,7 @@ void tst_QAccessibility::treeTest()
|
|||
QCOMPARE(cell2->role(), QAccessible::TreeItem);
|
||||
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 1);
|
||||
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 0);
|
||||
QVERIFY(cell2->tableCellInterface()->isExpandable());
|
||||
QVERIFY(cell2->state() & QAccessible::Expandable);
|
||||
QCOMPARE(iface->indexOfChild(cell2), 5);
|
||||
QVERIFY(!(cell2->state() & QAccessible::Expanded));
|
||||
QCOMPARE(table2->columnDescription(1), QString("Work"));
|
||||
|
|
@ -2644,7 +2644,7 @@ void tst_QAccessibility::treeTest()
|
|||
QCOMPARE(cell2->role(), QAccessible::TreeItem);
|
||||
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 4);
|
||||
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 0);
|
||||
QVERIFY(!cell2->tableCellInterface()->isExpandable());
|
||||
QVERIFY(!(cell2->state() & QAccessible::Expandable));
|
||||
QCOMPARE(iface->indexOfChild(cell2), 11);
|
||||
|
||||
QCOMPARE(table2->columnDescription(0), QString("Artist"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue