summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/accessible')
-rw-r--r--src/gui/accessible/qaccessible.cpp2
-rw-r--r--src/gui/accessible/qaccessible_mac.mm14
-rw-r--r--src/gui/accessible/qaccessible_win.cpp12
-rw-r--r--src/gui/accessible/qaccessibleobject.cpp14
-rw-r--r--src/gui/accessible/qaccessiblewidget.cpp19
5 files changed, 16 insertions, 45 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index b931ea1..2badc2d 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -394,7 +394,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QAccessibleFactoryInterface_iid, QLatin1String("/accessible")))
#endif
-Q_GLOBAL_STATIC(QList<QAccessible::InterfaceFactory>, qAccessibleFactories);
+Q_GLOBAL_STATIC(QList<QAccessible::InterfaceFactory>, qAccessibleFactories)
QAccessible::UpdateHandler QAccessible::updateHandler = 0;
QAccessible::RootObjectHandler QAccessible::rootObjectHandler = 0;
diff --git a/src/gui/accessible/qaccessible_mac.mm b/src/gui/accessible/qaccessible_mac.mm
index 65f9ab9..5646300 100644
--- a/src/gui/accessible/qaccessible_mac.mm
+++ b/src/gui/accessible/qaccessible_mac.mm
@@ -1232,10 +1232,8 @@ static int textForRoleAndAttribute(QAccessible::Role role, CFStringRef attribute
return QAccessible::Value;
else if (CFStringCompare(attribute, CFStringRef(QAXHelpAttribute), 0) == kCFCompareEqualTo)
return QAccessible::Help;
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
else if (CFStringCompare(attribute, CFStringRef(QAXDescriptionAttribute), 0) == kCFCompareEqualTo)
return QAccessible::Description;
-#endif
else
return -1;
}
@@ -1442,17 +1440,13 @@ static OSStatus getAllAttributeNames(EventRef event, const QAInterface &interfac
qt_mac_append_cf_uniq(attrs, CFStringRef(QAXRoleAttribute));
qt_mac_append_cf_uniq(attrs, CFStringRef(QAXEnabledAttribute));
qt_mac_append_cf_uniq(attrs, CFStringRef(QAXWindowAttribute));
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
qt_mac_append_cf_uniq(attrs, CFStringRef(QAXTopLevelUIElementAttribute));
-#endif
// Append these names if the QInterafceItem returns any data for them.
appendIfSupported(attrs, CFStringRef(QAXTitleAttribute), interface);
appendIfSupported(attrs, CFStringRef(QAXValueAttribute), interface);
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
appendIfSupported(attrs, CFStringRef(QAXDescriptionAttribute), interface);
appendIfSupported(attrs, CFStringRef(QAXLinkedUIElementsAttribute), interface);
-#endif
appendIfSupported(attrs, CFStringRef(QAXHelpAttribute), interface);
appendIfSupported(attrs, CFStringRef(QAXTitleUIElementAttribute), interface);
appendIfSupported(attrs, CFStringRef(QAXChildrenAttribute), interface);
@@ -1705,12 +1699,10 @@ static OSStatus handleWindowAttribute(EventHandlerCallRef next_ref, EventRef eve
Returns the top-level window for an interface, which is the closest ancestor interface that
has the Window role. (Can also be a sheet or a drawer)
*/
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
static OSStatus handleTopLevelUIElementAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
{
return navigateAncestors<IsWindowTest>(next_ref, event, interface, CFStringRef(QAXTopLevelUIElementAttribute));
}
-#endif
/*
Returns the tab buttons for an interface.
@@ -1888,10 +1880,8 @@ static OSStatus getNamedAttribute(EventHandlerCallRef next_ref, EventRef event,
if (CFStringCompare(var, CFStringRef(QAXChildrenAttribute), 0) == kCFCompareEqualTo) {
return handleChildrenAttribute(next_ref, event, interface);
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
} else if(CFStringCompare(var, CFStringRef(QAXTopLevelUIElementAttribute), 0) == kCFCompareEqualTo) {
return handleTopLevelUIElementAttribute(next_ref, event, interface);
-#endif
} else if(CFStringCompare(var, CFStringRef(QAXWindowAttribute), 0) == kCFCompareEqualTo) {
return handleWindowAttribute(next_ref, event, interface);
} else if(CFStringCompare(var, CFStringRef(QAXParentAttribute), 0) == kCFCompareEqualTo) {
@@ -1981,7 +1971,7 @@ static OSStatus getNamedAttribute(EventHandlerCallRef next_ref, EventRef event,
} else if (CFStringCompare(var, CFStringRef(QAXSubroleAttribute), 0) == kCFCompareEqualTo) {
return handleSubroleAttribute(next_ref, event, interface);
} else if (CFStringCompare(var, CFStringRef(QAXRoleDescriptionAttribute), 0) == kCFCompareEqualTo) {
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) && !defined(QT_MAC_USE_COCOA)
+#if !defined(QT_MAC_USE_COCOA)
if (HICopyAccessibilityRoleDescription) {
const CFStringRef roleDescription = HICopyAccessibilityRoleDescription(macRole(interface), 0);
SetEventParameter(event, kEventParamAccessibleAttributeValue, typeCFStringRef,
@@ -2005,14 +1995,12 @@ static OSStatus getNamedAttribute(EventHandlerCallRef next_ref, EventRef event,
} else {
handleStringAttribute(event, text, interface);
}
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
} else if (CFStringCompare(var, CFStringRef(QAXDescriptionAttribute), 0) == kCFCompareEqualTo) {
const QAccessible::Role role = interface.role();
const QAccessible::Text text = (QAccessible::Text)textForRoleAndAttribute(role, var);
handleStringAttribute(event, text, interface);
} else if (CFStringCompare(var, CFStringRef(QAXLinkedUIElementsAttribute), 0) == kCFCompareEqualTo) {
return CallNextEventHandler(next_ref, event);
-#endif
} else if (CFStringCompare(var, CFStringRef(QAXHelpAttribute), 0) == kCFCompareEqualTo) {
const QAccessible::Role role = interface.role();
const QAccessible::Text text = (QAccessible::Text)textForRoleAndAttribute(role, var);
diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp
index e39846e..ccb2673 100644
--- a/src/gui/accessible/qaccessible_win.cpp
+++ b/src/gui/accessible/qaccessible_win.cpp
@@ -50,7 +50,7 @@
#include <winuser.h>
#if !defined(WINABLEAPI)
-# if defined(Q_OS_WINCE)
+# if defined(Q_WS_WINCE)
# include <bldver.h>
# endif
# include <winable.h>
@@ -61,7 +61,7 @@
#include <comdef.h>
#endif
-#ifdef Q_OS_WINCE
+#ifdef Q_WS_WINCE
#include "qguifunctions_wince.h"
#endif
@@ -239,7 +239,7 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
typedef void (WINAPI *PtrNotifyWinEvent)(DWORD, HWND, LONG, LONG);
-#if defined(Q_OS_WINCE) // ### TODO: check for NotifyWinEvent in CE 6.0
+#if defined(Q_WS_WINCE) // ### TODO: check for NotifyWinEvent in CE 6.0
// There is no user32.lib nor NotifyWinEvent for CE
return;
#else
@@ -270,9 +270,9 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
if (!w) {
if (reason != QAccessible::ContextHelpStart &&
reason != QAccessible::ContextHelpEnd)
- w = qApp->focusWidget();
+ w = QApplication::focusWidget();
if (!w) {
- w = qApp->activeWindow();
+ w = QApplication::activeWindow();
if (!w)
return;
@@ -289,7 +289,7 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
if (reason != MenuCommand) { // MenuCommand is faked
ptrNotifyWinEvent(reason, w->winId(), OBJID_CLIENT, who);
}
-#endif // Q_OS_WINCE
+#endif // Q_WS_WINCE
}
void QAccessible::setRootObject(QObject *o)
diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp
index d31d6fe..9b185e5 100644
--- a/src/gui/accessible/qaccessibleobject.cpp
+++ b/src/gui/accessible/qaccessibleobject.cpp
@@ -212,7 +212,7 @@ QAccessibleApplication::QAccessibleApplication()
static QWidgetList topLevelWidgets()
{
QWidgetList list;
- const QWidgetList tlw(qApp->topLevelWidgets());
+ const QWidgetList tlw(QApplication::topLevelWidgets());
for (int i = 0; i < tlw.count(); ++i) {
QWidget *w = tlw.at(i);
if (!(w->windowType() == Qt::Popup) && !(w->windowType() == Qt::Desktop))
@@ -308,7 +308,7 @@ int QAccessibleApplication::navigate(RelationFlag relation, int entry,
}
break;
case FocusChild:
- targetObject = qApp->activeWindow();
+ targetObject = QApplication::activeWindow();
break;
default:
break;
@@ -322,11 +322,11 @@ QString QAccessibleApplication::text(Text t, int) const
{
switch (t) {
case Name:
- if (qApp->activeWindow())
- return qApp->activeWindow()->windowTitle();
+ if (QApplication::activeWindow())
+ return QApplication::activeWindow()->windowTitle();
break;
case Description:
- return qApp->applicationFilePath();
+ return QApplication::applicationFilePath();
default:
break;
}
@@ -342,7 +342,7 @@ QAccessible::Role QAccessibleApplication::role(int) const
/*! \reimp */
QAccessible::State QAccessibleApplication::state(int) const
{
- return qApp->activeWindow() ? Focused : Normal;
+ return QApplication::activeWindow() ? Focused : Normal;
}
/*! \reimp */
@@ -356,7 +356,7 @@ bool QAccessibleApplication::doAction(int action, int child, const QVariantList
{
if (action == 0 || action == 1) {
QWidget *w = 0;
- w = qApp->activeWindow();
+ w = QApplication::activeWindow();
if (!w)
w = topLevelWidgets().at(0);
if (!w)
diff --git a/src/gui/accessible/qaccessiblewidget.cpp b/src/gui/accessible/qaccessiblewidget.cpp
index 0a15773..447edc1 100644
--- a/src/gui/accessible/qaccessiblewidget.cpp
+++ b/src/gui/accessible/qaccessiblewidget.cpp
@@ -102,24 +102,7 @@ static QString buddyString(const QWidget *widget)
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text)
{
- if (text.isEmpty())
- return text;
-
- const QChar *ch = text.unicode();
- int length = text.length();
- QString str;
- while (length > 0) {
- if (*ch == QLatin1Char('&')) {
- ++ch;
- --length;
- if (!ch)
- --ch;
- }
- str += *ch;
- ++ch;
- --length;
- }
- return str;
+ return QString(text).remove(QLatin1Char('&'));
}
QString Q_GUI_EXPORT qt_accHotKey(const QString &text)