Changeset 561 for trunk/src/plugins/accessible/widgets/simplewidgets.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/plugins/accessible/widgets/simplewidgets.cpp
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the plugins of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 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. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** 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. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 210 210 } 211 211 212 int QAccessibleButton::actionCount() 213 { 214 return 1; 215 } 216 217 void QAccessibleButton::doAction(int actionIndex) 218 { 219 switch (actionIndex) { 220 case 0: 221 button()->click(); 222 break; 223 } 224 } 225 226 QString 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 236 QString QAccessibleButton::name(int actionIndex) 237 { 238 switch (actionIndex) { 239 case 0: 240 return QLatin1String("Press"); 241 default: 242 return QString(); 243 } 244 } 245 246 QString QAccessibleButton::localizedName(int actionIndex) 247 { 248 switch (actionIndex) { 249 case 0: 250 return tr("Press"); 251 default: 252 return QString(); 253 } 254 } 255 256 QStringList 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 212 268 #ifndef QT_NO_TOOLBUTTON 213 269 /*! … … 473 529 } else if (qobject_cast<QLCDNumber*>(object())) { 474 530 QLCDNumber *l = qobject_cast<QLCDNumber*>(object()); 475 if (l-> numDigits())531 if (l->digitCount()) 476 532 str = QString::number(l->value()); 477 533 else … … 547 603 } 548 604 605 /*! \reimp */ 606 QString QAccessibleDisplay::imageDescription() 607 { 608 return widget()->toolTip(); 609 } 610 611 /*! \reimp */ 612 QSize 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 */ 624 QRect 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 549 643 #ifndef QT_NO_LINEEDIT 550 644 /*! … … 757 851 #endif // QT_NO_LINEEDIT 758 852 853 #ifndef QT_NO_PROGRESSBAR 854 QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o) 855 : QAccessibleDisplay(o) 856 { 857 Q_ASSERT(progressBar()); 858 } 859 860 QVariant QAccessibleProgressBar::currentValue() 861 { 862 return progressBar()->value(); 863 } 864 865 QVariant QAccessibleProgressBar::maximumValue() 866 { 867 return progressBar()->maximum(); 868 } 869 870 QVariant QAccessibleProgressBar::minimumValue() 871 { 872 return progressBar()->minimum(); 873 } 874 875 QProgressBar *QAccessibleProgressBar::progressBar() const 876 { 877 return qobject_cast<QProgressBar *>(object()); 878 } 879 #endif 880 759 881 #endif // QT_NO_ACCESSIBILITY 760 882
Note:
See TracChangeset
for help on using the changeset viewer.