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/plugins/accessible/widgets/simplewidgets.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 plugins 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**
     
    210210}
    211211
     212int QAccessibleButton::actionCount()
     213{
     214    return 1;
     215}
     216
     217void QAccessibleButton::doAction(int actionIndex)
     218{
     219    switch (actionIndex) {
     220    case 0:
     221        button()->click();
     222        break;
     223    }
     224}
     225
     226QString QAccessibleButton::description(int actionIndex)
     227{
     228    switch (actionIndex) {
     229    case 0:
     230        return QLatin1String("Clicks the button.");
     231    default:
     232        return QString();
     233    }
     234}
     235
     236QString QAccessibleButton::name(int actionIndex)
     237{
     238    switch (actionIndex) {
     239    case 0:
     240        return QLatin1String("Press");
     241    default:
     242        return QString();
     243    }
     244}
     245
     246QString QAccessibleButton::localizedName(int actionIndex)
     247{
     248    switch (actionIndex) {
     249    case 0:
     250        return tr("Press");
     251    default:
     252        return QString();
     253    }
     254}
     255
     256QStringList QAccessibleButton::keyBindings(int actionIndex)
     257{
     258    switch (actionIndex) {
     259#ifndef QT_NO_SHORTCUT
     260    case 0:
     261        return QStringList() << button()->shortcut().toString();
     262#endif
     263    default:
     264        return QStringList();
     265    }
     266}
     267
    212268#ifndef QT_NO_TOOLBUTTON
    213269/*!
     
    473529            } else if (qobject_cast<QLCDNumber*>(object())) {
    474530                QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
    475                 if (l->numDigits())
     531                if (l->digitCount())
    476532                    str = QString::number(l->value());
    477533                else
     
    547603}
    548604
     605/*! \reimp */
     606QString QAccessibleDisplay::imageDescription()
     607{
     608    return widget()->toolTip();
     609}
     610
     611/*! \reimp */
     612QSize QAccessibleDisplay::imageSize()
     613{
     614    QLabel *label = qobject_cast<QLabel *>(widget());
     615    if (!label)
     616        return QSize();
     617    const QPixmap *pixmap = label->pixmap();
     618    if (!pixmap)
     619        return QSize();
     620    return pixmap->size();
     621}
     622
     623/*! \reimp */
     624QRect QAccessibleDisplay::imagePosition(QAccessible2::CoordinateType coordType)
     625{
     626    QLabel *label = qobject_cast<QLabel *>(widget());
     627    if (!label)
     628        return QRect();
     629    const QPixmap *pixmap = label->pixmap();
     630    if (!pixmap)
     631        return QRect();
     632
     633    switch (coordType) {
     634    case QAccessible2::RelativeToScreen:
     635        return QRect(label->mapToGlobal(label->pos()), label->size());
     636    case QAccessible2::RelativeToParent:
     637        return label->geometry();
     638    }
     639
     640    return QRect();
     641}
     642
    549643#ifndef QT_NO_LINEEDIT
    550644/*!
     
    757851#endif // QT_NO_LINEEDIT
    758852
     853#ifndef QT_NO_PROGRESSBAR
     854QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o)
     855    : QAccessibleDisplay(o)
     856{
     857    Q_ASSERT(progressBar());
     858}
     859
     860QVariant QAccessibleProgressBar::currentValue()
     861{
     862    return progressBar()->value();
     863}
     864
     865QVariant QAccessibleProgressBar::maximumValue()
     866{
     867    return progressBar()->maximum();
     868}
     869
     870QVariant QAccessibleProgressBar::minimumValue()
     871{
     872    return progressBar()->minimum();
     873}
     874
     875QProgressBar *QAccessibleProgressBar::progressBar() const
     876{
     877    return qobject_cast<QProgressBar *>(object());
     878}
     879#endif
     880
    759881#endif // QT_NO_ACCESSIBILITY
    760882
Note: See TracChangeset for help on using the changeset viewer.