diff options
author | axis <qt-info@nokia.com> | 2009-11-09 08:28:40 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-11-09 08:28:40 (GMT) |
commit | 7fdfa58b958b658feb7b20dd7a7322d235fe4bea (patch) | |
tree | 6c38ed48f7c234ad480aa8ce178b9a00b14d2440 /src/plugins/accessible/widgets/simplewidgets.cpp | |
parent | 7ea04bf5c065a037b2db667572e1947f1a1b8b2e (diff) | |
parent | 68409c24211b4639832ce86113c33a247bb68950 (diff) | |
download | Qt-7fdfa58b958b658feb7b20dd7a7322d235fe4bea.zip Qt-7fdfa58b958b658feb7b20dd7a7322d235fe4bea.tar.gz Qt-7fdfa58b958b658feb7b20dd7a7322d235fe4bea.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-s60
Conflicts:
src/gui/painting/qblendfunctions.cpp
Diffstat (limited to 'src/plugins/accessible/widgets/simplewidgets.cpp')
-rw-r--r-- | src/plugins/accessible/widgets/simplewidgets.cpp | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index aa51759..87d81f0 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -256,9 +256,9 @@ QString QAccessibleButton::localizedName(int actionIndex) QStringList QAccessibleButton::keyBindings(int actionIndex) { switch (actionIndex) { -#ifdef QT_NO_SHORTCUT +#ifndef QT_NO_SHORTCUT case 0: - return button()->shortcut().toString(); + return QStringList() << button()->shortcut().toString(); #endif default: return QStringList(); @@ -602,6 +602,44 @@ int QAccessibleDisplay::navigate(RelationFlag rel, int entry, QAccessibleInterfa return QAccessibleWidgetEx::navigate(rel, entry, target); } +/*! \reimp */ +QString QAccessibleDisplay::imageDescription() +{ + return widget()->toolTip(); +} + +/*! \reimp */ +QSize QAccessibleDisplay::imageSize() +{ + QLabel *label = qobject_cast<QLabel *>(widget()); + if (!label) + return QSize(); + const QPixmap *pixmap = label->pixmap(); + if (!pixmap) + return QSize(); + return pixmap->size(); +} + +/*! \reimp */ +QRect QAccessibleDisplay::imagePosition(QAccessible2::CoordinateType coordType) +{ + QLabel *label = qobject_cast<QLabel *>(widget()); + if (!label) + return QRect(); + const QPixmap *pixmap = label->pixmap(); + if (!pixmap) + return QRect(); + + switch (coordType) { + case QAccessible2::RelativeToScreen: + return QRect(label->mapToGlobal(label->pos()), label->size()); + case QAccessible2::RelativeToParent: + return label->geometry(); + } + + return QRect(); +} + #ifndef QT_NO_LINEEDIT /*! \class QAccessibleLineEdit |