57 #include <private/qabstractslider_p.h> 58 #include <private/qmath_p.h> 59 #ifndef QT_NO_ACCESSIBILITY 86 virtual int bound(
int val)
const;
140 if (!
d->showNotches) {
152 double yy = (double)q->height()/2.0 - p.
y();
153 double xx = (double)p.
x() - q->width()/2.0;
154 double a = (xx || yy) ?
qAtan2(yy, xx) : 0;
171 v = (int)(0.5 + minv + r * (Q_PI * 3 / 2 - a) / (2 *
Q_PI));
173 v = (int)(0.5 + minv + r* (Q_PI * 4 / 3 - a) / (Q_PI * 10 / 6));
288 d->minimum = minValue;
289 d->maximum = maxValue;
291 d->position =
d->value =
value;
327 if (
d->maximum ==
d->minimum ||
375 d->doNotEmit =
false;
391 if (
d->wrapping == enable)
393 d->wrapping = enable;
445 int l = (int)(r * (
d->wrapping ? 6 : 5) *
Q_PI / 6);
447 if (
d->maximum >
d->minimum +
d->pageStep)
448 l = (int)(0.5 + l *
d->pageStep / (
d->maximum -
d->minimum));
450 l = l *
d->singleStep / (
d->pageStep ?
d->pageStep : 1);
454 l = (int)(0.5 +
d->target / l);
458 return d->singleStep *
l;
512 return d->showNotches;
521 return QSize(50, 50);
qreal notchTarget
the number of pixel between notches
void setNotchTarget(double target)
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
int sliderValue
the value of the slider
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
virtual void sliderChange(SliderChange change)
Reimplement this virtual function to track slider changes such as SliderRangeChange ...
void mouseMoveEvent(QMouseEvent *me)
Reimplemented Function
bool event(QEvent *e)
Reimplemented Function
static QSize globalStrut()
void paintEvent(QPaintEvent *pe)
Reimplemented Function
virtual int bound(int val) const
int tickInterval
the interval that should be drawn between tick marks
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
QSlider::TickPosition tickPosition
the position of the slider's tick marks, if any
long ASN1_INTEGER_get ASN1_INTEGER * a
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
QAbstractSlider(QWidget *parent=0)
Constructs an abstract slider.
QSize minimumSizeHint() const
Reimplemented Function
void setNotchesVisible(bool visible)
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
void setObjectName(const QString &name)
bool dialWrapping
whether the dial should wrap or not
bool upsideDown
the slider control orientation
double angle(const QPoint &, const QPoint &) const
#define QT_BEGIN_NAMESPACE
This macro expands to.
void mousePressEvent(QMouseEvent *me)
Reimplemented Function
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
void initFrom(const QWidget *w)
The QResizeEvent class contains event parameters for resize events.
bool notchesVisible() const
qreal qAtan2(qreal x, qreal y)
void sliderChange(SliderChange change)
Reimplemented Function
int sliderPosition
the position of the slider handle
void setWrapping(bool on)
qreal notchTarget() const
Qt::MouseButton button() const
Returns the button that caused the event.
The QMouseEvent class contains parameters that describe a mouse event.
~QDial()
Destroys the dial.
int valueFromPoint(const QPoint &) const
int maximum
the maximum value for the slider
#define Q_DECLARE_PUBLIC(Class)
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
int minimum
the minimum value for the slider
QObject * parent() const
Returns a pointer to the parent object.
The QPoint class defines a point in the plane using integer precision.
void setSliderPosition(int)
void mouseReleaseEvent(QMouseEvent *me)
Reimplemented Function
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
The QAbstractSlider class provides an integer value within a range.
void resizeEvent(QResizeEvent *re)
Reimplemented Function
The QDial class provides a rounded range control (like a speedometer or potentiometer).
virtual int bound(int val) const
int y() const
Returns the y coordinate of this point.
void initStyleOption(QStyleOptionSlider *option) const
Initialize option with the values from this QDial.
QDial(QWidget *parent=0)
Constructs a dial.
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget...
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
int pageStep
the size of the page step of the slider
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
int singleStep
the size of the single step of the slider
The QSize class defines the size of a two-dimensional object using integer point precision.
int x() const
Returns the x coordinate of this point.
void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt)
Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option...
The QPaintEvent class contains event parameters for paint events.
QSize sizeHint() const
Reimplemented Function
The QEvent class is the base class of all event classes.
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
bool event(QEvent *e)
Reimplemented Function