Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 
00019 #if defined(QT_NO_STL) || QT_VERSION < 0x040000 || QT_VERSION > 0x040001
00020 /*
00021   Unfortunately Qt 4.0.0/Qt 4.0.1 contains uncompilable 
00022   code in the STL adaptors of qmap.h. The declaration below 
00023   instantiates this code resulting in compiler errors. 
00024   If you really need the map to be exported, remove the condition above
00025   and fix the qmap.h
00026 */
00027 // MOC_SKIP_BEGIN
00028 template class QWT_EXPORT QMap<double, QString>;
00029 // MOC_SKIP_END
00030 #endif
00031 
00032 #endif
00033 
00034 
00035 class QwtCompassRose;
00036 
00048 class QWT_EXPORT QwtCompass: public QwtDial 
00049 {
00050     Q_OBJECT
00051 
00052 public:
00053     explicit QwtCompass( QWidget* parent = NULL);
00054     virtual ~QwtCompass();
00055 
00056     void setRose(QwtCompassRose *rose);
00057     const QwtCompassRose *rose() const;
00058     QwtCompassRose *rose();
00059 
00060     const QMap<double, QString> &labelMap() const;
00061     QMap<double, QString> &labelMap();
00062     void setLabelMap(const QMap<double, QString> &map);
00063 
00064 protected:
00065     virtual QwtText scaleLabel(double value) const;
00066 
00067     virtual void drawRose(QPainter *, const QPoint &center,
00068         int radius, double north, QPalette::ColorGroup) const;
00069 
00070     virtual void drawScaleContents(QPainter *, 
00071         const QPoint &center, int radius) const; 
00072 
00073     virtual void keyPressEvent(QKeyEvent *);
00074 
00075 private:
00076     class PrivateData;
00077     PrivateData *d_data;
00078 };
00079 
00080 #endif

Generated on Mon Jan 30 22:16:25 2006 for Qwt User's Guide by  doxygen 1.4.4