~l3on/ubuntu/oneiric/qwt/fix-921430

« back to all changes in this revision

Viewing changes to qwt-5.0.2/examples/histogram/histogram_item.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2007-10-05 15:20:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071005152041-qmybqh4fj9jejyo2
Tags: 5.0.2-2
* Handle nostrip build option. (Closes: #437877)
* Build libqwt5-doc package in binary-indep target. (Closes: #443110)

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 HISTOGRAM_ITEM_H
 
11
#define HISTOGRAM_ITEM_H
 
12
 
 
13
#include <qglobal.h>
 
14
#include <qcolor.h>
 
15
 
 
16
#include "qwt_plot_item.h" 
 
17
 
 
18
class QwtIntervalData;
 
19
class QString;
 
20
 
 
21
class HistogramItem: public QwtPlotItem
 
22
{
 
23
public:
 
24
    explicit HistogramItem(const QString &title = QString::null);
 
25
    explicit HistogramItem(const QwtText &title);
 
26
    virtual ~HistogramItem();
 
27
 
 
28
    void setData(const QwtIntervalData &data);
 
29
    const QwtIntervalData &data() const;
 
30
 
 
31
    void setColor(const QColor &);
 
32
    QColor color() const;
 
33
 
 
34
    virtual QwtDoubleRect boundingRect() const;
 
35
 
 
36
    virtual int rtti() const;
 
37
 
 
38
    virtual void draw(QPainter *, const QwtScaleMap &xMap, 
 
39
        const QwtScaleMap &yMap, const QRect &) const;
 
40
 
 
41
    void setBaseline(double reference);
 
42
    double baseline() const;
 
43
 
 
44
    enum HistogramAttribute
 
45
    {
 
46
        Auto = 0,
 
47
        Xfy = 1
 
48
    };
 
49
 
 
50
    void setHistogramAttribute(HistogramAttribute, bool on = true);
 
51
    bool testHistogramAttribute(HistogramAttribute) const;
 
52
 
 
53
protected:
 
54
    virtual void drawBar(QPainter *,
 
55
        Qt::Orientation o, const QRect &) const;
 
56
 
 
57
private:
 
58
    void init();
 
59
 
 
60
    class PrivateData;
 
61
    PrivateData *d_data;
 
62
};
 
63
 
 
64
#endif