Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/accessible/accessible.pri

    r2 r561  
    1515      mac:!embedded {
    1616        HEADERS += accessible/qaccessible_mac_p.h
    17         OBJECTIVE_SOURCES += accessible/qaccessible_mac.mm
     17        OBJECTIVE_SOURCES += accessible/qaccessible_mac.mm \
     18                             accessible/qaccessible_mac_cocoa.mm
    1819      } else:win32 {
    1920        SOURCES += accessible/qaccessible_win.cpp
  • trunk/src/gui/accessible/qaccessible.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6262
    6363    \ingroup accessibility
    64     \mainclass
     64
    6565
    6666    Accessible applications can be used by people who are not able to
     
    395395#endif
    396396
    397 Q_GLOBAL_STATIC(QList<QAccessible::InterfaceFactory>, qAccessibleFactories);
     397Q_GLOBAL_STATIC(QList<QAccessible::InterfaceFactory>, qAccessibleFactories)
    398398
    399399QAccessible::UpdateHandler QAccessible::updateHandler = 0;
     
    985985
    986986/*!
     987    \fn QAccessibleActionInterface *QAccessibleInterface::actionInterface()
     988    \internal
     989*/
     990
     991/*!
     992    \fn QAccessibleImageInterface *QAccessibleInterface::imageInterface()
     993    \internal
     994*/
     995
     996/*!
    987997    \class QAccessibleEvent
    988998    \brief The QAccessibleEvent class is used to query addition
  • trunk/src/gui/accessible/qaccessible.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    211211        Clock          = 0x0000003D,
    212212        Splitter       = 0x0000003E,
     213        // Additional Qt roles where enum value does not map directly to MSAA:
    213214        LayeredPane    = 0x0000003F,
    214215        UserRole       = 0x0000ffff
     
    310311        EditableTextInterface,
    311312        ValueInterface,
    312         TableInterface
     313        TableInterface,
     314        ActionInterface,
     315        ImageInterface
    313316    };
    314317}
     
    319322class QAccessibleValueInterface;
    320323class QAccessibleTableInterface;
     324class QAccessibleActionInterface;
     325class QAccessibleImageInterface;
    321326
    322327class Q_GUI_EXPORT QAccessibleInterface : public QAccessible
     
    375380    inline QAccessibleTableInterface *tableInterface()
    376381    { return reinterpret_cast<QAccessibleTableInterface *>(cast_helper(QAccessible2::TableInterface)); }
     382
     383    inline QAccessibleActionInterface *actionInterface()
     384    { return reinterpret_cast<QAccessibleActionInterface *>(cast_helper(QAccessible2::ActionInterface)); }
     385
     386    inline QAccessibleImageInterface *imageInterface()
     387    { return reinterpret_cast<QAccessibleImageInterface *>(cast_helper(QAccessible2::ImageInterface)); }
    377388
    378389private:
  • trunk/src/gui/accessible/qaccessible2.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    105105    \brief The QAccessibleValueInterface class implements support for
    106106    the IAccessibleValue interface.
     107
     108    \link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
     109*/
     110
     111/*!
     112    \class QAccessibleActionInterface
     113    \ingroup accessibility
     114    \internal
     115    \preliminary
     116
     117    \brief The QAccessibleActionInterface class implements support for
     118    the IAccessibleAction interface.
     119
     120    \link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
     121*/
     122
     123/*!
     124    \class QAccessibleImageInterface
     125    \ingroup accessibility
     126    \internal
     127    \preliminary
     128
     129    \brief The QAccessibleImageInterface class implements support for
     130    the IAccessibleImage interface.
    107131
    108132    \link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
  • trunk/src/gui/accessible/qaccessible2.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    8282inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return 0; }
    8383inline QAccessible2Interface *qAccessibleTableCastHelper() { return 0; }
     84inline QAccessible2Interface *qAccessibleActionCastHelper() { return 0; }
     85inline QAccessible2Interface *qAccessibleImageCastHelper() { return 0; }
    8486
    8587#define Q_ACCESSIBLE_OBJECT \
     
    9698        case QAccessible2::TableInterface: \
    9799            return qAccessibleTableCastHelper(); \
     100        case QAccessible2::ActionInterface: \
     101            return qAccessibleActionCastHelper(); \
     102        case QAccessible2::ImageInterface: \
     103            return qAccessibleImageCastHelper(); \
    98104        } \
    99105        return 0; \
     
    209215};
    210216
     217class Q_GUI_EXPORT QAccessibleActionInterface : public QAccessible2Interface
     218{
     219public:
     220    inline QAccessible2Interface *qAccessibleActionCastHelper() { return this; }
     221
     222    virtual int actionCount() = 0;
     223    virtual void doAction(int actionIndex) = 0;
     224    virtual QString description(int actionIndex) = 0;
     225    virtual QString name(int actionIndex) = 0;
     226    virtual QString localizedName(int actionIndex) = 0;
     227    virtual QStringList keyBindings(int actionIndex) = 0;
     228};
     229
     230class Q_GUI_EXPORT QAccessibleImageInterface : public QAccessible2Interface
     231{
     232public:
     233    inline QAccessible2Interface *qAccessibleImageCastHelper() { return this; }
     234
     235    virtual QString imageDescription() = 0;
     236    virtual QSize imageSize() = 0;
     237    virtual QRect imagePosition(QAccessible2::CoordinateType coordType) = 0;
     238};
     239
    211240#endif // QT_NO_ACCESSIBILITY
    212241
  • trunk/src/gui/accessible/qaccessible_mac.mm

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    505505
    506506QAElement::QAElement(HIObjectRef object, int child)
    507     :elementRef(
    508 #ifndef QT_MAC_USE_COCOA
    509                 AXUIElementCreateWithHIObjectAndIdentifier(object, child)
    510 #endif
    511 )
    512507{
    513508#ifndef QT_MAC_USE_COCOA
     
    12331228    else if (CFStringCompare(attribute, CFStringRef(QAXHelpAttribute), 0) == kCFCompareEqualTo)
    12341229        return QAccessible::Help;
    1235 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
    12361230    else if (CFStringCompare(attribute, CFStringRef(QAXDescriptionAttribute), 0) == kCFCompareEqualTo)
    12371231        return QAccessible::Description;
    1238 #endif
    12391232    else
    12401233        return -1;
     
    14431436    qt_mac_append_cf_uniq(attrs, CFStringRef(QAXEnabledAttribute));
    14441437    qt_mac_append_cf_uniq(attrs, CFStringRef(QAXWindowAttribute));
    1445 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
    14461438    qt_mac_append_cf_uniq(attrs, CFStringRef(QAXTopLevelUIElementAttribute));
    1447 #endif
    14481439
    14491440    // Append these names if the QInterafceItem returns any data for them.
    14501441    appendIfSupported(attrs, CFStringRef(QAXTitleAttribute), interface);
    14511442    appendIfSupported(attrs, CFStringRef(QAXValueAttribute), interface);
    1452 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
    14531443    appendIfSupported(attrs, CFStringRef(QAXDescriptionAttribute), interface);
    14541444    appendIfSupported(attrs, CFStringRef(QAXLinkedUIElementsAttribute), interface);
    1455 #endif
    14561445    appendIfSupported(attrs, CFStringRef(QAXHelpAttribute), interface);
    14571446    appendIfSupported(attrs, CFStringRef(QAXTitleUIElementAttribute), interface);
     
    17061695    has the Window role. (Can also be a sheet or a drawer)
    17071696*/
    1708 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
    17091697static OSStatus handleTopLevelUIElementAttribute(EventHandlerCallRef next_ref, EventRef event, const QAInterface &interface)
    17101698{
    17111699    return navigateAncestors<IsWindowTest>(next_ref, event, interface, CFStringRef(QAXTopLevelUIElementAttribute));
    17121700}
    1713 #endif
    17141701
    17151702/*
     
    18891876    if (CFStringCompare(var, CFStringRef(QAXChildrenAttribute), 0) == kCFCompareEqualTo) {
    18901877        return handleChildrenAttribute(next_ref, event, interface);
    1891 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
    18921878    } else if(CFStringCompare(var, CFStringRef(QAXTopLevelUIElementAttribute), 0) == kCFCompareEqualTo) {
    18931879        return handleTopLevelUIElementAttribute(next_ref, event, interface);
    1894 #endif
    18951880    } else if(CFStringCompare(var, CFStringRef(QAXWindowAttribute), 0) == kCFCompareEqualTo) {
    18961881        return handleWindowAttribute(next_ref, event, interface);
     
    19821967        return handleSubroleAttribute(next_ref, event, interface);
    19831968    } else if (CFStringCompare(var, CFStringRef(QAXRoleDescriptionAttribute), 0) == kCFCompareEqualTo) {
    1984 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) && !defined(QT_MAC_USE_COCOA)
     1969#if !defined(QT_MAC_USE_COCOA)
    19851970        if (HICopyAccessibilityRoleDescription) {
    19861971            const CFStringRef roleDescription = HICopyAccessibilityRoleDescription(macRole(interface), 0);
     
    20061991            handleStringAttribute(event, text, interface);
    20071992        }
    2008 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
    20091993    } else if (CFStringCompare(var, CFStringRef(QAXDescriptionAttribute), 0) == kCFCompareEqualTo) {
    20101994        const QAccessible::Role role = interface.role();
     
    20131997    } else if (CFStringCompare(var, CFStringRef(QAXLinkedUIElementsAttribute), 0) == kCFCompareEqualTo) {
    20141998        return CallNextEventHandler(next_ref, event);
    2015 #endif
    20161999    } else if (CFStringCompare(var, CFStringRef(QAXHelpAttribute), 0) == kCFCompareEqualTo) {
    20172000        const QAccessible::Role role = interface.role();
  • trunk/src/gui/accessible/qaccessible_mac_carbon.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessible_mac_cocoa.mm

    r2 r561  
     1/****************************************************************************
     2**
     3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
     6**
     7** This file is part of the QtGui module of the Qt Toolkit.
     8**
     9** $QT_BEGIN_LICENSE:LGPL$
     10** Commercial Usage
     11** Licensees holding valid Qt Commercial licenses may use this file in
     12** accordance with the Qt Commercial License Agreement provided with the
     13** Software or, alternatively, in accordance with the terms contained in
     14** a written agreement between you and Nokia.
     15**
     16** GNU Lesser General Public License Usage
     17** Alternatively, this file may be used under the terms of the GNU Lesser
     18** General Public License version 2.1 as published by the Free Software
     19** Foundation and appearing in the file LICENSE.LGPL included in the
     20** packaging of this file.  Please review the following information to
     21** ensure the GNU Lesser General Public License version 2.1 requirements
     22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
     23**
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
     27**
     28** GNU General Public License Usage
     29** Alternatively, this file may be used under the terms of the GNU
     30** General Public License version 3.0 as published by the Free Software
     31** Foundation and appearing in the file LICENSE.GPL included in the
     32** packaging of this file.  Please review the following information to
     33** ensure the GNU General Public License version 3.0 requirements will be
     34** met: http://www.gnu.org/copyleft/gpl.html.
     35**
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
     38** $QT_END_LICENSE$
     39**
     40****************************************************************************/
     41
     42
     43#include "qaccessible.h"
     44#include "qaccessible_mac_p.h"
     45#include "qdebug.h"
     46#include "qtabwidget.h"
     47
     48#include <private/qt_mac_p.h>
     49#include <private/qcocoaview_mac_p.h>
     50#include <private/qwidget_p.h>
     51
     52
     53#ifndef QT_NO_ACCESSIBILITY
     54
     55#ifdef QT_MAC_USE_COCOA
     56
     57QT_BEGIN_NAMESPACE
     58
     59//#define MAC_ACCESSIBILTY_DEVELOPER_MODE
     60
     61#ifdef MAC_ACCESSIBILTY_DEVELOPER_MODE
     62#define MAC_ACCESSIBILTY_DEBUG QT_PREPEND_NAMESPACE(qDebug)
     63#else
     64#define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(qDebug)
     65#endif
     66
     67typedef QMap<QAccessible::Role, NSString *> QMacAccessibiltyRoleMap;
     68Q_GLOBAL_STATIC(QMacAccessibiltyRoleMap, qMacAccessibiltyRoleMap);
     69
     70static QAInterface interfaceForView(QT_MANGLE_NAMESPACE(QCocoaView) *view)
     71{
     72    return QAInterface(QAccessible::queryAccessibleInterface([view qt_qwidget]));
     73}
     74
     75/*
     76    Set up mappings from Qt accessibilty roles to Mac accessibilty roles.
     77*/
     78static void populateRoleMap()
     79{
     80    QMacAccessibiltyRoleMap &roleMap = *qMacAccessibiltyRoleMap();
     81    roleMap[QAccessible::MenuItem] = NSAccessibilityMenuItemRole;
     82    roleMap[QAccessible::MenuBar] = NSAccessibilityMenuBarRole;
     83    roleMap[QAccessible::ScrollBar] = NSAccessibilityScrollBarRole;
     84    roleMap[QAccessible::Grip] = NSAccessibilityGrowAreaRole;
     85    roleMap[QAccessible::Window] = NSAccessibilityWindowRole;
     86    roleMap[QAccessible::Dialog] = NSAccessibilityWindowRole;
     87    roleMap[QAccessible::AlertMessage] = NSAccessibilityWindowRole;
     88    roleMap[QAccessible::ToolTip] = NSAccessibilityWindowRole;
     89    roleMap[QAccessible::HelpBalloon] = NSAccessibilityWindowRole;
     90    roleMap[QAccessible::PopupMenu] = NSAccessibilityMenuRole;
     91    roleMap[QAccessible::Application] = NSAccessibilityApplicationRole;
     92    roleMap[QAccessible::Pane] = NSAccessibilityGroupRole;
     93    roleMap[QAccessible::Grouping] = NSAccessibilityGroupRole;
     94    roleMap[QAccessible::Separator] = NSAccessibilitySplitterRole;
     95    roleMap[QAccessible::ToolBar] = NSAccessibilityToolbarRole;
     96    roleMap[QAccessible::PageTab] = NSAccessibilityRadioButtonRole;
     97    roleMap[QAccessible::ButtonMenu] = NSAccessibilityMenuButtonRole;
     98    roleMap[QAccessible::ButtonDropDown] = NSAccessibilityPopUpButtonRole;
     99    roleMap[QAccessible::SpinBox] = NSAccessibilityIncrementorRole;
     100    roleMap[QAccessible::Slider] = NSAccessibilitySliderRole;
     101    roleMap[QAccessible::ProgressBar] = NSAccessibilityProgressIndicatorRole;
     102    roleMap[QAccessible::ComboBox] = NSAccessibilityPopUpButtonRole;
     103    roleMap[QAccessible::RadioButton] = NSAccessibilityRadioButtonRole;
     104    roleMap[QAccessible::CheckBox] = NSAccessibilityCheckBoxRole;
     105    roleMap[QAccessible::StaticText] = NSAccessibilityStaticTextRole;
     106    roleMap[QAccessible::Table] = NSAccessibilityTableRole;
     107    roleMap[QAccessible::StatusBar] = NSAccessibilityStaticTextRole;
     108    roleMap[QAccessible::Column] = NSAccessibilityColumnRole;
     109    roleMap[QAccessible::ColumnHeader] = NSAccessibilityColumnRole;
     110    roleMap[QAccessible::Row] = NSAccessibilityRowRole;
     111    roleMap[QAccessible::RowHeader] = NSAccessibilityRowRole;
     112    roleMap[QAccessible::Cell] = NSAccessibilityTextFieldRole;
     113    roleMap[QAccessible::PushButton] = NSAccessibilityButtonRole;
     114    roleMap[QAccessible::EditableText] = NSAccessibilityTextFieldRole;
     115    roleMap[QAccessible::Link] = NSAccessibilityTextFieldRole;
     116    roleMap[QAccessible::Indicator] = NSAccessibilityValueIndicatorRole;
     117    roleMap[QAccessible::Splitter] = NSAccessibilitySplitGroupRole;
     118    roleMap[QAccessible::List] = NSAccessibilityListRole;
     119    roleMap[QAccessible::ListItem] = NSAccessibilityStaticTextRole;
     120    roleMap[QAccessible::Cell] = NSAccessibilityStaticTextRole;
     121}
     122
     123/*
     124    Returns a Mac accessibility role for the given interface, or
     125    NSAccessibilityUnknownRole if no role mapping is found.
     126*/
     127static NSString *macRoleForInterface(QAInterface interface)
     128{
     129    const QAccessible::Role qtRole = interface.role();
     130    QMacAccessibiltyRoleMap &roleMap = *qMacAccessibiltyRoleMap();
     131
     132    if (roleMap.isEmpty())
     133        populateRoleMap();
     134
     135    MAC_ACCESSIBILTY_DEBUG() << "role for" << interface.object() << "interface role" << hex << qtRole;
     136
     137    if (roleMap.contains(qtRole)) {
     138        MAC_ACCESSIBILTY_DEBUG() << "return" <<  roleMap[qtRole];
     139        return roleMap[qtRole];
     140    }
     141
     142    MAC_ACCESSIBILTY_DEBUG() << "return NSAccessibilityUnknownRole";
     143    return NSAccessibilityUnknownRole;
     144}
     145
     146/*
     147    Is the interface a QTabBar embedded in a QTabWidget?
     148    (as opposed to a stand-alone tab bar)
     149*/
     150static bool isEmbeddedTabBar(const QAInterface &interface)
     151{
     152    QObject *object = interface.object();
     153    if (interface.role() == QAccessible::PageTabList && object)
     154        return (qobject_cast<QTabWidget *>(object->parent()));
     155
     156    return false;
     157}
     158
     159static bool isInterfaceIgnored(QAInterface interface)
     160{
     161    // Mac accessibility does not have an attribute that corresponds to the
     162    // Invisible/Offscreen state. Use the ignore facility to disable them.
     163    const QAccessible::State state = interface.state();
     164    if (state & QAccessible::Invisible ||
     165        state & QAccessible::Offscreen )
     166        return false;
     167
     168    // Hide QTabBars that has a QTabWidget parent (the QTabWidget handles the accessibility)
     169    if (isEmbeddedTabBar(interface))
     170        return false;
     171
     172    if (QObject * const object = interface.object()) {
     173        const QString className = QLatin1String(object->metaObject()->className());
     174
     175        // Prevent VoiceOver from focusing on tool tips by ignoring those
     176        // interfaces. Shifting VoiceOver focus to the tool tip is confusing
     177        // and the contents of the tool tip is avalible through the description
     178        // attribute anyway.
     179        if (className == QLatin1String("QTipLabel"))
     180            return false;
     181    }
     182
     183    // Hide interfaces with an unknown role. When developing it's often useful to disable
     184    // this check to see all interfaces in the hierarchy.
     185#ifndef MAC_ACCESSIBILTY_DEVELOPER_MODE
     186    return [macRoleForInterface(interface) isEqualToString: NSAccessibilityUnknownRole];
     187#else
     188    return NO;
     189#endif
     190}
     191
     192QT_END_NAMESPACE
     193
     194@implementation QT_MANGLE_NAMESPACE(QCocoaView) (Accessibility)
     195
     196- (BOOL)accessibilityIsIgnored
     197{
     198    QT_PREPEND_NAMESPACE(QAInterface) interface = QT_PREPEND_NAMESPACE(interfaceForView)(self);
     199    return isInterfaceIgnored(interface);
     200}
     201
     202- (NSArray *)accessibilityAttributeNames
     203{
     204    QT_PREPEND_NAMESPACE(QAInterface) interface = QT_PREPEND_NAMESPACE(interfaceForView)(self);
     205
     206    static NSArray *attributes = nil;
     207    if (attributes == nil) {
     208        attributes = [super accessibilityAttributeNames];
     209
     210    }
     211    return attributes;
     212}
     213
     214- (id)accessibilityAttributeValue:(NSString *)attribute
     215{
     216    MAC_ACCESSIBILTY_DEBUG() << "accessibilityAttributeValue" << self << 
     217            QT_PREPEND_NAMESPACE(QCFString)::toQString(reinterpret_cast<CFStringRef>(attribute));
     218
     219    QT_PREPEND_NAMESPACE(QAInterface) interface = QT_PREPEND_NAMESPACE(interfaceForView)(self);
     220
     221    // Switch on the attribute name and call the appropriate handler function.
     222    // Pass the call on to the NSView class for attributes we don't handle.
     223    if ([attribute isEqualToString:@"AXRole"]) {
     224        return macRoleForInterface(interface);
     225    } else {
     226        return [super accessibilityAttributeValue:attribute];   
     227    }
     228}
     229
     230@end
     231
     232#endif // QT_MAC_USE_COCOA
     233
     234#endif // QT_NO_ACCESSIBILITY
     235
  • trunk/src/gui/accessible/qaccessible_mac_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessible_unix.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessible_win.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5151#include <winuser.h>
    5252#if !defined(WINABLEAPI)
    53 #  if defined(Q_OS_WINCE)
     53#  if defined(Q_WS_WINCE)
    5454#    include <bldver.h>
    5555#  endif
     
    6262#endif
    6363
    64 #ifdef Q_OS_WINCE
     64#ifdef Q_WS_WINCE
    6565#include "qguifunctions_wince.h"
    6666#endif
     
    178178    }
    179179
    180     QByteArray soundName;
     180    QString soundName;
    181181    switch (reason) {
    182182    case PopupMenuStart:
    183         soundName = "MenuPopup";
     183        soundName = QLatin1String("MenuPopup");
    184184        break;
    185185
    186186    case MenuCommand:
    187         soundName = "MenuCommand";
     187        soundName = QLatin1String("MenuCommand");
    188188        break;
    189189
     
    195195                switch (mb->icon()) {
    196196                case QMessageBox::Warning:
    197                     soundName = "SystemExclamation";
     197                    soundName = QLatin1String("SystemExclamation");
    198198                    break;
    199199                case QMessageBox::Critical:
    200                     soundName = "SystemHand";
     200                    soundName = QLatin1String("SystemHand");
    201201                    break;
    202202                case QMessageBox::Information:
    203                     soundName = "SystemAsterisk";
     203                    soundName = QLatin1String("SystemAsterisk");
    204204                    break;
    205205                default:
     
    209209#endif // QT_NO_MESSAGEBOX
    210210            {
    211                 soundName = "SystemAsterisk";
     211                soundName = QLatin1String("SystemAsterisk");
    212212            }
    213213
     
    220220    if (soundName.size()) {
    221221#ifndef QT_NO_SETTINGS
    222         QSettings settings(QLatin1String("HKEY_CURRENT_USER\\AppEvents\\Schemes\\Apps\\.Default\\") +
    223                                          QString::fromLatin1(soundName.constData()), QSettings::NativeFormat);
     222        QSettings settings(QLatin1String("HKEY_CURRENT_USER\\AppEvents\\Schemes\\Apps\\.Default\\") + soundName,
     223                           QSettings::NativeFormat);
    224224        QString file = settings.value(QLatin1String(".Current/.")).toString();
    225225#else
    226                 QString file;
     226        QString file;
    227227#endif
    228                 if (!file.isEmpty()) {
    229                 QT_WA({
    230                                 PlaySoundW(reinterpret_cast<const wchar_t *> (QString::fromLatin1(soundName).utf16()), 0, SND_ALIAS | SND_ASYNC | SND_NODEFAULT | SND_NOWAIT );
    231                         } , {
    232                                 PlaySoundA(soundName.constData(), 0, SND_ALIAS | SND_ASYNC | SND_NODEFAULT | SND_NOWAIT );
    233                         });
    234                 }
    235         }
     228        if (!file.isEmpty()) {
     229                                    PlaySound(reinterpret_cast<const wchar_t *>(soundName.utf16()), 0, SND_ALIAS | SND_ASYNC | SND_NODEFAULT | SND_NOWAIT);
     230        }
     231    }
    236232
    237233    if (!isActive())
     
    240236    typedef void (WINAPI *PtrNotifyWinEvent)(DWORD, HWND, LONG, LONG);
    241237
    242 #if defined(Q_OS_WINCE) // ### TODO: check for NotifyWinEvent in CE 6.0
     238#if defined(Q_WS_WINCE) // ### TODO: check for NotifyWinEvent in CE 6.0
    243239    // There is no user32.lib nor NotifyWinEvent for CE
    244240    return;
     
    271267        if (reason != QAccessible::ContextHelpStart &&
    272268             reason != QAccessible::ContextHelpEnd)
    273             w = qApp->focusWidget();
     269            w = QApplication::focusWidget();
    274270        if (!w) {
    275             w = qApp->activeWindow();
     271            w = QApplication::activeWindow();
    276272
    277273            if (!w)
     
    290286        ptrNotifyWinEvent(reason, w->winId(), OBJID_CLIENT, who);
    291287    }
    292 #endif // Q_OS_WINCE
     288#endif // Q_WS_WINCE
    293289}
    294290
     
    10561052    Role role = accessible->role(varID.lVal);
    10571053    if (role != NoRole) {
     1054        if (role == LayeredPane)
     1055            role = QAccessible::Pane;
    10581056        (*pvarRole).vt = VT_I4;
    10591057        (*pvarRole).lVal = role;
  • trunk/src/gui/accessible/qaccessiblebridge.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessiblebridge.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessibleobject.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    213213{
    214214    QWidgetList list;
    215     const QWidgetList tlw(qApp->topLevelWidgets());
     215    const QWidgetList tlw(QApplication::topLevelWidgets());
    216216    for (int i = 0; i < tlw.count(); ++i) {
    217217        QWidget *w = tlw.at(i);
     
    309309        break;
    310310    case FocusChild:
    311         targetObject = qApp->activeWindow();
     311        targetObject = QApplication::activeWindow();
    312312        break;
    313313    default:
     
    323323    switch (t) {
    324324    case Name:
    325         if (qApp->activeWindow())
    326             return qApp->activeWindow()->windowTitle();
     325        if (QApplication::activeWindow())
     326            return QApplication::activeWindow()->windowTitle();
    327327        break;
    328328    case Description:
    329         return qApp->applicationFilePath();
     329        return QApplication::applicationFilePath();
    330330    default:
    331331        break;
     
    343343QAccessible::State QAccessibleApplication::state(int) const
    344344{
    345     return qApp->activeWindow() ? Focused : Normal;
     345    return QApplication::activeWindow() ? Focused : Normal;
    346346}
    347347
     
    357357    if (action == 0 || action == 1) {
    358358        QWidget *w = 0;
    359         w = qApp->activeWindow();
     359        w = QApplication::activeWindow();
    360360        if (!w)
    361361            w = topLevelWidgets().at(0);
  • trunk/src/gui/accessible/qaccessibleobject.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessibleplugin.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessibleplugin.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/accessible/qaccessiblewidget.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    103103QString Q_GUI_EXPORT qt_accStripAmp(const QString &text)
    104104{
    105     if (text.isEmpty())
    106         return text;
    107 
    108     const QChar *ch = text.unicode();
    109     int length = text.length();
    110     QString str;
    111     while (length > 0) {
    112         if (*ch == QLatin1Char('&')) {
    113             ++ch;
    114             --length;
    115             if (!ch)
    116                 --ch;
    117         }
    118         str += *ch;
    119         ++ch;
    120         --length;
    121     }
    122     return str;
     105    return QString(text).remove(QLatin1Char('&'));
    123106}
    124107
  • trunk/src/gui/accessible/qaccessiblewidget.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
Note: See TracChangeset for help on using the changeset viewer.