VirtualBox

Changeset 64106 in vbox


Ignore:
Timestamp:
Sep 30, 2016 12:10:19 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111062
Message:

FE/Qt: bugref:6899: Accessibility support (step 64): Continuing with the r111055.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSelector.cpp

    r64100 r64106  
    3939
    4040
    41 /** QAccessibleWidget extension used as an accessibility interface for UIToolBar. */
     41/** QAccessibleWidget extension used as an accessibility interface for UIToolBar buttons. */
    4242class UIAccessibilityInterfaceForUIToolBarButton : public QAccessibleWidget
    4343{
     
    4747    static QAccessibleInterface *pFactory(const QString &strClassname, QObject *pObject)
    4848    {
    49         /* Creating segmented-button accessibility interface: */
     49        /* Creating toolbar button accessibility interface: */
    5050        if (   pObject
    5151            && strClassname == QLatin1String("QToolButton")
     
    5959    /** Constructs an accessibility interface passing @a pWidget to the base-class. */
    6060    UIAccessibilityInterfaceForUIToolBarButton(QWidget *pWidget)
    61         : QAccessibleWidget(pWidget, QAccessible::RadioButton)
     61        : QAccessibleWidget(pWidget, QAccessible::Button)
    6262    {}
    6363
    64     virtual QAccessible::State state() const
     64    /** Returns the role. */
     65    virtual QAccessible::Role role() const /* override */
     66    {
     67        /* Make sure button still alive: */
     68        AssertPtrReturn(button(), QAccessible::NoRole);
     69
     70        /* Return role for checkable button: */
     71        if (button()->isCheckable())
     72            return QAccessible::RadioButton;
     73
     74        /* Return default role: */
     75        return QAccessible::Button;
     76    }
     77
     78    /** Returns the state. */
     79    virtual QAccessible::State state() const /* override */
    6580    {
    6681        /* Prepare the button state: */
     
    7489        state.checked = button()->isChecked();
    7590
    76         /* Return the segment state: */
     91        /* Return the button state: */
    7792        return state;
    7893    }
     
    8095private:
    8196
    82     /** Returns corresponding segmented-button. */
     97    /** Returns corresponding toolbar button. */
    8398    QToolButton *button() const { return qobject_cast<QToolButton*>(widget()); }
    8499};
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette