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:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • 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;
Note: See TracChangeset for help on using the changeset viewer.