Changeset 65257 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 12, 2017 11:14:13 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r65255 r65257 21 21 22 22 /* Qt includes: */ 23 # include <QAccessibleWidget> 23 24 # include <QTimer> 24 25 # include <QPainter> … … 95 96 96 97 98 /** QAccessibleWidget extension used as an accessibility interface for UISessionStateStatusBarIndicator. */ 99 class QIAccessibilityInterfaceForUISessionStateStatusBarIndicator : public QAccessibleWidget 100 { 101 public: 102 103 /** Returns an accessibility interface for passed @a strClassname and @a pObject. */ 104 static QAccessibleInterface *pFactory(const QString &strClassname, QObject *pObject) 105 { 106 /* Creating UISessionStateStatusBarIndicator accessibility interface: */ 107 if (pObject && strClassname == QLatin1String("UISessionStateStatusBarIndicator")) 108 return new QIAccessibilityInterfaceForUISessionStateStatusBarIndicator(qobject_cast<QWidget*>(pObject)); 109 110 /* Null by default: */ 111 return 0; 112 } 113 114 /** Constructs an accessibility interface passing @a pWidget to the base-class. */ 115 QIAccessibilityInterfaceForUISessionStateStatusBarIndicator(QWidget *pWidget) 116 : QAccessibleWidget(pWidget, QAccessible::Button) 117 {} 118 119 /** Returns a text for the passed @a enmTextRole. */ 120 virtual QString text(QAccessible::Text /* enmTextRole */) const /* override */ 121 { 122 /* Sanity check: */ 123 AssertPtrReturn(indicator(), 0); 124 125 /* Return the indicator description: */ 126 return indicator()->description(); 127 } 128 129 private: 130 131 /** Returns corresponding UISessionStateStatusBarIndicator. */ 132 UISessionStateStatusBarIndicator *indicator() const { return qobject_cast<UISessionStateStatusBarIndicator*>(widget()); } 133 }; 134 135 97 136 UISessionStateStatusBarIndicator::UISessionStateStatusBarIndicator(IndicatorType enmType, UISession *pSession) 98 137 : m_enmType(enmType) 99 138 , m_pSession(pSession) 100 139 { 140 /* Install UISessionStateStatusBarIndicator accessibility interface factory: */ 141 QAccessible::installFactory(QIAccessibilityInterfaceForUISessionStateStatusBarIndicator::pFactory); 101 142 } 102 143
Note:
See TracChangeset
for help on using the changeset viewer.