summaryrefslogtreecommitdiffstats
path: root/src/plugins/accessible/widgets/simplewidgets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/accessible/widgets/simplewidgets.cpp')
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.cpp42
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