Qt 4.8
rangecontrols.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
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 Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/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 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "rangecontrols.h"
43 
44 #include <qslider.h>
45 #include <qdial.h>
46 #include <qspinbox.h>
47 #include <qscrollbar.h>
48 #include <qstyle.h>
49 #include <qstyleoption.h>
50 #include <qdebug.h>
51 #include <qglobal.h>
52 #include <QDoubleSpinBox>
53 #include <QDial>
54 #include <qmath.h>
55 #include <private/qmath_p.h>
56 
58 
59 #ifndef QT_NO_ACCESSIBILITY
61 #ifndef QT_NO_SCROLLBAR
63 #endif
64 #ifndef QT_NO_SLIDER
66 #endif
67 
68 #ifndef QT_NO_SPINBOX
70 : QAccessibleWidgetEx(w, SpinBox)
71 {
73 }
74 
79 {
81 }
82 
85 {
86  return ValueDown;
87 }
88 
91 {
92  QRect rect;
93  if (!abstractSpinBox()->isVisible())
94  return rect;
96  so.rect = widget()->rect();
97  switch(child) {
98  case Editor:
101  break;
102  case ValueUp:
103  rect = widget()->style()->subControlRect(QStyle::CC_SpinBox, &so,
105  break;
106  case ValueDown:
107  rect = widget()->style()->subControlRect(QStyle::CC_SpinBox, &so,
109  break;
110  default:
111  rect = so.rect;
112  break;
113  }
114  QPoint tl = widget()->mapToGlobal(QPoint(0, 0));
115  return QRect(tl.x() + rect.x(), tl.y() + rect.y(), rect.width(), rect.height());
116 }
117 
120 {
121  *target = 0;
122 
123  if (entry) switch (rel) {
124  case Child:
125  return entry <= childCount() ? entry : -1;
126  case QAccessible::Left:
127  return (entry == ValueUp || entry == ValueDown) ? Editor : -1;
128  case QAccessible::Right:
129  return entry == Editor ? ValueUp : -1;
130  case QAccessible::Up:
131  return entry == ValueDown ? ValueUp : -1;
132  case QAccessible::Down:
133  return entry == ValueUp ? ValueDown : -1;
134  default:
135  break;
136  }
137  return QAccessibleWidgetEx::navigate(rel, entry, target);
138 }
139 
142 {
143  if (!abstractSpinBox()->isVisible())
144  return QString();
145  switch (t) {
146  case Name:
147  switch (child) {
148  case ValueUp:
149  return QSpinBox::tr("More");
150  case ValueDown:
151  return QSpinBox::tr("Less");
152  }
153  break;
154  case Value:
155  if (child == Editor || child == SpinBoxSelf)
156  return abstractSpinBox()->text();
157  break;
158  default:
159  break;
160  }
161  return QAccessibleWidgetEx::text(t, 0);
162 }
163 
166 {
167  switch(child) {
168  case Editor:
169  return EditableText;
170  case ValueUp:
171  case ValueDown:
172  return PushButton;
173  default:
174  break;
175  }
176  return QAccessibleWidgetEx::role(child);
177 }
178 
180 bool QAccessibleAbstractSpinBox::doAction(int action, int child, const QVariantList &params)
181 {
182  if (!widget()->isEnabled())
183  return false;
184 
185  if (action == Press) {
186  switch(child) {
187  case ValueUp:
188  abstractSpinBox()->stepUp();
189  return true;
190  case ValueDown:
192  return true;
193  default:
194  break;
195  }
196  }
197  return QAccessibleWidgetEx::doAction(action, 0, params);
198 }
199 
201 {
202  QVariant result = abstractSpinBox()->property("value");
203  QVariant::Type type = result.type();
204 
205  // IA2 only allows numeric types
206  if (type == QVariant::Int || type == QVariant::UInt || type == QVariant::LongLong
207  || type == QVariant::ULongLong || type == QVariant::Double)
208  return result;
209 
210  return QVariant();
211 }
212 
214 {
215  abstractSpinBox()->setProperty("value", value);
216 }
217 
219 {
220  return abstractSpinBox()->property("maximum");
221 }
222 
224 {
225  return abstractSpinBox()->property("minimum");
226 }
227 
229 {
230  switch (method) {
231  case ListSupportedMethods: {
233  set << ListSupportedMethods;
235  QAccessibleWidgetEx::invokeMethodEx(method, child, params)));
236  }
237  default:
238  return QAccessibleWidgetEx::invokeMethodEx(method, child, params);
239  }
240 }
241 
242 
273 {
274  Q_ASSERT(spinBox());
275  addControllingSignal(QLatin1String("valueChanged(int)"));
276  addControllingSignal(QLatin1String("valueChanged(QString)"));
277 }
278 
283 {
284  return qobject_cast<QSpinBox*>(object());
285 }
286 
289 {
291  switch(child) {
292  case ValueUp:
293  if (spinBox()->value() >= spinBox()->maximum())
294  state |= Unavailable;
295  return state;
296  case ValueDown:
297  if (spinBox()->value() <= spinBox()->minimum())
298  state |= Unavailable;
299  return state;
300  default:
301  break;
302  }
303  return state;
304 }
305 
307 bool QAccessibleSpinBox::doAction(int action, int child, const QVariantList &params)
308 {
309  if (!widget()->isEnabled())
310  return false;
311 
312  if (action == Press) {
313  switch(child) {
314  case ValueUp:
315  if (spinBox()->value() >= spinBox()->maximum())
316  return false;
317  spinBox()->stepUp();
318  return true;
319  case ValueDown:
320  if (spinBox()->value() <= spinBox()->minimum())
321  return false;
322  spinBox()->stepDown();
323  return true;
324  default:
325  break;
326  }
327  }
328  return QAccessibleAbstractSpinBox::doAction(action, 0, params);
329 }
330 
331 // ================================== QAccessibleDoubleSpinBox ==================================
333  : QAccessibleWidgetEx(widget, SpinBox)
334 {
335  Q_ASSERT(qobject_cast<QDoubleSpinBox *>(widget));
336  addControllingSignal(QLatin1String("valueChanged(double)"));
337  addControllingSignal(QLatin1String("valueChanged(QString)"));
338 }
339 
344 {
345  return static_cast<QDoubleSpinBox*>(object());
346 }
347 
350 {
351  return ValueDown;
352 }
353 
356 {
357  QRect rect;
358  if (!doubleSpinBox()->isVisible())
359  return rect;
360  QStyleOptionSpinBox spinBoxOption;
361  spinBoxOption.initFrom(doubleSpinBox());
362  switch (child) {
363  case Editor:
364  rect = doubleSpinBox()->style()->subControlRect(QStyle::CC_SpinBox, &spinBoxOption,
366  break;
367  case ValueUp:
368  rect = doubleSpinBox()->style()->subControlRect(QStyle::CC_SpinBox, &spinBoxOption,
370  break;
371  case ValueDown:
372  rect = doubleSpinBox()->style()->subControlRect(QStyle::CC_SpinBox, &spinBoxOption,
374  break;
375  default:
376  rect = spinBoxOption.rect;
377  break;
378  }
379  const QPoint globalPos = doubleSpinBox()->mapToGlobal(QPoint(0, 0));
380  return QRect(globalPos.x() + rect.x(), globalPos.y() + rect.y(), rect.width(), rect.height());
381 }
382 
385 {
386  if (entry <= 0)
387  return QAccessibleWidgetEx::navigate(relation, entry, target);
388 
389  *target = 0;
390  switch (relation) {
391  case Child:
392  return entry <= childCount() ? entry : -1;
393  case QAccessible::Left:
394  return (entry == ValueUp || entry == ValueDown) ? Editor : -1;
395  case QAccessible::Right:
396  return entry == Editor ? ValueUp : -1;
397  case QAccessible::Up:
398  return entry == ValueDown ? ValueUp : -1;
399  case QAccessible::Down:
400  return entry == ValueUp ? ValueDown : -1;
401  default:
402  break;
403  }
404  return QAccessibleWidgetEx::navigate(relation, entry, target);
405 }
406 
408 {
409  return QVariant();
410 }
411 
413 QString QAccessibleDoubleSpinBox::text(Text textType, int child) const
414 {
415  switch (textType) {
416  case Name:
417  if (child == ValueUp)
418  return QDoubleSpinBox::tr("More");
419  else if (child == ValueDown)
420  return QDoubleSpinBox::tr("Less");
421  break;
422  case Value:
423  if (child == Editor || child == SpinBoxSelf)
424  return doubleSpinBox()->textFromValue(doubleSpinBox()->value());
425  break;
426  default:
427  break;
428  }
429  return QAccessibleWidgetEx::text(textType, 0);
430 }
431 
434 {
435  switch (child) {
436  case Editor:
437  return EditableText;
438  case ValueUp:
439  case ValueDown:
440  return PushButton;
441  default:
442  break;
443  }
444  return QAccessibleWidgetEx::role(child);
445 }
446 
449 {
451  switch (child) {
452  case ValueUp:
453  if (doubleSpinBox()->value() >= doubleSpinBox()->maximum())
454  state |= Unavailable;
455  break;
456  case ValueDown:
457  if (doubleSpinBox()->value() <= doubleSpinBox()->minimum())
458  state |= Unavailable;
459  break;
460  default:
461  break;
462  }
463  return state;
464 }
465 #endif // QT_NO_SPINBOX
466 
467 #ifndef QT_NO_SCROLLBAR
468 
501 {
502  Q_ASSERT(scrollBar());
503  addControllingSignal(QLatin1String("valueChanged(int)"));
504 }
505 
508 {
509  return qobject_cast<QScrollBar*>(object());
510 }
511 
514 {
515  if (!scrollBar()->isVisible())
516  return QRect();
517 
518  QStyle::SubControl subControl;
519  switch (child) {
520  case LineUp:
521  subControl = QStyle ::SC_ScrollBarSubLine;
522  break;
523  case PageUp:
524  subControl = QStyle::SC_ScrollBarSubPage;
525  break;
526  case Position:
527  subControl = QStyle::SC_ScrollBarSlider;
528  break;
529  case PageDown:
530  subControl = QStyle::SC_ScrollBarAddPage;
531  break;
532  case LineDown:
533  subControl = QStyle::SC_ScrollBarAddLine;
534  break;
535  default:
536  return QAccessibleAbstractSlider::rect(child);
537  }
538 
541  subControl, scrollBar());
542  const QPoint tp = scrollBar()->mapToGlobal(QPoint(0,0));
543  return QRect(tp.x() + rect.x(), tp.y() + rect.y(), rect.width(), rect.height());
544 }
545 
548 {
549  return LineDown;
550 }
551 
554 {
555  switch (t) {
556  case Value:
557  if (!child || child == Position)
558  return QString::number(scrollBar()->value());
559  return QString();
560  case Name:
561  switch (child) {
562  case LineUp:
563  return QScrollBar::tr("Line up");
564  case PageUp:
565  return QScrollBar::tr("Page up");
566  case Position:
567  return QScrollBar::tr("Position");
568  case PageDown:
569  return QScrollBar::tr("Page down");
570  case LineDown:
571  return QScrollBar::tr("Line down");
572  }
573  break;
574  default:
575  break;
576  }
577  return QAccessibleAbstractSlider::text(t, child);
578 }
579 
582 {
583  switch (child) {
584  case LineUp:
585  case PageUp:
586  case PageDown:
587  case LineDown:
588  return PushButton;
589  case Position:
590  return Indicator;
591  default:
592  return ScrollBar;
593  }
594 }
595 
598 {
599  const State parentState = QAccessibleAbstractSlider::state(0);
600 
601  if (child == 0)
602  return parentState;
603 
604  // Inherit the Invisible state from parent.
605  State state = parentState & QAccessible::Invisible;
606 
607  // Disable left/right if we are at the minimum/maximum.
609  switch (child) {
610  case LineUp:
611  case PageUp:
612  if (scrollBar->value() <= scrollBar->minimum())
613  state |= Unavailable;
614  break;
615  case LineDown:
616  case PageDown:
617  if (scrollBar->value() >= scrollBar->maximum())
618  state |= Unavailable;
619  break;
620  case Position:
621  default:
622  break;
623  }
624 
625  return state;
626 }
627 #endif // QT_NO_SCROLLBAR
628 
629 #ifndef QT_NO_SLIDER
630 
661 {
662  Q_ASSERT(slider());
663  addControllingSignal(QLatin1String("valueChanged(int)"));
664 }
665 
668 {
669  return qobject_cast<QSlider*>(object());
670 }
671 
674 {
675  QRect rect;
676  if (!slider()->isVisible())
677  return rect;
679  QRect srect = slider()->style()->subControlRect(QStyle::CC_Slider, &option,
681 
682  switch (child) {
683  case PageLeft:
684  if (slider()->orientation() == Qt::Vertical)
685  rect = QRect(0, 0, slider()->width(), srect.y());
686  else
687  rect = QRect(0, 0, srect.x(), slider()->height());
688  break;
689  case Position:
690  rect = srect;
691  break;
692  case PageRight:
693  if (slider()->orientation() == Qt::Vertical)
694  rect = QRect(0, srect.y() + srect.height(), slider()->width(), slider()->height()- srect.y() - srect.height());
695  else
696  rect = QRect(srect.x() + srect.width(), 0, slider()->width() - srect.x() - srect.width(), slider()->height());
697  break;
698  default:
699  return QAccessibleAbstractSlider::rect(child);
700  }
701 
702  QPoint tp = slider()->mapToGlobal(QPoint(0,0));
703  return QRect(tp.x() + rect.x(), tp.y() + rect.y(), rect.width(), rect.height());
704 }
705 
708 {
709  return PageRight;
710 }
711 
714 {
715  switch (t) {
716  case Value:
717  if (!child || child == 2)
718  return QString::number(slider()->value());
719  return QString();
720  case Name:
721  switch (child) {
722  case PageLeft:
723  return slider()->orientation() == Qt::Horizontal ?
724  QSlider::tr("Page left") : QSlider::tr("Page up");
725  case Position:
726  return QSlider::tr("Position");
727  case PageRight:
728  return slider()->orientation() == Qt::Horizontal ?
729  QSlider::tr("Page right") : QSlider::tr("Page down");
730  }
731  break;
732  default:
733  break;
734  }
735  return QAccessibleAbstractSlider::text(t, child);
736 }
737 
740 {
741  switch (child) {
742  case PageLeft:
743  case PageRight:
744  return PushButton;
745  case Position:
746  return Indicator;
747  default:
748  return Slider;
749  }
750 }
751 
754 {
755  const State parentState = QAccessibleAbstractSlider::state(0);
756 
757  if (child == 0)
758  return parentState;
759 
760  // Inherit the Invisible state from parent.
761  State state = parentState & QAccessible::Invisible;
762 
763  // Disable left/right if we are at the minimum/maximum.
764  const QSlider * const slider = QAccessibleSlider::slider();
765  switch (child) {
766  case PageLeft:
767  if (slider->value() <= slider->minimum())
768  state |= Unavailable;
769  break;
770  case PageRight:
771  if (slider->value() >= slider->maximum())
772  state |= Unavailable;
773  break;
774  case Position:
775  default:
776  break;
777  }
778 
779  return state;
780 }
781 
791 int QAccessibleSlider::defaultAction(int /*child*/) const
792 {
793 /*
794  switch (child) {
795  case SliderSelf:
796  return SetFocus;
797  case PageLeft:
798  return Press;
799  case PageRight:
800  return Press;
801  }
802 */
803  return 0;
804 }
805 
807 QString QAccessibleSlider::actionText(int /*action*/, Text /*t*/, int /*child*/) const
808 {
809  return QLatin1String("");
810 }
811 
813  : QAccessibleWidgetEx(w, r)
814 {
815  Q_ASSERT(qobject_cast<QAbstractSlider *>(w));
816 }
817 
819 {
820  switch (method) {
821  case ListSupportedMethods: {
823  set << ListSupportedMethods;
825  QAccessibleWidgetEx::invokeMethodEx(method, child, params)));
826  }
827  default:
828  return QAccessibleWidgetEx::invokeMethodEx(method, child, params);
829  }
830 }
831 
833 {
834  return abstractSlider()->value();
835 }
836 
838 {
839  abstractSlider()->setValue(value.toInt());
840 }
841 
843 {
844  return abstractSlider()->maximum();
845 }
846 
848 {
849  return abstractSlider()->minimum();
850 }
851 
853 {
854  return static_cast<QAbstractSlider *>(object());
855 }
856 
857 #endif // QT_NO_SLIDER
858 
859 #ifndef QT_NO_DIAL
860 // ======================================= QAccessibleDial ======================================
862  : QAccessibleWidgetEx(widget, Dial)
863 {
864  Q_ASSERT(qobject_cast<QDial *>(widget));
865  addControllingSignal(QLatin1String("valueChanged(int)"));
866 }
867 
868 QRect QAccessibleDial::rect(int child) const
869 {
870  QRect rect;
871  if (!dial()->isVisible())
872  return rect;
873  switch (child) {
874  case Self:
875  return QAccessibleWidgetEx::rect(child);
876  case SpeedoMeter: {
877  // Mixture from qcommonstyle.cpp (focus rect).
878  int width = dial()->width();
879  int height = dial()->height();
880  qreal radius = qMin(width, height) / 2.0;
881  qreal delta = radius / 6.0;
882  qreal dx = delta + (width - 2 * radius) / 2.0;
883  qreal dy = delta + (height - 2 * radius) / 2.0;
884  rect = QRect(int(dx), int(dy), int(radius * 2 - 2 * delta), int(radius * 2 - 2 * delta));
885  if (dial()->notchesVisible()) {
886  rect.translate(int(-radius / 6), int(-radius / 6));
887  rect.setWidth(rect.width() + int(radius / 3));
888  rect.setHeight(rect.height() + int(radius / 3));
889  }
890  break;
891  }
892  case SliderHandle: {
893  // Mixture from qcommonstyle.cpp and qdial.cpp.
894  int sliderValue = !dial()->invertedAppearance() ? dial()->value()
895  : (dial()->maximum() - dial()->value());
896  qreal angle = 0;
897  if (dial()->maximum() == dial()->minimum()) {
898  angle = Q_PI / 2;
899  } else if (dial()->wrapping()) {
900  angle = Q_PI * 3 / 2 - (sliderValue - dial()->minimum()) * 2 * Q_PI
901  / (dial()->maximum() - dial()->minimum());
902  } else {
903  angle = (Q_PI * 8 - (sliderValue - dial()->minimum()) * 10 * Q_PI
904  / (dial()->maximum() - dial()->minimum())) / 6;
905  }
906 
907  int width = dial()->rect().width();
908  int height = dial()->rect().height();
909  int radius = qMin(width, height) / 2;
910  int xc = width / 2;
911  int yc = height / 2;
912  int bigLineSize = radius / 6;
913  if (bigLineSize < 4)
914  bigLineSize = 4;
915  if (bigLineSize > radius / 2)
916  bigLineSize = radius / 2;
917  int len = radius - bigLineSize - 5;
918  if (len < 5)
919  len = 5;
920  int back = len / 2;
921 
922  QPolygonF arrow(3);
923  arrow[0] = QPointF(0.5 + xc + len * qCos(angle),
924  0.5 + yc - len * qSin(angle));
925  arrow[1] = QPointF(0.5 + xc + back * qCos(angle + Q_PI * 5 / 6),
926  0.5 + yc - back * qSin(angle + Q_PI * 5 / 6));
927  arrow[2] = QPointF(0.5 + xc + back * qCos(angle - Q_PI * 5 / 6),
928  0.5 + yc - back * qSin(angle - Q_PI * 5 / 6));
929  rect = arrow.boundingRect().toRect();
930  break;
931  }
932  default:
933  return QRect();
934  }
935 
936  QPoint globalPos = dial()->mapToGlobal(QPoint(0,0));
937  return QRect(globalPos.x() + rect.x(), globalPos.y() + rect.y(), rect.width(), rect.height());
938 }
939 
941 {
942  return SliderHandle;
943 }
944 
945 QString QAccessibleDial::text(Text textType, int child) const
946 {
947  if (textType == Value && child >= Self && child <= SliderHandle)
948  return QString::number(dial()->value());
949  if (textType == Name) {
950  switch (child) {
951  case Self:
952  if (!widget()->accessibleName().isEmpty())
953  return widget()->accessibleName();
954  return QDial::tr("QDial");
955  case SpeedoMeter:
956  return QDial::tr("SpeedoMeter");
957  case SliderHandle:
958  return QDial::tr("SliderHandle");
959  }
960  }
961  return QAccessibleWidgetEx::text(textType, child);
962 }
963 
965 {
966  if (child == SpeedoMeter)
967  return Slider;
968  else if (child == SliderHandle)
969  return Indicator;
970  return QAccessibleWidgetEx::role(child);
971 }
972 
974 {
975  const State parentState = QAccessibleWidgetEx::state(0);
976  if (child == SliderHandle)
977  return parentState | HotTracked;
978  return parentState;
979 }
980 
982 {
983  return QVariant();
984 }
985 
987 {
988  return static_cast<QDial*>(object());
989 }
990 #endif // QT_NO_DIAL
991 
992 #endif // QT_NO_ACCESSIBILITY
993 
QString accessibleName
the widget&#39;s name as seen by assistive technologies
Definition: qwidget.h:213
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QAccessibleSlider(QWidget *w)
Constructs a QAccessibleScrollBar object for w.
T qobject_cast(QObject *object)
Definition: qobject.h:375
Role role(int child) const
Reimplemented Function
int value
the slider&#39;s current value
State state(int child) const
Reimplemented Function
QRect rect(int child) const
Reimplemented Function
int type
Definition: qmetatype.cpp:239
SubControl
This enum describes the available sub controls.
Definition: qstyle.h:402
Role role(int child) const
Returns the role of the object, or of the object&#39;s child if child is not 0.
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
Reimplemented Function
QDoubleSpinBox * doubleSpinBox() const
Returns the underlying QDoubleSpinBox.
int minimum() const
QAccessibleAbstractSlider(QWidget *w, Role r=Slider)
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=0) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
QObject * object() const
Returns a pointer to the QObject this interface implementation provides information for...
QVariant invokeMethodEx(Method method, int child, const QVariantList &params)
Role role(int child) const
Reimplemented Function
QVariant invokeMethodEx(Method method, int child, const QVariantList &params)
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
int childCount() const
Reimplemented Function
Role
This enum defines the role of an accessible object.
Definition: qaccessible.h:188
int childCount() const
Reimplemented Function
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object&#39;s name property to value.
Definition: qobject.cpp:3755
void setCurrentValue(const QVariant &value)
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
QString text(Text t, int child) const
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
Reimplemented Function
QSpinBox * spinBox() const
Returns the underlying QSpinBox.
QAccessibleAbstractSpinBox(QWidget *w)
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text)
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
The QString class provides a Unicode character string.
Definition: qstring.h:83
State state(int child) const
Reimplemented Function
int maximum
the slider&#39;s maximum value
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QRectF boundingRect() const
Returns the bounding rectangle of the polygon, or QRectF(0,0,0,0) if the polygon is empty...
Definition: qpolygon.cpp:742
int height() const
QRect rect(int child) const
Reimplemented Function
QStyle * style() const
Definition: qwidget.cpp:2742
bool doAction(int action, int child, const QVariantList &params)
Reimplemented Function
QString actionText(int action, Text t, int child) const
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
int minimum
the sliders&#39;s minimum value
void stepUp()
Steps up by one linestep Calling this slot is analogous to calling stepBy(1);.
QRect rect(int child) const
Reimplemented Function
The QScrollBar widget provides a vertical or horizontal scroll bar.
Definition: qscrollbar.h:59
int value() const
QString text(Text textType, int child) const
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QScrollBar * scrollBar() const
Returns the scroll bar.
QRect rect(int child) const
Returns the geometry of the object, or of the object&#39;s child if child is not 0.
static bool isEmpty(const char *str)
qreal qSin(qreal v)
Definition: qmath.h:93
void stepDown()
Steps down by one linestep Calling this slot is analogous to calling stepBy(-1);. ...
int width() const
RelationFlag
This enum type defines bit flags that can be combined to indicate the relationship between two access...
Definition: qaccessible.h:268
void initFrom(const QWidget *w)
Definition: qstyleoption.h:99
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
Definition: qstyleoption.h:729
Method
This enum describes the possible types of methods that can be invoked on an accessible object...
Definition: qaccessible.h:311
QString text(Text t, int child) const
Reimplemented Function
The QPolygonF class provides a vector of points using floating point precision.
Definition: qpolygon.h:134
Qt::Orientation orientation() const
int childCount() const
Reimplemented Function
Type
This enum type defines the types of variable that a QVariant can contain.
Definition: qvariant.h:95
Role role(int child) const
Returns the role of the object, or of the object&#39;s child if child is not 0.
State state(int child) const
Reimplemented Function
int defaultAction(int child) const
Returns the default action for the given child.
QAccessibleSpinBox(QWidget *w)
Constructs a QAccessibleSpinWidget object for w.
The QSlider widget provides a vertical or horizontal slider.
Definition: qslider.h:57
bool invertedAppearance() const
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
The State element defines configurations of objects and properties.
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336
virtual QString textFromValue(double val) const
This virtual function is used by the spin box whenever it needs to display the given value...
Definition: qspinbox.cpp:946
QRect toRect() const
Returns a QRect based on the values of this rectangle.
Definition: qrect.h:845
QRect rect() const
QSlider * slider() const
Returns the slider.
bool wrapping
whether wrapping is enabled
Definition: qdial.h:63
Role role(int child) const
Reimplemented Function
QAbstractSpinBox * abstractSpinBox() const
Returns the underlying QAbstractSpinBox.
QAccessibleDial(QWidget *w)
QString text(Text t, int child) const
Reimplemented Function
qreal angle(const QPointF &p1, const QPointF &p2)
QString text(Text t, int child) const
Reimplemented Function
QVariant invokeMethodEx(Method method, int child, const QVariantList &params)
State state(int child) const
Reimplemented Function
QString text(Text t, int child) const
Reimplemented Function
The QDoubleSpinBox class provides a spin box widget that takes doubles.
Definition: qspinbox.h:126
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
State
Definition: qaudio.h:59
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
void addControllingSignal(const QString &signal)
QWidget * widget() const
QAccessibleScrollBar(QWidget *w)
Constructs a QAccessibleScrollBar object for w.
Type type() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1901
State state(int child) const
Returns the current state of the object, or of the object&#39;s child if child is not 0...
QStyleOptionSlider Q_GUI_EXPORT qt_qscrollbarStyleOption(QScrollBar *scrollBar)
Returns the style option for scroll bar.
Definition: qscrollbar.cpp:766
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
QVariant invokeMethodEx(Method method, int child, const QVariantList &params)
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QRect rect(int child) const
Returns the geometry of the object, or of the object&#39;s child if child is not 0.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The QAbstractSlider class provides an integer value within a range.
The QSpinBox class provides a spin box widget.
Definition: qspinbox.h:56
The QDial class provides a rounded range control (like a speedometer or potentiometer).
Definition: qdial.h:59
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int childCount() const
Reimplemented Function
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
int childCount() const
Returns the number of children that belong to this object.
bool doAction(int action, int child, const QVariantList &params)
Reimplemented Function
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
Definition: qstyleoption.h:701
QAbstractSlider * abstractSlider() const
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
QStyleOptionSlider Q_GUI_EXPORT qt_qsliderStyleOption(QSlider *slider)
Returns the style option for slider.
Definition: qslider.cpp:684
bool doAction(int action, int child, const QVariantList &params)
Asks the object, or the object&#39;s child if child is not 0, to execute action using the parameters...
QRect rect(int child) const
Reimplemented Function
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
int maximum() const
State state(int child) const
Returns the current state of the object, or of the object&#39;s child if child is not 0...
QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList &params)
void setCurrentValue(const QVariant &value)
Role role(int child) const
Reimplemented Function
qreal qCos(qreal v)
Definition: qmath.h:109
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.
QRect rect
the area that should be used for various calculations and painting
Definition: qstyleoption.h:90
QAccessibleDoubleSpinBox(QWidget *widget)
QDial * dial() const
QString text
the spin box&#39;s text, including any prefix and suffix
#define text
Definition: qobjectdefs.h:80
The Text item allows you to add formatted text to a scene.
static const qreal Q_PI
Definition: qmath_p.h:61