Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

QY2BarGraph Class Reference

#include <QY2BarGraph.h>

List of all members.

Public Member Functions

 QY2BarGraph (QWidget *parent=0, const char *name=0)
void addSegment (const QString &label=QString(), int value=0)
void setSegments (int segmentCount)
void setValue (int segmentNo, int newValue)
void setLabel (int segmentNo, const QString &newLabel)
int segments () const
int value (int segmentNo) const
const QString label (int segmentNo) const
int sumValues () const
const QColor segmentBackgroundColor (int segmentNo)
const QColor segmentForegroundColor (int segmentNo)
virtual QSize sizeHint () const

Protected Member Functions

virtual void drawContents (QPainter *)
bool index_invalid (int i, const char *function_name) const

Private Attributes

vector< int > _values
vector< QString > _labels


Constructor & Destructor Documentation

QY2BarGraph::QY2BarGraph QWidget *  parent = 0,
const char *  name = 0
 


Member Function Documentation

void QY2BarGraph::addSegment const QString &  label = QString(),
int  value = 0
 

Add one segment to the bar graph.

void QY2BarGraph::drawContents QPainter *   )  [protected, virtual]
 

Draw the graph bar contents. Inherited from QFrame.

bool QY2BarGraph::index_invalid int  i,
const char *  function_name
const [protected]
 

Sanity check for segment index. Returns true if invalid, false if OK.

const QString QY2BarGraph::label int  segmentNo  )  const
 

Return the label of segment no. segmentNo. Any occurence of "%d" etc. will not be expanded here but returned as passed to setLabel().

const QColor QY2BarGraph::segmentBackgroundColor int  segmentNo  ) 
 

Choose a background color suitable for segment no. segmentNo. Only a defined number of different colors are available. After that, previously used colors will be recycled.

const QColor QY2BarGraph::segmentForegroundColor int  segmentNo  ) 
 

Choose a foreground color suitable for segment no. segmentNo. that results in good contrast to the corresponding background color ( see abore )

int QY2BarGraph::segments  )  const [inline]
 

Return the current number of segments.

void QY2BarGraph::setLabel int  segmentNo,
const QString &  newLabel
 

Set the label of segment no. segmentNo ( beginning with 0 ) to newLabel. May contain newlines or d for a reference to the current value.

void QY2BarGraph::setSegments int  segmentCount  ) 
 

Set the number of segments. Initialize all values and labels to zero values.

void QY2BarGraph::setValue int  segmentNo,
int  newValue
 

Set the value of segment no. segmentNo ( beginning with 0 ) to value newValue.

QSize QY2BarGraph::sizeHint  )  const [virtual]
 

Return a suitable size for the widget.

int QY2BarGraph::sumValues  )  const
 

Return the sum of all values,

int QY2BarGraph::value int  segmentNo  )  const
 

Return the current value of segment no. segmentNo.


Member Data Documentation

vector<QString> QY2BarGraph::_labels [private]
 

vector<int> QY2BarGraph::_values [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 10:59:03 2005 for yast2-qt by  doxygen 1.4.4