~valavanisalex/ubuntu/maverick/qtiplot/qtiplot-fix-605025

« back to all changes in this revision

Viewing changes to 3rdparty/qwt/src/qwt_compass.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-04-04 15:11:55 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080404151155-rjp12ziov4tryj0o
Tags: 0.9.4-1
* New upstream release.
* Refresh patches.
* Remove 04_homepage_url patch. Merged upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 
2
 * Qwt Widget Library
 
3
 * Copyright (C) 1997   Josef Wilgen
 
4
 * Copyright (C) 2002   Uwe Rathmann
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the Qwt License, Version 1.0
 
8
 *****************************************************************************/
 
9
 
 
10
#ifndef QWT_COMPASS_H
 
11
#define QWT_COMPASS_H 1
 
12
 
 
13
#include <qstring.h>
 
14
#include <qmap.h>
 
15
#include "qwt_dial.h"
 
16
 
 
17
#if defined(QWT_TEMPLATEDLL)
 
18
 
 
19
#if defined(QT_NO_STL) || QT_VERSION < 0x040000 || QT_VERSION > 0x040001
 
20
/*
 
21
  Unfortunately Qt 4.0.0/Qt 4.0.1 contains uncompilable 
 
22
  code in the STL adaptors of qmap.h. The declaration below 
 
23
  instantiates this code resulting in compiler errors. 
 
24
  If you really need the map to be exported, remove the condition above
 
25
  and fix the qmap.h
 
26
*/
 
27
// MOC_SKIP_BEGIN
 
28
template class QWT_EXPORT QMap<double, QString>;
 
29
// MOC_SKIP_END
 
30
#endif
 
31
 
 
32
#endif
 
33
 
 
34
 
 
35
class QwtCompassRose;
 
36
 
 
37
/*!
 
38
  \brief A Compass Widget
 
39
 
 
40
  QwtCompass is a widget to display and enter directions. It consists
 
41
  of a scale, an optional needle and rose. 
 
42
 
 
43
  \image html dials1.png 
 
44
 
 
45
  \note The examples/dials example shows how to use QwtCompass.
 
46
*/
 
47
 
 
48
class QWT_EXPORT QwtCompass: public QwtDial 
 
49
{
 
50
    Q_OBJECT
 
51
 
 
52
public:
 
53
    explicit QwtCompass( QWidget* parent = NULL);
 
54
#if QT_VERSION < 0x040000
 
55
    explicit QwtCompass(QWidget* parent, const char *name);
 
56
#endif
 
57
    virtual ~QwtCompass();
 
58
 
 
59
    void setRose(QwtCompassRose *rose);
 
60
    const QwtCompassRose *rose() const;
 
61
    QwtCompassRose *rose();
 
62
 
 
63
    const QMap<double, QString> &labelMap() const;
 
64
    QMap<double, QString> &labelMap();
 
65
    void setLabelMap(const QMap<double, QString> &map);
 
66
 
 
67
protected:
 
68
    virtual QwtText scaleLabel(double value) const;
 
69
 
 
70
    virtual void drawRose(QPainter *, const QPoint &center,
 
71
        int radius, double north, QPalette::ColorGroup) const;
 
72
 
 
73
    virtual void drawScaleContents(QPainter *, 
 
74
        const QPoint &center, int radius) const; 
 
75
 
 
76
    virtual void keyPressEvent(QKeyEvent *);
 
77
 
 
78
private:
 
79
    void initCompass();
 
80
 
 
81
    class PrivateData;
 
82
    PrivateData *d_data;
 
83
};
 
84
 
 
85
#endif