An analog clock. More...
#include <qwt_analog_clock.h>
Public Types | |
enum | Hand { SecondHand, MinuteHand, HourHand, NHands } |
Public Types inherited from QwtDial | |
enum | Mode { RotateNeedle, RotateScale } |
Mode controlling whether the needle or the scale is rotating. More... | |
enum | Shadow { Plain = QFrame::Plain, Raised = QFrame::Raised, Sunken = QFrame::Sunken } |
Frame shadow. More... | |
Public Slots | |
void | setCurrentTime () |
Set the current time. More... | |
void | setTime (const QTime &) |
Public Slots inherited from QwtAbstractSlider | |
void | setValue (double val) |
Public Member Functions | |
const QwtDialNeedle * | hand (Hand) const |
QwtDialNeedle * | hand (Hand) |
QwtAnalogClock (QWidget *parent=NULL) | |
void | setHand (Hand, QwtDialNeedle *) |
virtual | ~QwtAnalogClock () |
Destructor. More... | |
Public Member Functions inherited from QwtDial | |
QRect | boundingRect () const |
Shadow | frameShadow () const |
QRect | innerRect () const |
int | lineWidth () const |
double | maxScaleArc () const |
virtual QSize | minimumSizeHint () const |
double | minScaleArc () const |
Mode | mode () const |
const QwtDialNeedle * | needle () const |
QwtDialNeedle * | needle () |
double | origin () const |
QwtDial (QWidget *parent=NULL) | |
Constructor. More... | |
QwtRoundScaleDraw * | scaleDraw () |
const QwtRoundScaleDraw * | scaleDraw () const |
virtual QRect | scaleInnerRect () const |
void | setFrameShadow (Shadow) |
void | setLineWidth (int) |
void | setMaxScaleArc (double min) |
void | setMinScaleArc (double min) |
void | setMode (Mode) |
Change the mode of the dial. More... | |
void | setNeedle (QwtDialNeedle *) |
virtual void | setOrigin (double) |
Change the origin. More... | |
void | setScaleArc (double min, double max) |
void | setScaleDraw (QwtRoundScaleDraw *) |
virtual QSize | sizeHint () const |
virtual | ~QwtDial () |
Destructor. More... | |
Public Member Functions inherited from QwtAbstractSlider | |
bool | invertedControls () const |
bool | isReadOnly () const |
bool | isTracking () const |
bool | isValid () const |
uint | pageSteps () const |
QwtAbstractSlider (QWidget *parent=NULL) | |
Constructor. More... | |
void | setInvertedControls (bool) |
void | setPageSteps (uint) |
Set the number of steps for a page increment. More... | |
void | setReadOnly (bool) |
void | setSingleSteps (uint) |
Set the number of steps for a single increment. More... | |
void | setStepAlignment (bool) |
Enable step alignment. More... | |
void | setTotalSteps (uint) |
Set the number of steps. More... | |
void | setTracking (bool) |
Enables or disables tracking. More... | |
void | setValid (bool) |
void | setWrapping (bool) |
uint | singleSteps () const |
bool | stepAlignment () const |
uint | totalSteps () const |
double | value () const |
bool | wrapping () const |
virtual | ~QwtAbstractSlider () |
Destructor. More... | |
Public Member Functions inherited from QwtAbstractScale | |
double | invTransform (int) const |
bool | isInverted () const |
double | lowerBound () const |
double | maximum () const |
double | minimum () const |
QwtAbstractScale (QWidget *parent=NULL) | |
const QwtScaleDiv & | scaleDiv () const |
const QwtScaleEngine * | scaleEngine () const |
QwtScaleEngine * | scaleEngine () |
const QwtScaleMap & | scaleMap () const |
int | scaleMaxMajor () const |
int | scaleMaxMinor () const |
double | scaleStepSize () const |
void | setLowerBound (double value) |
void | setScale (double lowerBound, double upperBound) |
Specify a scale. More... | |
void | setScale (const QwtInterval &) |
Specify a scale. More... | |
void | setScale (const QwtScaleDiv &) |
Specify a scale. More... | |
void | setScaleEngine (QwtScaleEngine *) |
Set a scale engine. More... | |
void | setScaleMaxMajor (int ticks) |
Set the maximum number of major tick intervals. More... | |
void | setScaleMaxMinor (int ticks) |
Set the maximum number of minor tick intervals. More... | |
void | setScaleStepSize (double stepSize) |
Set the step size used for calculating a scale division. More... | |
void | setUpperBound (double value) |
int | transform (double) const |
double | upperBound () const |
virtual | ~QwtAbstractScale () |
Destructor. More... | |
Protected Member Functions | |
virtual void | drawHand (QPainter *, Hand, const QPointF &, double radius, double direction, QPalette::ColorGroup) const |
virtual void | drawNeedle (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) const |
Draw the needle. More... | |
Protected Member Functions inherited from QwtDial | |
virtual void | changeEvent (QEvent *) |
virtual void | drawContents (QPainter *) const |
Draw the contents inside the frame. More... | |
virtual void | drawFocusIndicator (QPainter *) const |
virtual void | drawFrame (QPainter *p) |
virtual void | drawScale (QPainter *, const QPointF ¢er, double radius) const |
virtual void | drawScaleContents (QPainter *painter, const QPointF ¢er, double radius) const |
void | invalidateCache () |
virtual bool | isScrollPosition (const QPoint &) const |
Determine what to do when the user presses a mouse button. More... | |
virtual void | paintEvent (QPaintEvent *) |
virtual void | scaleChange () |
virtual double | scrolledTo (const QPoint &) const |
Determine the value for a new position of the slider handle. More... | |
virtual void | sliderChange () |
Calling update() More... | |
virtual void | wheelEvent (QWheelEvent *) |
Protected Member Functions inherited from QwtAbstractSlider | |
double | incrementedValue (double value, int stepCount) const |
void | incrementValue (int numSteps) |
virtual void | keyPressEvent (QKeyEvent *) |
virtual void | mouseMoveEvent (QMouseEvent *) |
virtual void | mousePressEvent (QMouseEvent *) |
virtual void | mouseReleaseEvent (QMouseEvent *) |
Protected Member Functions inherited from QwtAbstractScale | |
const QwtAbstractScaleDraw * | abstractScaleDraw () const |
QwtAbstractScaleDraw * | abstractScaleDraw () |
void | rescale (double lowerBound, double upperBound, double stepSize) |
void | setAbstractScaleDraw (QwtAbstractScaleDraw *) |
Set a scale draw. More... | |
void | updateScaleDraw () |
Private Member Functions | |
void | setNeedle (QwtDialNeedle *) |
Private Attributes | |
QwtDialNeedle * | d_hand [NHands] |
Additional Inherited Members | |
Signals inherited from QwtAbstractSlider | |
void | sliderMoved (double value) |
void | sliderPressed () |
void | sliderReleased () |
void | valueChanged (double value) |
Notify a change of value. More... | |
Properties inherited from QwtDial | |
Shadow | frameShadow |
int | lineWidth |
double | maxScaleArc |
double | minScaleArc |
Mode | mode |
double | origin |
Properties inherited from QwtAbstractSlider | |
bool | invertedControls |
uint | pageSteps |
bool | readOnly |
uint | singleSteps |
bool | stepAlignment |
uint | totalSteps |
bool | tracking |
double | value |
Returns the current value. More... | |
bool | wrapping |
Properties inherited from QwtAbstractScale | |
double | lowerBound |
int | scaleMaxMajor |
int | scaleMaxMinor |
double | scaleStepSize |
double | upperBound |
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 103 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 232 of file qwt_analog_clock.cpp.
|
protectedvirtual |
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 |
dir | Dummy, not used. |
colorGroup | ColorGroup |
Reimplemented from QwtDial.
Definition at line 195 of file qwt_analog_clock.cpp.
const QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) | const |
hd | Specifies the type of hand |
Definition at line 152 of file qwt_analog_clock.cpp.
QwtDialNeedle * QwtAnalogClock::hand | ( | Hand | hd | ) |
hd | Specifies the type of hand |
Definition at line 139 of file qwt_analog_clock.cpp.
|
slot |
Set the current time.
Definition at line 160 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 125 of file qwt_analog_clock.cpp.
|
private |
Nop method, use setHand() instead
Definition at line 113 of file qwt_analog_clock.cpp.
|
slot |
|
private |
Definition at line 90 of file qwt_analog_clock.h.