diff options
Diffstat (limited to 'src/plugins/accessible')
-rw-r--r-- | src/plugins/accessible/widgets/main.cpp | 4 | ||||
-rw-r--r-- | src/plugins/accessible/widgets/simplewidgets.cpp | 28 | ||||
-rw-r--r-- | src/plugins/accessible/widgets/simplewidgets.h | 19 |
3 files changed, 50 insertions, 1 deletions
diff --git a/src/plugins/accessible/widgets/main.cpp b/src/plugins/accessible/widgets/main.cpp index 667de88..9a9a778 100644 --- a/src/plugins/accessible/widgets/main.cpp +++ b/src/plugins/accessible/widgets/main.cpp @@ -234,8 +234,10 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec iface = new QAccessibleDisplay(widget, Grouping); } else if (classname == QLatin1String("QStatusBar")) { iface = new QAccessibleWidgetEx(widget, StatusBar); +#ifndef QT_NO_PROGRESSBAR } else if (classname == QLatin1String("QProgressBar")) { - iface = new QAccessibleDisplay(widget); + iface = new QAccessibleProgressBar(widget); +#endif } else if (classname == QLatin1String("QToolBar")) { iface = new QAccessibleWidgetEx(widget, ToolBar, widget->windowTitle()); #ifndef QT_NO_MENUBAR diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index 1aadd6c..89482bb 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -756,6 +756,34 @@ void QAccessibleLineEdit::scrollToSubstring(int startIndex, int endIndex) #endif // QT_NO_LINEEDIT +#ifndef QT_NO_PROGRESSBAR +QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o) + : QAccessibleDisplay(o) +{ + Q_ASSERT(progressBar()); +} + +QVariant QAccessibleProgressBar::currentValue() +{ + return progressBar()->value(); +} + +QVariant QAccessibleProgressBar::maximumValue() +{ + return progressBar()->maximum(); +} + +QVariant QAccessibleProgressBar::minimumValue() +{ + return progressBar()->minimum(); +} + +QProgressBar *QAccessibleProgressBar::progressBar() const +{ + return qobject_cast<QProgressBar *>(object()); +} +#endif + #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE diff --git a/src/plugins/accessible/widgets/simplewidgets.h b/src/plugins/accessible/widgets/simplewidgets.h index abe5bdc..8de35ef 100644 --- a/src/plugins/accessible/widgets/simplewidgets.h +++ b/src/plugins/accessible/widgets/simplewidgets.h @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE class QAbstractButton; class QLineEdit; class QToolButton; +class QProgressBar; class QAccessibleButton : public QAccessibleWidgetEx { @@ -150,6 +151,24 @@ protected: }; #endif // QT_NO_LINEEDIT +#ifndef QT_NO_PROGRESSBAR +class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface +{ + Q_ACCESSIBLE_OBJECT +public: + explicit QAccessibleProgressBar(QWidget *o); + + // QAccessibleValueInterface + QVariant currentValue(); + QVariant maximumValue(); + QVariant minimumValue(); + inline void setCurrentValue(const QVariant &) {} + +protected: + QProgressBar *progressBar() const; +}; +#endif + #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE |