2 KSysGuard, the KDE System Guard
4 Copyright (c) 1999 - 2001 Chris Schlaeger <cs@kde.org>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License version 2 or at your option version 3 as published by
9 the Free Software Foundation.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef KSG_BARGRAPH_H
23 #define KSG_BARGRAPH_H
26 #include <QPaintEvent>
28 class BarGraph
: public QWidget
32 friend class DancingBars
;
35 explicit BarGraph( QWidget
*parent
);
38 bool addBar( const QString
&footer
);
39 bool removeBar( uint idx
);
41 void updateSamples( const QVector
<double> &newSamples
);
53 void getLimits( double &l
, bool &la
, double &u
, bool &ua
) const
56 la
= lowerLimitActive
;
58 ua
= upperLimitActive
;
61 void setLimits( double l
, bool la
, double u
, bool ua
)
64 lowerLimitActive
= la
;
66 upperLimitActive
= ua
;
69 void changeRange( double min
, double max
);
72 virtual void paintEvent( QPaintEvent
* );
78 double lowerLimitActive
;
80 bool upperLimitActive
;
82 QVector
<double> samples
;
87 QColor mBackgroundColor
;