Qwt User's Guide 6.3.0
|
An analog clock. More...
#include <qwt_analog_clock.h>
Public Types | |
enum | Hand { SecondHand , MinuteHand , HourHand , NHands } |
Public Types inherited from QwtDial | |
enum | Shadow { Plain = QFrame::Plain , Raised = QFrame::Raised , Sunken = QFrame::Sunken } |
Frame shadow. More... | |
enum | Mode { RotateNeedle , RotateScale } |
Mode controlling whether the needle or the scale is rotating. More... | |
Public Slots | |
void | setCurrentTime () |
Set the current time. | |
void | setTime (const QTime &) |
Public Slots inherited from QwtAbstractSlider | |
void | setValue (double value) |
Public Member Functions | |
QwtAnalogClock (QWidget *parent=NULL) | |
virtual | ~QwtAnalogClock () |
Destructor. | |
void | setHand (Hand, QwtDialNeedle *) |
const QwtDialNeedle * | hand (Hand) const |
QwtDialNeedle * | hand (Hand) |
Public Member Functions inherited from QwtDial | |
QwtDial (QWidget *parent=NULL) | |
Constructor. | |
virtual | ~QwtDial () |
Destructor. | |
void | setFrameShadow (Shadow) |
Shadow | frameShadow () const |
void | setLineWidth (int) |
int | lineWidth () const |
void | setMode (Mode) |
Change the mode of the dial. | |
Mode | mode () const |
void | setScaleArc (double minArc, double maxArc) |
void | setMinScaleArc (double) |
double | minScaleArc () const |
void | setMaxScaleArc (double) |
double | maxScaleArc () const |
virtual void | setOrigin (double) |
Change the origin. | |
double | origin () const |
void | setNeedle (QwtDialNeedle *) |
const QwtDialNeedle * | needle () const |
QwtDialNeedle * | needle () |
QRect | boundingRect () const |
QRect | innerRect () const |
virtual QRect | scaleInnerRect () const |
virtual QSize | sizeHint () const override |
virtual QSize | minimumSizeHint () const override |
void | setScaleDraw (QwtRoundScaleDraw *) |
QwtRoundScaleDraw * | scaleDraw () |
const QwtRoundScaleDraw * | scaleDraw () const |
Public Member Functions inherited from QwtAbstractSlider | |
QwtAbstractSlider (QWidget *parent=NULL) | |
Constructor. | |
virtual | ~QwtAbstractSlider () |
Destructor. | |
void | setValid (bool) |
bool | isValid () const |
double | value () const |
Returns the current value. | |
void | setWrapping (bool) |
bool | wrapping () const |
void | setTotalSteps (uint) |
Set the number of steps. | |
uint | totalSteps () const |
void | setSingleSteps (uint) |
Set the number of steps for a single increment. | |
uint | singleSteps () const |
void | setPageSteps (uint) |
Set the number of steps for a page increment. | |
uint | pageSteps () const |
void | setStepAlignment (bool) |
Enable step alignment. | |
bool | stepAlignment () const |
void | setTracking (bool) |
Enables or disables tracking. | |
bool | isTracking () const |
void | setReadOnly (bool) |
bool | isReadOnly () const |
void | setInvertedControls (bool) |
bool | invertedControls () const |
Public Member Functions inherited from QwtAbstractScale | |
QwtAbstractScale (QWidget *parent=NULL) | |
virtual | ~QwtAbstractScale () |
Destructor. | |
void | setScale (double lowerBound, double upperBound) |
Specify a scale. | |
void | setScale (const QwtInterval &) |
Specify a scale. | |
void | setScale (const QwtScaleDiv &) |
Specify a scale. | |
const QwtScaleDiv & | scaleDiv () const |
void | setLowerBound (double value) |
double | lowerBound () const |
void | setUpperBound (double value) |
double | upperBound () const |
void | setScaleStepSize (double stepSize) |
Set the step size used for calculating a scale division. | |
double | scaleStepSize () const |
void | setScaleMaxMajor (int ticks) |
Set the maximum number of major tick intervals. | |
int | scaleMaxMinor () const |
void | setScaleMaxMinor (int ticks) |
Set the maximum number of minor tick intervals. | |
int | scaleMaxMajor () const |
void | setScaleEngine (QwtScaleEngine *) |
Set a scale engine. | |
const QwtScaleEngine * | scaleEngine () const |
QwtScaleEngine * | scaleEngine () |
int | transform (double) const |
double | invTransform (int) const |
bool | isInverted () const |
double | minimum () const |
double | maximum () const |
const QwtScaleMap & | scaleMap () const |
Protected Member Functions | |
virtual void | drawNeedle (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) const override |
Draw the needle. | |
virtual void | drawHand (QPainter *, Hand, const QPointF &, double radius, double direction, QPalette::ColorGroup) const |
Protected Member Functions inherited from QwtDial | |
virtual void | wheelEvent (QWheelEvent *) override |
virtual void | paintEvent (QPaintEvent *) override |
virtual void | changeEvent (QEvent *) override |
virtual void | drawFrame (QPainter *) |
virtual void | drawContents (QPainter *) const |
Draw the contents inside the frame. | |
virtual void | drawFocusIndicator (QPainter *) const |
void | invalidateCache () |
virtual void | drawScale (QPainter *, const QPointF ¢er, double radius) const |
virtual void | drawScaleContents (QPainter *painter, const QPointF ¢er, double radius) const |
virtual double | scrolledTo (const QPoint &) const override |
Determine the value for a new position of the slider handle. | |
virtual bool | isScrollPosition (const QPoint &) const override |
Determine what to do when the user presses a mouse button. | |
virtual void | sliderChange () override |
Calling update() | |
virtual void | scaleChange () override |
Protected Member Functions inherited from QwtAbstractSlider | |
virtual void | mousePressEvent (QMouseEvent *) override |
virtual void | mouseReleaseEvent (QMouseEvent *) override |
virtual void | mouseMoveEvent (QMouseEvent *) override |
virtual void | keyPressEvent (QKeyEvent *) override |
void | incrementValue (int stepCount) |
double | incrementedValue (double value, int stepCount) const |
Protected Member Functions inherited from QwtAbstractScale | |
void | rescale (double lowerBound, double upperBound, double stepSize) |
void | setAbstractScaleDraw (QwtAbstractScaleDraw *) |
Set a scale draw. | |
const QwtAbstractScaleDraw * | abstractScaleDraw () const |
QwtAbstractScaleDraw * | abstractScaleDraw () |
void | updateScaleDraw () |
Additional Inherited Members | |
Signals inherited from QwtAbstractSlider | |
void | valueChanged (double value) |
Notify a change of value. | |
void | sliderPressed () |
void | sliderReleased () |
void | sliderMoved (double value) |
An analog clock.
Definition at line 43 of file qwt_analog_clock.h.
enum QwtAnalogClock::Hand |
Hand type
Enumerator | |
---|---|
SecondHand | Needle displaying the seconds. |
MinuteHand | Needle displaying the minutes. |
HourHand | Needle displaying the hours. |
NHands | Number of needles. |
Definition at line 52 of file qwt_analog_clock.h.
|
explicit |
|
virtual |
Destructor.
Definition at line 110 of file qwt_analog_clock.cpp.
|
protectedvirtual |
Draw a clock hand
painter | Painter |
hd | Specify the type of hand |
center | Center of the clock |
radius | Maximum length for the hands |
direction | Direction of the hand in degrees, counter clockwise |
cg | ColorGroup |
Definition at line 239 of file qwt_analog_clock.cpp.
|
overrideprotectedvirtual |
Draw the needle.
A clock has no single needle but three hands instead. drawNeedle() translates value() into directions for the hands and calls drawHand().
painter | Painter |
center | Center of the clock |
radius | Maximum length for the hands |
direction | Dummy, not used. |
colorGroup | ColorGroup |
Reimplemented from QwtDial.
Definition at line 202 of file qwt_analog_clock.cpp.
QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) |
hd | Specifies the type of hand |
Definition at line 146 of file qwt_analog_clock.cpp.
const QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) | const |
hd | Specifies the type of hand |
Definition at line 159 of file qwt_analog_clock.cpp.
|
slot |
Set the current time.
Definition at line 167 of file qwt_analog_clock.cpp.
void QwtAnalogClock::setHand | ( | Hand | hand, |
QwtDialNeedle * | needle ) |
Set a clock hand
hand | Specifies the type of hand |
needle | Hand |
Definition at line 132 of file qwt_analog_clock.cpp.
|
slot |