qwt_compass.h
Go to the documentation of this file.
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 "qwt_global.h"
00014 #include "qwt_dial.h"
00015 #include "qwt_round_scale_draw.h"
00016 #include <qstring.h>
00017 #include <qmap.h>
00018 
00019 class QwtCompassRose;
00020 
00031 class QWT_EXPORT QwtCompassScaleDraw: public QwtRoundScaleDraw
00032 {
00033 public:
00034     explicit QwtCompassScaleDraw();
00035     explicit QwtCompassScaleDraw( const QMap<double, QString> &map );
00036 
00037     void setLabelMap( const QMap<double, QString> &map );
00038     QMap<double, QString> labelMap() const;
00039 
00040     virtual QwtText label( double value ) const;
00041 
00042 private:
00043     QMap<double, QString> d_labelMap;
00044 };
00045 
00057 class QWT_EXPORT QwtCompass: public QwtDial
00058 {
00059     Q_OBJECT
00060 
00061 public:
00062     explicit QwtCompass( QWidget* parent = NULL );
00063     virtual ~QwtCompass();
00064 
00065     void setRose( QwtCompassRose *rose );
00066     const QwtCompassRose *rose() const;
00067     QwtCompassRose *rose();
00068 
00069 protected:
00070     virtual void drawRose( QPainter *, const QPointF &center,
00071         double radius, double north, QPalette::ColorGroup ) const;
00072 
00073     virtual void drawScaleContents( QPainter *,
00074         const QPointF &center, double radius ) const;
00075 
00076     virtual void keyPressEvent( QKeyEvent * );
00077 
00078 private:
00079     class PrivateData;
00080     PrivateData *d_data;
00081 };
00082 
00083 #endif


plotjuggler
Author(s): Davide Faconti
autogenerated on Wed Jul 3 2019 19:28:04