Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

qwt_analog_clock.h

00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_ANALOG_CLOCK_H
00011 #define QWT_ANALOG_CLOCK_H
00012 
00013 #include <qdatetime.h>
00014 #include "qwt_global.h"
00015 #include "qwt_dial.h"
00016 #include "qwt_dial_needle.h"
00017 
00045 class QWT_EXPORT QwtAnalogClock: public QwtDial
00046 {
00047     Q_OBJECT
00048 
00049 public:
00050     enum Hand
00051     {
00052         SecondHand,
00053         MinuteHand,
00054         HourHand,
00055 
00056         NHands
00057     };
00058 
00059     QwtAnalogClock(QWidget* parent=0, const char* name = 0);
00060     virtual ~QwtAnalogClock();
00061 
00062     virtual void setHand(Hand, QwtDialNeedle *);
00063     const QwtDialNeedle *hand(Hand) const;
00064     QwtDialNeedle *hand(Hand);
00065 
00066 public slots:
00067     void setCurrentTime();
00068     void setTime(const QTime & = QTime::currentTime());
00069 
00070 protected:
00071     virtual QString scaleLabel(double) const;
00072 
00073     virtual void drawNeedle(QPainter *, const QPoint &,
00074         int radius, double direction, QPalette::ColorGroup) const;
00075 
00076     virtual void drawHand(QPainter *, Hand, const QPoint &,
00077         int radius, double direction, QPalette::ColorGroup) const;
00078 
00079 private:
00080     virtual void setNeedle(QwtDialNeedle *);
00081 
00082     QwtDialNeedle *d_hand[NHands];
00083 };
00084 
00085 #endif

Generated on Sun Nov 21 11:12:42 2004 for Qwt User's Guide by doxygen 1.3.5