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

# qwt_compass.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_COMPASS_H
    00011 #define QWT_COMPASS_H 1
    00012
    00013 #include <qstring.h>
    00014 #include <qmap.h>
    00015 #include "qwt_dial.h"
    00016
    00017 #if defined(QWT_TEMPLATEDLL)
    00018 // MOC_SKIP_BEGIN
    00019 template class QWT_EXPORT QMap<double, QString>;
    00020 // MOC_SKIP_END
    00021 #endif
    00022
    00023 class QwtCompassRose;
    00024
    00036 class QWT_EXPORT QwtCompass: public QwtDial
    00037 {
    00038     Q_OBJECT
    00039
    00040 public:
    00041     QwtCompass( QWidget* parent=0, const char* name = 0);
    00042     virtual ~QwtCompass();
    00043
    00044     void setRose(QwtCompassRose *rose);
    00045     const QwtCompassRose *rose() const;
    00046     QwtCompassRose *rose();
    00047
    00048     const QMap<double, QString> &labelMap() const;
    00049     QMap<double, QString> &labelMap();
    00050     void setLabelMap(const QMap<double, QString> &map);
    00051
    00052 protected:
    00053     virtual QString scaleLabel(double value) const;
    00054
    00055     virtual void drawRose(QPainter *, const QPoint &center,
    00056         int radius, double north, QPalette::ColorGroup) const;
    00057
    00058     virtual void drawScaleContents(QPainter *,
    00059         const QPoint &center, int radius) const;
    00060
    00061     virtual void keyPressEvent(QKeyEvent *);
    00062
    00063 private:
    00064     QwtCompassRose *d_rose;
    00065     QMap<double, QString> d_labelMap;
    00066 };
    00067
    00068 #endif