|
|
This Class provides a Bargraph QWidget.
QValbar can be used as a custom Widget in Designer, to add
Bargraphs to your application.
The bargraphs paremeters can be defined via public methods supplied by the class.
The bargraphs support automatic scaling, 3 different colors (dependent on the value and 3 different bargraph types (FROMLEF, FROMRIGHT, FROMCENTER).
example
Insert QValbar element into your "ui" file and name it e.g. BitrateValBar. Adjust
the bargraph calling
info.maxbitrate may be the maximal bitrate to show.
BitrateValBar->setMinMaxValue( 0, (int)(qdata->info.maxbitrate ), FROMLEFT );
BitrateValBar->setNokRange( 0.0, 0.2 );
BitrateValBar->setCriticalRange( 0.2, 0.6 );
Set a text and Value using
setText( "11MHz" );
// qdata->info.bitrate may be the actual bitrate.
// The value is multiplied by 1 and added by 0 (no value change).
BitrateValBar->setValue( qdata->info.bitrate, 1, 0 );
| void setColor ( const QColor &col )
| setColor |
setColor sets the actual bars color.
col : the color to be set.
| void setNokColor ( const QColor &col )
| setNokColor |
setNokColor sets the actual bars nok color.
col : the color to be set.
| void setCritColor ( const QColor &col )
| setCritColor |
setCritColor sets the actual bars critical color.
col : the color to be set.
| void setOkColor ( const QColor &col )
| setOkColor |
setOkColor sets the actual bars ok color.
col : the color to be set.
| void setText ( const QString &text="" )
| setText |
setText sets the bargraphs text.
The text is shown in the text field.
text : the text to be set.
| void setCriticalRange ( double min = 0, double max = 0 )
| setCriticalRange |
setCriticalRange sets the critical range (where the
bargraph is shown in critical color).
min : the minimal value of the range.
The value has to be entered in percent (value from 0.0 to 1.0).
max : the maximal value of the range.
The value has to be entered in percent (value from 0.0 to 1.0).
| void setNokRange ( double min = 0, double max = 0 )
| setNokRange |
setNokRange sets the NOK range (where the
bargraph is shown in NOK color).
min : the minimal value of the range.
The value has to be entered in percent (value from 0.0 to 1.0).
max : the maximal value of the range.
The value has to be entered in percent (value from 0.0 to 1.0).
| void setMinMaxValue ( int minval = -1, int maxval = -1, int type = FROMLEFT )
| setMinMaxValue |
setMinMaxValue sets minimum and maximum values.
These values are used to calculate above mentioned critical and nok
ranges.
minval : the minimal value of the bargraph.
maxval : the maximal value of the bargraph.
type : the bargraphs type. Possible types are:
#define FROMLEFT 0
#define FROMRIGHT 1
#define FROMCENTER 2
|
| void setValue ( int val=-1, int mult=1, int sum=0 )
| setValue |
setValue sets the actual value.
val : the actual value of the bargraph.
mult : a value multiplier.
sum : a value summand.
| QValBar ( QWidget *parent = 0, const char *name = "", WFlags f = 0 )
| QValBar |
| ~QValBar ()
| ~QValBar |