| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/accessible/rangecontrols.cpp | 
| Source code | Switch to Preprocessed file | 
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||
| 2 | ** | - | ||||||
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. | - | ||||||
| 4 | ** Contact: http://www.qt.io/licensing/ | - | ||||||
| 5 | ** | - | ||||||
| 6 | ** This file is part of the plugins of the Qt Toolkit. | - | ||||||
| 7 | ** | - | ||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL21$ | - | ||||||
| 9 | ** Commercial License Usage | - | ||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further | - | ||||||
| 15 | ** information use the contact form at http://www.qt.io/contact-us. | - | ||||||
| 16 | ** | - | ||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||
| 19 | ** General Public License version 2.1 or version 3 as published by the Free | - | ||||||
| 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and | - | ||||||
| 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the | - | ||||||
| 22 | ** following information to ensure the GNU Lesser General Public License | - | ||||||
| 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | - | ||||||
| 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - | ||||||
| 25 | ** | - | ||||||
| 26 | ** As a special exception, The Qt Company gives you certain additional | - | ||||||
| 27 | ** rights. These rights are described in The Qt Company LGPL Exception | - | ||||||
| 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - | ||||||
| 29 | ** | - | ||||||
| 30 | ** $QT_END_LICENSE$ | - | ||||||
| 31 | ** | - | ||||||
| 32 | ****************************************************************************/ | - | ||||||
| 33 | - | |||||||
| 34 | #include "rangecontrols_p.h" | - | ||||||
| 35 | - | |||||||
| 36 | #include <qslider.h> | - | ||||||
| 37 | #include <qdial.h> | - | ||||||
| 38 | #include <qspinbox.h> | - | ||||||
| 39 | #include <qscrollbar.h> | - | ||||||
| 40 | #include <qstyle.h> | - | ||||||
| 41 | #include <qstyleoption.h> | - | ||||||
| 42 | #include <qdebug.h> | - | ||||||
| 43 | #include <qglobal.h> | - | ||||||
| 44 | #include <QDoubleSpinBox> | - | ||||||
| 45 | #include <QDial> | - | ||||||
| 46 | #include <QtWidgets/qlineedit.h> | - | ||||||
| 47 | #include <qmath.h> | - | ||||||
| 48 | #include <private/qmath_p.h> | - | ||||||
| 49 | - | |||||||
| 50 | #include "simplewidgets_p.h" // let spinbox use line edit's interface | - | ||||||
| 51 | - | |||||||
| 52 | QT_BEGIN_NAMESPACE | - | ||||||
| 53 | - | |||||||
| 54 | #ifndef QT_NO_ACCESSIBILITY | - | ||||||
| 55 | - | |||||||
| 56 | #ifndef QT_NO_SPINBOX | - | ||||||
| 57 | QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w) | - | ||||||
| 58 | : QAccessibleWidget(w, QAccessible::SpinBox), lineEdit(Q_NULLPTR) | - | ||||||
| 59 | { | - | ||||||
| 60 | Q_ASSERT(abstractSpinBox()); | - | ||||||
| 61 | } never executed:  end of block | 0 | ||||||
| 62 | - | |||||||
| 63 | QAccessibleAbstractSpinBox::~QAccessibleAbstractSpinBox() | - | ||||||
| 64 | { | - | ||||||
| 65 | delete lineEdit; | - | ||||||
| 66 | } never executed:  end of block | 0 | ||||||
| 67 | - | |||||||
| 68 | /*! | - | ||||||
| 69 | Returns the underlying QAbstractSpinBox. | - | ||||||
| 70 | */ | - | ||||||
| 71 | QAbstractSpinBox *QAccessibleAbstractSpinBox::abstractSpinBox() const | - | ||||||
| 72 | { | - | ||||||
| 73 | return qobject_cast<QAbstractSpinBox*>(object()); never executed:  return qobject_cast<QAbstractSpinBox*>(object()); | 0 | ||||||
| 74 | } | - | ||||||
| 75 | - | |||||||
| 76 | QAccessibleInterface *QAccessibleAbstractSpinBox::lineEditIface() const | - | ||||||
| 77 | { | - | ||||||
| 78 | // QAccessibleLineEdit is only used to forward the text functions | - | ||||||
| 79 | if (!lineEdit) 
 | 0 | ||||||
| 80 | lineEdit = new QAccessibleLineEdit(abstractSpinBox()->lineEdit()); never executed:  lineEdit = new QAccessibleLineEdit(abstractSpinBox()->lineEdit()); | 0 | ||||||
| 81 | return lineEdit; never executed:  return lineEdit; | 0 | ||||||
| 82 | } | - | ||||||
| 83 | - | |||||||
| 84 | QString QAccessibleAbstractSpinBox::text(QAccessible::Text t) const | - | ||||||
| 85 | { | - | ||||||
| 86 | if (t == QAccessible::Value) 
 | 0 | ||||||
| 87 | return abstractSpinBox()->text(); never executed:  return abstractSpinBox()->text(); | 0 | ||||||
| 88 | return QAccessibleWidget::text(t); never executed:  return QAccessibleWidget::text(t); | 0 | ||||||
| 89 | } | - | ||||||
| 90 | - | |||||||
| 91 | void *QAccessibleAbstractSpinBox::interface_cast(QAccessible::InterfaceType t) | - | ||||||
| 92 | { | - | ||||||
| 93 | if (t == QAccessible::ValueInterface) 
 | 0 | ||||||
| 94 | return static_cast<QAccessibleValueInterface*>(this); never executed:  return static_cast<QAccessibleValueInterface*>(this); | 0 | ||||||
| 95 | if (t == QAccessible::TextInterface) 
 | 0 | ||||||
| 96 | return static_cast<QAccessibleTextInterface*>(this); never executed:  return static_cast<QAccessibleTextInterface*>(this); | 0 | ||||||
| 97 | if (t == QAccessible::EditableTextInterface) 
 | 0 | ||||||
| 98 | return static_cast<QAccessibleEditableTextInterface*>(this); never executed:  return static_cast<QAccessibleEditableTextInterface*>(this); | 0 | ||||||
| 99 | return QAccessibleWidget::interface_cast(t); never executed:  return QAccessibleWidget::interface_cast(t); | 0 | ||||||
| 100 | } | - | ||||||
| 101 | - | |||||||
| 102 | QVariant QAccessibleAbstractSpinBox::currentValue() const | - | ||||||
| 103 | { | - | ||||||
| 104 | return abstractSpinBox()->property("value"); never executed:  return abstractSpinBox()->property("value"); | 0 | ||||||
| 105 | } | - | ||||||
| 106 | - | |||||||
| 107 | void QAccessibleAbstractSpinBox::setCurrentValue(const QVariant &value) | - | ||||||
| 108 | { | - | ||||||
| 109 | abstractSpinBox()->setProperty("value", value); | - | ||||||
| 110 | } never executed:  end of block | 0 | ||||||
| 111 | - | |||||||
| 112 | QVariant QAccessibleAbstractSpinBox::maximumValue() const | - | ||||||
| 113 | { | - | ||||||
| 114 | return abstractSpinBox()->property("maximum"); never executed:  return abstractSpinBox()->property("maximum"); | 0 | ||||||
| 115 | } | - | ||||||
| 116 | - | |||||||
| 117 | QVariant QAccessibleAbstractSpinBox::minimumValue() const | - | ||||||
| 118 | { | - | ||||||
| 119 | return abstractSpinBox()->property("minimum"); never executed:  return abstractSpinBox()->property("minimum"); | 0 | ||||||
| 120 | } | - | ||||||
| 121 | - | |||||||
| 122 | QVariant QAccessibleAbstractSpinBox::minimumStepSize() const | - | ||||||
| 123 | { | - | ||||||
| 124 | return abstractSpinBox()->property("stepSize"); never executed:  return abstractSpinBox()->property("stepSize"); | 0 | ||||||
| 125 | } | - | ||||||
| 126 | - | |||||||
| 127 | void QAccessibleAbstractSpinBox::addSelection(int startOffset, int endOffset) | - | ||||||
| 128 | { | - | ||||||
| 129 | lineEditIface()->textInterface()->addSelection(startOffset, endOffset); | - | ||||||
| 130 | } never executed:  end of block | 0 | ||||||
| 131 | - | |||||||
| 132 | QString QAccessibleAbstractSpinBox::attributes(int offset, int *startOffset, int *endOffset) const | - | ||||||
| 133 | { | - | ||||||
| 134 | return lineEditIface()->textInterface()->attributes(offset, startOffset, endOffset); never executed:  return lineEditIface()->textInterface()->attributes(offset, startOffset, endOffset); | 0 | ||||||
| 135 | } | - | ||||||
| 136 | - | |||||||
| 137 | int QAccessibleAbstractSpinBox::cursorPosition() const | - | ||||||
| 138 | { | - | ||||||
| 139 | return lineEditIface()->textInterface()->cursorPosition(); never executed:  return lineEditIface()->textInterface()->cursorPosition(); | 0 | ||||||
| 140 | } | - | ||||||
| 141 | - | |||||||
| 142 | QRect QAccessibleAbstractSpinBox::characterRect(int offset) const | - | ||||||
| 143 | { | - | ||||||
| 144 | return lineEditIface()->textInterface()->characterRect(offset); never executed:  return lineEditIface()->textInterface()->characterRect(offset); | 0 | ||||||
| 145 | } | - | ||||||
| 146 | - | |||||||
| 147 | int QAccessibleAbstractSpinBox::selectionCount() const | - | ||||||
| 148 | { | - | ||||||
| 149 | return lineEditIface()->textInterface()->selectionCount(); never executed:  return lineEditIface()->textInterface()->selectionCount(); | 0 | ||||||
| 150 | } | - | ||||||
| 151 | - | |||||||
| 152 | int QAccessibleAbstractSpinBox::offsetAtPoint(const QPoint &point) const | - | ||||||
| 153 | { | - | ||||||
| 154 | return lineEditIface()->textInterface()->offsetAtPoint(point); never executed:  return lineEditIface()->textInterface()->offsetAtPoint(point); | 0 | ||||||
| 155 | } | - | ||||||
| 156 | - | |||||||
| 157 | void QAccessibleAbstractSpinBox::selection(int selectionIndex, int *startOffset, int *endOffset) const | - | ||||||
| 158 | { | - | ||||||
| 159 | lineEditIface()->textInterface()->selection(selectionIndex, startOffset, endOffset); | - | ||||||
| 160 | } never executed:  end of block | 0 | ||||||
| 161 | - | |||||||
| 162 | QString QAccessibleAbstractSpinBox::text(int startOffset, int endOffset) const | - | ||||||
| 163 | { | - | ||||||
| 164 | return lineEditIface()->textInterface()->text(startOffset, endOffset); never executed:  return lineEditIface()->textInterface()->text(startOffset, endOffset); | 0 | ||||||
| 165 | } | - | ||||||
| 166 | - | |||||||
| 167 | QString QAccessibleAbstractSpinBox::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const | - | ||||||
| 168 | { | - | ||||||
| 169 | return lineEditIface()->textInterface()->textBeforeOffset(offset, boundaryType, startOffset, endOffset); never executed:  return lineEditIface()->textInterface()->textBeforeOffset(offset, boundaryType, startOffset, endOffset); | 0 | ||||||
| 170 | } | - | ||||||
| 171 | - | |||||||
| 172 | QString QAccessibleAbstractSpinBox::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const | - | ||||||
| 173 | { | - | ||||||
| 174 | return lineEditIface()->textInterface()->textAfterOffset(offset, boundaryType, startOffset, endOffset); never executed:  return lineEditIface()->textInterface()->textAfterOffset(offset, boundaryType, startOffset, endOffset); | 0 | ||||||
| 175 | } | - | ||||||
| 176 | - | |||||||
| 177 | QString QAccessibleAbstractSpinBox::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const | - | ||||||
| 178 | { | - | ||||||
| 179 | return lineEditIface()->textInterface()->textAtOffset(offset, boundaryType, startOffset, endOffset); never executed:  return lineEditIface()->textInterface()->textAtOffset(offset, boundaryType, startOffset, endOffset); | 0 | ||||||
| 180 | } | - | ||||||
| 181 | - | |||||||
| 182 | void QAccessibleAbstractSpinBox::removeSelection(int selectionIndex) | - | ||||||
| 183 | { | - | ||||||
| 184 | lineEditIface()->textInterface()->removeSelection(selectionIndex); | - | ||||||
| 185 | } never executed:  end of block | 0 | ||||||
| 186 | - | |||||||
| 187 | void QAccessibleAbstractSpinBox::setCursorPosition(int position) | - | ||||||
| 188 | { | - | ||||||
| 189 | lineEditIface()->textInterface()->setCursorPosition(position); | - | ||||||
| 190 | } never executed:  end of block | 0 | ||||||
| 191 | - | |||||||
| 192 | void QAccessibleAbstractSpinBox::setSelection(int selectionIndex, int startOffset, int endOffset) | - | ||||||
| 193 | { | - | ||||||
| 194 | lineEditIface()->textInterface()->setSelection(selectionIndex, startOffset, endOffset); | - | ||||||
| 195 | } never executed:  end of block | 0 | ||||||
| 196 | - | |||||||
| 197 | int QAccessibleAbstractSpinBox::characterCount() const | - | ||||||
| 198 | { | - | ||||||
| 199 | return lineEditIface()->textInterface()->characterCount(); never executed:  return lineEditIface()->textInterface()->characterCount(); | 0 | ||||||
| 200 | } | - | ||||||
| 201 | - | |||||||
| 202 | void QAccessibleAbstractSpinBox::scrollToSubstring(int startIndex, int endIndex) | - | ||||||
| 203 | { | - | ||||||
| 204 | lineEditIface()->textInterface()->scrollToSubstring(startIndex, endIndex); | - | ||||||
| 205 | } never executed:  end of block | 0 | ||||||
| 206 | - | |||||||
| 207 | void QAccessibleAbstractSpinBox::deleteText(int startOffset, int endOffset) | - | ||||||
| 208 | { | - | ||||||
| 209 | lineEditIface()->editableTextInterface()->deleteText(startOffset, endOffset); | - | ||||||
| 210 | } never executed:  end of block | 0 | ||||||
| 211 | - | |||||||
| 212 | void QAccessibleAbstractSpinBox::insertText(int offset, const QString &text) | - | ||||||
| 213 | { | - | ||||||
| 214 | lineEditIface()->editableTextInterface()->insertText(offset, text); | - | ||||||
| 215 | } never executed:  end of block | 0 | ||||||
| 216 | - | |||||||
| 217 | void QAccessibleAbstractSpinBox::replaceText(int startOffset, int endOffset, const QString &text) | - | ||||||
| 218 | { | - | ||||||
| 219 | lineEditIface()->editableTextInterface()->replaceText(startOffset, endOffset, text); | - | ||||||
| 220 | } never executed:  end of block | 0 | ||||||
| 221 | - | |||||||
| 222 | - | |||||||
| 223 | /*! | - | ||||||
| 224 | \class QAccessibleSpinBox | - | ||||||
| 225 | \brief The QAccessibleSpinBox class implements the QAccessibleInterface for spinbox widgets. | - | ||||||
| 226 | \internal | - | ||||||
| 227 | - | |||||||
| 228 | \ingroup accessibility | - | ||||||
| 229 | */ | - | ||||||
| 230 | - | |||||||
| 231 | /*! | - | ||||||
| 232 | Constructs a QAccessibleSpinWidget object for \a w. | - | ||||||
| 233 | */ | - | ||||||
| 234 | QAccessibleSpinBox::QAccessibleSpinBox(QWidget *w) | - | ||||||
| 235 | : QAccessibleAbstractSpinBox(w) | - | ||||||
| 236 | { | - | ||||||
| 237 | Q_ASSERT(spinBox()); | - | ||||||
| 238 | addControllingSignal(QLatin1String("valueChanged(int)")); | - | ||||||
| 239 | addControllingSignal(QLatin1String("valueChanged(QString)")); | - | ||||||
| 240 | } never executed:  end of block | 0 | ||||||
| 241 | - | |||||||
| 242 | /*! | - | ||||||
| 243 | Returns the underlying QSpinBox. | - | ||||||
| 244 | */ | - | ||||||
| 245 | QSpinBox *QAccessibleSpinBox::spinBox() const | - | ||||||
| 246 | { | - | ||||||
| 247 | return qobject_cast<QSpinBox*>(object()); never executed:  return qobject_cast<QSpinBox*>(object()); | 0 | ||||||
| 248 | } | - | ||||||
| 249 | - | |||||||
| 250 | - | |||||||
| 251 | // ================================== QAccessibleDoubleSpinBox ================================== | - | ||||||
| 252 | QAccessibleDoubleSpinBox::QAccessibleDoubleSpinBox(QWidget *widget) | - | ||||||
| 253 | : QAccessibleAbstractSpinBox(widget) | - | ||||||
| 254 | { | - | ||||||
| 255 | Q_ASSERT(qobject_cast<QDoubleSpinBox *>(widget)); | - | ||||||
| 256 | addControllingSignal(QLatin1String("valueChanged(double)")); | - | ||||||
| 257 | addControllingSignal(QLatin1String("valueChanged(QString)")); | - | ||||||
| 258 | } never executed:  end of block | 0 | ||||||
| 259 | - | |||||||
| 260 | /*! | - | ||||||
| 261 | Returns the underlying QDoubleSpinBox. | - | ||||||
| 262 | */ | - | ||||||
| 263 | QDoubleSpinBox *QAccessibleDoubleSpinBox::doubleSpinBox() const | - | ||||||
| 264 | { | - | ||||||
| 265 | return static_cast<QDoubleSpinBox*>(object()); never executed:  return static_cast<QDoubleSpinBox*>(object()); | 0 | ||||||
| 266 | } | - | ||||||
| 267 | - | |||||||
| 268 | QString QAccessibleDoubleSpinBox::text(QAccessible::Text textType) const | - | ||||||
| 269 | { | - | ||||||
| 270 | if (textType == QAccessible::Value) 
 | 0 | ||||||
| 271 | return doubleSpinBox()->textFromValue(doubleSpinBox()->value()); never executed:  return doubleSpinBox()->textFromValue(doubleSpinBox()->value()); | 0 | ||||||
| 272 | return QAccessibleWidget::text(textType); never executed:  return QAccessibleWidget::text(textType); | 0 | ||||||
| 273 | } | - | ||||||
| 274 | - | |||||||
| 275 | #endif // QT_NO_SPINBOX | - | ||||||
| 276 | - | |||||||
| 277 | #ifndef QT_NO_SCROLLBAR | - | ||||||
| 278 | /*! | - | ||||||
| 279 | \class QAccessibleScrollBar | - | ||||||
| 280 | \brief The QAccessibleScrollBar class implements the QAccessibleInterface for scroll bars. | - | ||||||
| 281 | \internal | - | ||||||
| 282 | - | |||||||
| 283 | \ingroup accessibility | - | ||||||
| 284 | */ | - | ||||||
| 285 | - | |||||||
| 286 | /*! | - | ||||||
| 287 | Constructs a QAccessibleScrollBar object for \a w. | - | ||||||
| 288 | \a name is propagated to the QAccessibleWidget constructor. | - | ||||||
| 289 | */ | - | ||||||
| 290 | QAccessibleScrollBar::QAccessibleScrollBar(QWidget *w) | - | ||||||
| 291 | : QAccessibleAbstractSlider(w, QAccessible::ScrollBar) | - | ||||||
| 292 | { | - | ||||||
| 293 | Q_ASSERT(scrollBar()); | - | ||||||
| 294 | addControllingSignal(QLatin1String("valueChanged(int)")); | - | ||||||
| 295 | } never executed:  end of block | 0 | ||||||
| 296 | - | |||||||
| 297 | /*! Returns the scroll bar. */ | - | ||||||
| 298 | QScrollBar *QAccessibleScrollBar::scrollBar() const | - | ||||||
| 299 | { | - | ||||||
| 300 | return qobject_cast<QScrollBar*>(object()); never executed:  return qobject_cast<QScrollBar*>(object()); | 0 | ||||||
| 301 | } | - | ||||||
| 302 | - | |||||||
| 303 | QString QAccessibleScrollBar::text(QAccessible::Text t) const | - | ||||||
| 304 | { | - | ||||||
| 305 | if (t == QAccessible::Value) 
 | 0 | ||||||
| 306 | return QString::number(scrollBar()->value()); never executed:  return QString::number(scrollBar()->value()); | 0 | ||||||
| 307 | return QAccessibleAbstractSlider::text(t); never executed:  return QAccessibleAbstractSlider::text(t); | 0 | ||||||
| 308 | } | - | ||||||
| 309 | - | |||||||
| 310 | #endif // QT_NO_SCROLLBAR | - | ||||||
| 311 | - | |||||||
| 312 | #ifndef QT_NO_SLIDER | - | ||||||
| 313 | /*! | - | ||||||
| 314 | \class QAccessibleSlider | - | ||||||
| 315 | \brief The QAccessibleSlider class implements the QAccessibleInterface for sliders. | - | ||||||
| 316 | \internal | - | ||||||
| 317 | - | |||||||
| 318 | \ingroup accessibility | - | ||||||
| 319 | */ | - | ||||||
| 320 | - | |||||||
| 321 | /*! | - | ||||||
| 322 | Constructs a QAccessibleScrollBar object for \a w. | - | ||||||
| 323 | \a name is propagated to the QAccessibleWidget constructor. | - | ||||||
| 324 | */ | - | ||||||
| 325 | QAccessibleSlider::QAccessibleSlider(QWidget *w) | - | ||||||
| 326 | : QAccessibleAbstractSlider(w) | - | ||||||
| 327 | { | - | ||||||
| 328 | Q_ASSERT(slider()); | - | ||||||
| 329 | addControllingSignal(QLatin1String("valueChanged(int)")); | - | ||||||
| 330 | } never executed:  end of block | 0 | ||||||
| 331 | - | |||||||
| 332 | /*! Returns the slider. */ | - | ||||||
| 333 | QSlider *QAccessibleSlider::slider() const | - | ||||||
| 334 | { | - | ||||||
| 335 | return qobject_cast<QSlider*>(object()); never executed:  return qobject_cast<QSlider*>(object()); | 0 | ||||||
| 336 | } | - | ||||||
| 337 | - | |||||||
| 338 | QString QAccessibleSlider::text(QAccessible::Text t) const | - | ||||||
| 339 | { | - | ||||||
| 340 | if (t == QAccessible::Value) 
 | 0 | ||||||
| 341 | return QString::number(slider()->value()); never executed:  return QString::number(slider()->value()); | 0 | ||||||
| 342 | - | |||||||
| 343 | return QAccessibleAbstractSlider::text(t); never executed:  return QAccessibleAbstractSlider::text(t); | 0 | ||||||
| 344 | } | - | ||||||
| 345 | - | |||||||
| 346 | QAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, QAccessible::Role r) | - | ||||||
| 347 | : QAccessibleWidget(w, r) | - | ||||||
| 348 | { | - | ||||||
| 349 | Q_ASSERT(qobject_cast<QAbstractSlider *>(w)); | - | ||||||
| 350 | } never executed:  end of block | 0 | ||||||
| 351 | - | |||||||
| 352 | void *QAccessibleAbstractSlider::interface_cast(QAccessible::InterfaceType t) | - | ||||||
| 353 | { | - | ||||||
| 354 | if (t == QAccessible::ValueInterface) 
 | 0 | ||||||
| 355 | return static_cast<QAccessibleValueInterface*>(this); never executed:  return static_cast<QAccessibleValueInterface*>(this); | 0 | ||||||
| 356 | return QAccessibleWidget::interface_cast(t); never executed:  return QAccessibleWidget::interface_cast(t); | 0 | ||||||
| 357 | } | - | ||||||
| 358 | - | |||||||
| 359 | QVariant QAccessibleAbstractSlider::currentValue() const | - | ||||||
| 360 | { | - | ||||||
| 361 | return abstractSlider()->value(); never executed:  return abstractSlider()->value(); | 0 | ||||||
| 362 | } | - | ||||||
| 363 | - | |||||||
| 364 | void QAccessibleAbstractSlider::setCurrentValue(const QVariant &value) | - | ||||||
| 365 | { | - | ||||||
| 366 | abstractSlider()->setValue(value.toInt()); | - | ||||||
| 367 | } never executed:  end of block | 0 | ||||||
| 368 | - | |||||||
| 369 | QVariant QAccessibleAbstractSlider::maximumValue() const | - | ||||||
| 370 | { | - | ||||||
| 371 | return abstractSlider()->maximum(); never executed:  return abstractSlider()->maximum(); | 0 | ||||||
| 372 | } | - | ||||||
| 373 | - | |||||||
| 374 | QVariant QAccessibleAbstractSlider::minimumValue() const | - | ||||||
| 375 | { | - | ||||||
| 376 | return abstractSlider()->minimum(); never executed:  return abstractSlider()->minimum(); | 0 | ||||||
| 377 | } | - | ||||||
| 378 | - | |||||||
| 379 | QVariant QAccessibleAbstractSlider::minimumStepSize() const | - | ||||||
| 380 | { | - | ||||||
| 381 | return abstractSlider()->singleStep(); never executed:  return abstractSlider()->singleStep(); | 0 | ||||||
| 382 | } | - | ||||||
| 383 | - | |||||||
| 384 | QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const | - | ||||||
| 385 | { | - | ||||||
| 386 | return static_cast<QAbstractSlider *>(object()); never executed:  return static_cast<QAbstractSlider *>(object()); | 0 | ||||||
| 387 | } | - | ||||||
| 388 | - | |||||||
| 389 | #endif // QT_NO_SLIDER | - | ||||||
| 390 | - | |||||||
| 391 | #ifndef QT_NO_DIAL | - | ||||||
| 392 | // ======================================= QAccessibleDial ====================================== | - | ||||||
| 393 | QAccessibleDial::QAccessibleDial(QWidget *widget) | - | ||||||
| 394 | : QAccessibleAbstractSlider(widget, QAccessible::Dial) | - | ||||||
| 395 | { | - | ||||||
| 396 | Q_ASSERT(qobject_cast<QDial *>(widget)); | - | ||||||
| 397 | addControllingSignal(QLatin1String("valueChanged(int)")); | - | ||||||
| 398 | } never executed:  end of block | 0 | ||||||
| 399 | - | |||||||
| 400 | QString QAccessibleDial::text(QAccessible::Text textType) const | - | ||||||
| 401 | { | - | ||||||
| 402 | if (textType == QAccessible::Value) 
 | 0 | ||||||
| 403 | return QString::number(dial()->value()); never executed:  return QString::number(dial()->value()); | 0 | ||||||
| 404 | - | |||||||
| 405 | return QAccessibleAbstractSlider::text(textType); never executed:  return QAccessibleAbstractSlider::text(textType); | 0 | ||||||
| 406 | } | - | ||||||
| 407 | - | |||||||
| 408 | QDial *QAccessibleDial::dial() const | - | ||||||
| 409 | { | - | ||||||
| 410 | return static_cast<QDial*>(object()); never executed:  return static_cast<QDial*>(object()); | 0 | ||||||
| 411 | } | - | ||||||
| 412 | #endif // QT_NO_DIAL | - | ||||||
| 413 | - | |||||||
| 414 | #endif // QT_NO_ACCESSIBILITY | - | ||||||
| 415 | - | |||||||
| 416 | QT_END_NAMESPACE | - | ||||||
| Source code | Switch to Preprocessed file |