Code Search for Developers
 
 
  

qwt_analog_clock.h from marsyas at Krugle


Show qwt_analog_clock.h syntax highlighted

/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 * Qwt Widget Library
 * Copyright (C) 1997   Josef Wilgen
 * Copyright (C) 2002   Uwe Rathmann
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the Qwt License, Version 1.0
 *****************************************************************************/

#ifndef QWT_ANALOG_CLOCK_H
#define QWT_ANALOG_CLOCK_H

#include <qdatetime.h>
#include "qwt_global.h"
#include "qwt_dial.h"
#include "qwt_dial_needle.h"

/*!
  \brief An analog clock

  \image html analogclock.png

  \par Example
  \verbatim #include <qwt_analog_clock.h>

  QwtAnalogClock *clock = new QwtAnalogClock(...);
  clock->scaleDraw()->setPenWidth(3);
  clock->setLineWidth(6);
  clock->setFrameShadow(QwtDial::Sunken);
  clock->setTime();

  // update the clock every second
  QTimer *timer = new QTimer(clock);
  timer->connect(timer, SIGNAL(timeout()), clock, SLOT(setCurrentTime()));
  timer->start(1000);

  \endverbatim

  Qwt is missing a set of good looking hands.
  Contributions are very welcome.

  \note The examples/dials example shows how to use QwtAnalogClock.
*/

class QWT_EXPORT QwtAnalogClock: public QwtDial
{
    Q_OBJECT

public:
    /*! 
        Hand type
        \sa setHand(), hand()
    */

    enum Hand
    {
        SecondHand,
        MinuteHand,
        HourHand,

        NHands
    };

    explicit QwtAnalogClock(QWidget* parent = NULL);
#if QT_VERSION < 0x040000
    explicit QwtAnalogClock(QWidget* parent, const char *name);
#endif
    virtual ~QwtAnalogClock();

    virtual void setHand(Hand, QwtDialNeedle *);
    const QwtDialNeedle *hand(Hand) const;
    QwtDialNeedle *hand(Hand);

public slots:
    void setCurrentTime();
    void setTime(const QTime & = QTime::currentTime());

protected:
    virtual QwtText scaleLabel(double) const;

    virtual void drawNeedle(QPainter *, const QPoint &,
        int radius, double direction, QPalette::ColorGroup) const;

    virtual void drawHand(QPainter *, Hand, const QPoint &,
        int radius, double direction, QPalette::ColorGroup) const;

private:
    virtual void setNeedle(QwtDialNeedle *);
    void initClock();

    QwtDialNeedle *d_hand[NHands];
};

#endif




See more files for this project here

marsyas

Marsyas (Music Analysis, Retrieval and Synthesis for Audio Signals) is a framework for developing systems for audio processing. It provides an general architecture for connecting audio, soundfiles, signal processing blocks and machine learning.

Project homepage: http://sourceforge.net/projects/marsyas
Programming language(s): C++
License: other

  qwt.h
  qwt_abstract_scale.cpp
  qwt_abstract_scale.h
  qwt_abstract_scale_draw.cpp
  qwt_abstract_scale_draw.h
  qwt_abstract_slider.cpp
  qwt_abstract_slider.h
  qwt_analog_clock.cpp
  qwt_analog_clock.h
  qwt_array.h
  qwt_arrow_button.cpp
  qwt_arrow_button.h
  qwt_color_map.cpp
  qwt_color_map.h
  qwt_compass.cpp
  qwt_compass.h
  qwt_compass_rose.cpp
  qwt_compass_rose.h
  qwt_counter.cpp
  qwt_counter.h
  qwt_curve_fitter.cpp
  qwt_curve_fitter.h
  qwt_data.cpp
  qwt_data.h
  qwt_dial.cpp
  qwt_dial.h
  qwt_dial_needle.cpp
  qwt_dial_needle.h
  qwt_double_interval.cpp
  qwt_double_interval.h
  qwt_double_range.cpp
  qwt_double_range.h
  qwt_double_rect.cpp
  qwt_double_rect.h
  qwt_dyngrid_layout.cpp
  qwt_dyngrid_layout.h
  qwt_event_pattern.cpp
  qwt_event_pattern.h
  qwt_global.h
  qwt_interval_data.cpp
  qwt_interval_data.h
  qwt_knob.cpp
  qwt_knob.h
  qwt_layout_metrics.cpp
  qwt_layout_metrics.h
  qwt_legend.cpp
  qwt_legend.h
  qwt_legend_item.cpp
  qwt_legend_item.h
  qwt_math.cpp
  qwt_math.h
  qwt_paint_buffer.cpp
  qwt_paint_buffer.h
  qwt_painter.cpp
  qwt_painter.h
  qwt_panner.cpp
  qwt_panner.h
  qwt_picker.cpp
  qwt_picker.h
  qwt_picker_machine.cpp
  qwt_picker_machine.h
  qwt_plot.cpp
  qwt_plot.h
  qwt_plot_axis.cpp
  qwt_plot_canvas.cpp
  qwt_plot_canvas.h
  qwt_plot_curve.cpp
  qwt_plot_curve.h
  qwt_plot_dict.cpp
  qwt_plot_dict.h
  qwt_plot_grid.cpp
  qwt_plot_grid.h
  qwt_plot_item.cpp
  qwt_plot_item.h
  qwt_plot_layout.cpp
  qwt_plot_layout.h
  qwt_plot_magnifier.cpp
  qwt_plot_magnifier.h
  qwt_plot_marker.cpp
  qwt_plot_marker.h
  qwt_plot_panner.cpp
  qwt_plot_panner.h
  qwt_plot_picker.cpp
  qwt_plot_picker.h
  qwt_plot_print.cpp
  qwt_plot_printfilter.cpp
  qwt_plot_printfilter.h
  qwt_plot_rasteritem.cpp
  qwt_plot_rasteritem.h
  qwt_plot_spectrogram.cpp
  qwt_plot_spectrogram.h
  qwt_plot_svgitem.cpp
  qwt_plot_svgitem.h
  qwt_plot_xml.cpp
  qwt_plot_zoomer.cpp
  qwt_plot_zoomer.h
  qwt_polygon.h
  qwt_raster_data.cpp
  qwt_raster_data.h
  qwt_rect.cpp