diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2009-11-06 14:15:05 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2009-11-06 14:16:11 (GMT) |
commit | 4ad6343be52b757fd354cd92874bca944d2ede49 (patch) | |
tree | 68d9fa38a04de8959310b977f295184e2b4a8bdd /src/plugins/accessible/widgets/simplewidgets.cpp | |
parent | f8883337699d59e3b5eb9393067a24fb43fb2604 (diff) | |
download | Qt-4ad6343be52b757fd354cd92874bca944d2ede49.zip Qt-4ad6343be52b757fd354cd92874bca944d2ede49.tar.gz Qt-4ad6343be52b757fd354cd92874bca944d2ede49.tar.bz2 |
Add preliminary QAccessibleImage interface
As requested by the Maemo team.
Diffstat (limited to 'src/plugins/accessible/widgets/simplewidgets.cpp')
-rw-r--r-- | src/plugins/accessible/widgets/simplewidgets.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index aa51759..1d801e4 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -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 |