KDChart::GridAttributes Class Reference

#include <KDChartGridAttributes.h>

List of all members.


Detailed Description

A set of attributes controlling the appearance of grids.

Definition at line 44 of file KDChartGridAttributes.h.


Public Member Functions

bool adjustLowerBoundToGrid () const
bool adjustUpperBoundToGrid () const
 GridAttributes (const GridAttributes &)
 GridAttributes ()
KDChartEnums::GranularitySequence gridGranularitySequence () const
 Returns the granularity sequence to be used for calculating the grid lines.
QPen gridPen () const
qreal gridStepWidth () const
 Returns the step width to be used for calculating the grid lines.
qreal gridSubStepWidth () const
 Returns the sub-step width to be used for calculating the sub-grid lines.
bool isGridVisible () const
bool isSubGridVisible () const
bool operator!= (const GridAttributes &other) const
GridAttributesoperator= (const GridAttributes &)
bool operator== (const GridAttributes &) const
void setAdjustBoundsToGrid (bool adjustLower, bool adjustUpper)
 By default visible bounds of the data area are adjusted to match a main grid line.
void setGridGranularitySequence (KDChartEnums::GranularitySequence sequence)
 Specify which granularity sequence is to be used to find a matching grid granularity.
void setGridPen (const QPen &pen)
void setGridStepWidth (qreal stepWidth=0.0)
 Specifies the step width to be used for calculating the grid lines.
void setGridSubStepWidth (qreal subStepWidth=0.0)
 Specifies the sub-step width to be used for calculating the grid sub-lines.
void setGridVisible (bool visible)
void setSubGridPen (const QPen &pen)
void setSubGridVisible (bool visible)
void setZeroLinePen (const QPen &pen)
QPen subGridPen () const
QPen zeroLinePen () const
 ~GridAttributes ()

Constructor & Destructor Documentation

GridAttributes::GridAttributes (  ) 

Definition at line 73 of file KDChartGridAttributes.cpp.

00074     : _d( new Private() )
00075 {
00076     // this bloc left empty intentionally
00077 }

GridAttributes::GridAttributes ( const GridAttributes r  ) 

Definition at line 79 of file KDChartGridAttributes.cpp.

00080     : _d( new Private( *r.d ) )
00081 {
00082 }

GridAttributes::~GridAttributes (  ) 

Definition at line 94 of file KDChartGridAttributes.cpp.

00095 {
00096     delete _d; _d = 0;
00097 }


Member Function Documentation

bool GridAttributes::adjustLowerBoundToGrid (  )  const

Definition at line 226 of file KDChartGridAttributes.cpp.

References d.

Referenced by operator==().

00227 {
00228     return d->adjustLower;
00229 }

bool GridAttributes::adjustUpperBoundToGrid (  )  const

Definition at line 230 of file KDChartGridAttributes.cpp.

References d.

Referenced by operator==().

00231 {
00232     return d->adjustUpper;
00233 }

KDChartEnums::GranularitySequence GridAttributes::gridGranularitySequence (  )  const

Returns the granularity sequence to be used for calculating the grid lines.

See also:
setGridGranularitySequence

Definition at line 216 of file KDChartGridAttributes.cpp.

References d.

Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList(), and operator==().

00217 {
00218     return d->sequence;
00219 }

QPen GridAttributes::gridPen (  )  const

Definition at line 241 of file KDChartGridAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00242 {
00243     return d->pen;
00244 }

qreal GridAttributes::gridStepWidth (  )  const

Returns the step width to be used for calculating the grid lines.

See also:
setGridStepWidth

Definition at line 152 of file KDChartGridAttributes.cpp.

References d.

Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList(), and operator<<().

00153 {
00154     return d->stepWidth;
00155 }

qreal GridAttributes::gridSubStepWidth (  )  const

Returns the sub-step width to be used for calculating the sub-grid lines.

See also:
setGridStepWidth

Definition at line 183 of file KDChartGridAttributes.cpp.

References d.

Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList(), and operator<<().

00184 {
00185     return d->subStepWidth;
00186 }

bool GridAttributes::isGridVisible (  )  const

Definition at line 118 of file KDChartGridAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00119 {
00120     return d->visible;
00121 }

bool GridAttributes::isSubGridVisible (  )  const

Definition at line 251 of file KDChartGridAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00252 {
00253     return d->subVisible;
00254 }

bool KDChart::GridAttributes::operator!= ( const GridAttributes other  )  const

Definition at line 107 of file KDChartGridAttributes.h.

References KDGantt::operator==().

00107 { return !operator==(other); }

GridAttributes & GridAttributes::operator= ( const GridAttributes r  ) 

Definition at line 84 of file KDChartGridAttributes.cpp.

References d.

00085 {
00086     if( this == &r )
00087         return *this;
00088 
00089     *d = *r.d;
00090 
00091     return *this;
00092 }

bool GridAttributes::operator== ( const GridAttributes r  )  const

Definition at line 100 of file KDChartGridAttributes.cpp.

References adjustLowerBoundToGrid(), adjustUpperBoundToGrid(), gridGranularitySequence(), gridPen(), isGridVisible(), isSubGridVisible(), subGridPen(), and zeroLinePen().

00101 {
00102     return  isGridVisible() == r.isGridVisible() &&
00103             gridGranularitySequence() == r.gridGranularitySequence() &&
00104             adjustLowerBoundToGrid() == r.adjustLowerBoundToGrid() &&
00105             adjustUpperBoundToGrid() == r.adjustUpperBoundToGrid() &&
00106             gridPen() == r.gridPen() &&
00107             isSubGridVisible() == r.isSubGridVisible() &&
00108             subGridPen() == r.subGridPen() &&
00109             zeroLinePen() == r.zeroLinePen();
00110 }

void GridAttributes::setAdjustBoundsToGrid ( bool  adjustLower,
bool  adjustUpper 
)

By default visible bounds of the data area are adjusted to match a main grid line.

If you set the respective adjust flag to false the bound will not start at a grid line's value but it will be the exact value of the data range set.

See also:
CartesianCoordinatePlane::setHorizontalRange

CartesianCoordinatePlane::setVerticalRange

Definition at line 221 of file KDChartGridAttributes.cpp.

References d.

00222 {
00223     d->adjustLower = adjustLower;
00224     d->adjustUpper = adjustUpper;
00225 }

void GridAttributes::setGridGranularitySequence ( KDChartEnums::GranularitySequence  sequence  ) 

Specify which granularity sequence is to be used to find a matching grid granularity.

Specifies the granularity sequence to be used for calculating the grid lines.

See details explained at KDChartEnums::GranularitySequence.

You might also want to use setAdjustBoundsToGrid for fine-tuning the start/end value.

See also:
setAdjustBoundsToGrid, GranularitySequence
By default the GridAttributes class uses KDChartEnums::GranularitySequence_10_20.

Note:
Granularity can be set for Linear axis calculation mode only, there is no way to specify a step width for Logarithmic axes.

The sequence specified by this method is ignored, if a fixed step width was specified via setStepWidth.

Parameters:
sequence one of the sequences declared in KDChartEnums::GranularitySequence.
See also:
gridGranularitySequence, setStepWidth

Definition at line 205 of file KDChartGridAttributes.cpp.

References d.

00206 {
00207     d->sequence = sequence;
00208 }

void GridAttributes::setGridPen ( const QPen &  pen  ) 

Definition at line 235 of file KDChartGridAttributes.cpp.

References d.

00236 {
00237     d->pen = pen;
00238     d->pen.setCapStyle( Qt::FlatCap );
00239 }

void GridAttributes::setGridStepWidth ( qreal  stepWidth = 0.0  ) 

Specifies the step width to be used for calculating the grid lines.

Note:
Step with can be set for Linear axis calculation mode only, there is no way to specify a step width for Logarithmic axes.
By default the GridAttributes class does not use a fixed step width, but it uses KDChartEnums::GranularitySequence_10_20.

Parameters:
stepWidth the step width to be used. If this parameter is omitted (or set to Zero, resp.) the automatic step width calculation will be done, using the granularity sequence specified. This is the default.
See also:
gridStepWidth, setGranularitySequence

Definition at line 141 of file KDChartGridAttributes.cpp.

References d.

00142 {
00143     d->stepWidth = stepWidth;
00144 }

void GridAttributes::setGridSubStepWidth ( qreal  subStepWidth = 0.0  ) 

Specifies the sub-step width to be used for calculating the grid sub-lines.

Parameters:
subStepWidth the sub-step width to be used. If this parameter is omitted (or set to Zero, resp.) the automatic calculation will be done, using the granularity sequence specified. This is the default.
See also:
gridSubStepWidth

Definition at line 172 of file KDChartGridAttributes.cpp.

References d.

00173 {
00174     d->subStepWidth = subStepWidth;
00175 }

void GridAttributes::setGridVisible ( bool  visible  ) 

Definition at line 113 of file KDChartGridAttributes.cpp.

References d.

00114 {
00115     d->visible = visible;
00116 }

void GridAttributes::setSubGridPen ( const QPen &  pen  ) 

Definition at line 256 of file KDChartGridAttributes.cpp.

References d.

00257 {
00258     d->subPen = pen;
00259     d->subPen.setCapStyle( Qt::FlatCap );
00260 }

void GridAttributes::setSubGridVisible ( bool  visible  ) 

Definition at line 246 of file KDChartGridAttributes.cpp.

References d.

00247 {
00248     d->subVisible = visible;
00249 }

void GridAttributes::setZeroLinePen ( const QPen &  pen  ) 

Definition at line 267 of file KDChartGridAttributes.cpp.

References d.

00268 {
00269     d->zeroPen = pen;
00270     d->zeroPen.setCapStyle( Qt::FlatCap );
00271 }

QPen GridAttributes::subGridPen (  )  const

Definition at line 262 of file KDChartGridAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00263 {
00264     return d->subPen;
00265 }

QPen GridAttributes::zeroLinePen (  )  const

Definition at line 273 of file KDChartGridAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00274 {
00275     return d->zeroPen;
00276 }


The documentation for this class was generated from the following files:
Generated on Thu Mar 4 23:25:54 2010 for KD Chart 2 by  doxygen 1.5.4