diff options
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 21 | ||||
-rw-r--r-- | src/gui/accessible/qaccessible.h | 9 | ||||
-rw-r--r-- | src/widgets/accessible/qaccessiblewidget.cpp | 14 | ||||
-rw-r--r-- | src/widgets/accessible/qaccessiblewidget.h | 3 |
4 files changed, 32 insertions, 15 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 172bd7f8e3..2de60e1bd4 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -1060,20 +1060,31 @@ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > QAccessibleInterfa \sa text(), role() */ + /*! - \fn QColor QAccessibleInterface::backgroundColor() + \fn QAccessibleEditableTextInterface *QAccessibleInterface::editableTextInterface() \internal */ /*! - \fn QAccessibleEditableTextInterface *QAccessibleInterface::editableTextInterface() - \internal + Returns the accessible's foreground color if applicable or an invalid QColor. + + \sa backgroundColor() */ +QColor QAccessibleInterface::foregroundColor() const +{ + return QColor(); +} /*! - \fn QColor QAccessibleInterface::foregroundColor() - \internal + Returns the accessible's background color if applicable or an invalid QColor. + + \sa foregroundColor() */ +QColor QAccessibleInterface::backgroundColor() const +{ + return QColor(); +} /*! \fn QAccessibleTextInterface *QAccessibleInterface::textInterface() diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index b0c334c90b..cba50f3ac4 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -389,18 +389,15 @@ public: virtual Role role(int child = 0) const = 0; virtual State state(int child = 0) const = 0; + virtual QColor foregroundColor() const; + virtual QColor backgroundColor() const; + virtual QVariant invokeMethod(Method method, int child = 0, const QVariantList ¶ms = QVariantList()); inline QSet<Method> supportedMethods() { return qvariant_cast<QSet<Method> >(invokeMethod(ListSupportedMethods)); } - inline QColor foregroundColor() - { return qvariant_cast<QColor>(invokeMethod(ForegroundColor)); } - - inline QColor backgroundColor() - { return qvariant_cast<QColor>(invokeMethod(BackgroundColor)); } - inline QAccessibleTextInterface *textInterface() { return reinterpret_cast<QAccessibleTextInterface *>(cast_helper(QAccessible2::TextInterface)); } diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index a4a1da7242..73ccb90347 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -866,6 +866,16 @@ QAccessible::State QAccessibleWidget::state(int child) const return state; } +QColor QAccessibleWidget::foregroundColor() const +{ + return widget()->palette().color(widget()->foregroundRole()); +} + +QColor QAccessibleWidget::backgroundColor() const +{ + return widget()->palette().color(widget()->backgroundRole()); +} + QVariant QAccessibleWidget::invokeMethod(Method method, int child, const QVariantList & /*params*/) { if (child) @@ -877,10 +887,6 @@ QVariant QAccessibleWidget::invokeMethod(Method method, int child, const QVarian set << ListSupportedMethods << ForegroundColor << BackgroundColor; return QVariant::fromValue(set); } - case ForegroundColor: - return widget()->palette().color(widget()->foregroundRole()); - case BackgroundColor: - return widget()->palette().color(widget()->backgroundRole()); default: return QVariant(); } diff --git a/src/widgets/accessible/qaccessiblewidget.h b/src/widgets/accessible/qaccessiblewidget.h index 07fdd97734..9a6dae69e7 100644 --- a/src/widgets/accessible/qaccessiblewidget.h +++ b/src/widgets/accessible/qaccessiblewidget.h @@ -75,6 +75,9 @@ public: Role role(int child = 0) const; State state(int child = 0) const; + QColor foregroundColor() const; + QColor backgroundColor() const; + QVariant invokeMethod(Method method, int child, const QVariantList ¶ms); protected: |