KDChart::LeveyJenningsDiagram Class Reference

#include <KDChartLeveyJenningsDiagram.h>

Inheritance diagram for KDChart::LeveyJenningsDiagram:

Inheritance graph
[legend]
Collaboration diagram for KDChart::LeveyJenningsDiagram:

Collaboration graph
[legend]

List of all members.


Detailed Description

LeveyDiagram defines a Levey Jennings chart.

It provides different subtypes which are set using setType.

Definition at line 49 of file KDChartLeveyJenningsDiagram.h.


Public Types

enum  LineType {
  Normal = 0,
  Stacked = 1,
  Percent = 2
}
enum  Symbol {
  OkDataPoint,
  NotOkDataPoint,
  LotChanged,
  SensorChanged,
  FluidicsPackChanged
}

Signals

void dataHidden ()
 This signal is emitted, when the hidden status of at least one data cell was (un)set.
void layoutChanged (AbstractDiagram *)
 Diagrams are supposed to emit this signal, when the layout of one of their element changes.
void modelsChanged ()
 This signal is emitted, when either the model or the AttributesModel is replaced.
void propertiesChanged ()
 Emitted upon change of a property of the Diagram.

Public Member Functions

virtual void addAxis (CartesianAxis *axis)
 Add the axis to the diagram.
bool allowOverlappingDataValueTexts () const
 
Returns:
Whether data value labels are allowed to overlap.

bool antiAliasing () const
 
Returns:
Whether anti-aliasing is to be used for rendering this diagram.

virtual AttributesModelattributesModel () const
 Returns the AttributesModel, that is used by this diagram.
virtual KDChart::CartesianAxisList axes () const
 
Returns:
a list of all axes added to the diagram

QBrush brush (const QModelIndex &index) const
 Retrieve the brush to be used, for painting the datapoint at the given index in the model.
QBrush brush (int dataset) const
 Retrieve the brush to be used for the given dataset.
QBrush brush () const
 Retrieve the brush to be used for painting datapoints globally.
float calculatedMeanValue () const
 Returns the calculated mean values over all QC values.
float calculatedStandardDeviation () const
 Returns the calculated standard deviation over all QC values.
bool centerDataPoints () const
 
Returns:
option set by setCenterDataPoints()

virtual LineDiagramclone () const
 Creates an exact copy of this diagram.
bool compare (const AbstractDiagram *other) const
 Returns true if both diagrams have the same settings.
bool compare (const AbstractCartesianDiagram *other) const
 Returns true if both diagrams have the same settings.
bool compare (const LineDiagram *other) const
 Returns true if both diagrams have the same settings.
bool compare (const LeveyJenningsDiagram *other) const
 Returns true if both diagrams have the same settings.
AbstractCoordinatePlanecoordinatePlane () const
 The coordinate plane associated with the diagram.
const QPair< QPointF, QPointF > dataBoundaries () const
 Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values).
virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 [reimplemented]
QList< QBrush > datasetBrushes () const
 The set of dataset brushes currently used, for use in legends, etc.
int datasetDimension () const
 The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to have.
QStringList datasetLabels () const
 The set of dataset labels currently displayed, for use in legends, etc.
QList< MarkerAttributesdatasetMarkers () const
 The set of dataset markers currently used, for use in legends, etc.
QList< QPen > datasetPens () const
 The set of dataset pens currently used, for use in legends, etc.
DataValueAttributes dataValueAttributes (const QModelIndex &index) const
 Retrieve the DataValueAttributes for the given index.
DataValueAttributes dataValueAttributes (int dataset) const
 Retrieve the DataValueAttributes for the given dataset.
DataValueAttributes dataValueAttributes () const
 Retrieve the DataValueAttributes specified globally.
virtual void doItemsLayout ()
 [reimplemented]
float expectedMeanValue () const
 Returns the expected mean values over all QC values.
float expectedStandardDeviation () const
 Returns the expected standard deviation over all QC values.
Qt::Alignment fluidicsPackChangedSymbolPosition () const
 Returns the position of the fluidics pack changed symbol.
QVector< QDateTime > fluidicsPackChanges () const
 Returns the list of all fluidics pack changes.
virtual int horizontalOffset () const
 [reimplemented]
virtual QModelIndex indexAt (const QPoint &point) const
 [reimplemented]
QModelIndexList indexesAt (const QPoint &point) const
 This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot.
bool isHidden (const QModelIndex &index) const
 Retrieve the hidden status for the given index.
bool isHidden (int dataset) const
 Retrieve the hidden status for the given dataset.
bool isHidden () const
 Retrieve the hidden status specified globally.
virtual bool isIndexHidden (const QModelIndex &index) const
 [reimplemented]
QStringList itemRowLabels () const
 The set of item row labels currently displayed, for use in Abscissa axes, etc.
virtual void layoutPlanes ()
 Triggers layouting of all coordinate planes on the current chart.
 LeveyJenningsDiagram (QWidget *parent=0, LeveyJenningsCoordinatePlane *plane=0)
LineAttributes lineAttributes (const QModelIndex &index) const
 
Returns:
the line attribute set of the model index index

LineAttributes lineAttributes (int column) const
 
Returns:
the line attribute set of data set column

LineAttributes lineAttributes () const
 
Returns:
the global line attribute set

Qt::Alignment lotChangedSymbolPosition () const
 Returns the position of the lot change symbol.
virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
 [reimplemented]
const int numberOfAbscissaSegments () const
const int numberOfOrdinateSegments () const
void paintDataValueText (QPainter *painter, const QModelIndex &index, const QPointF &pos, double value)
void paintMarker (QPainter *painter, const QModelIndex &index, const QPointF &pos)
void paintMarker (QPainter *painter, const DataValueAttributes &a, const QModelIndex &index, const QPointF &pos)
virtual void paintMarker (QPainter *painter, const MarkerAttributes &markerAttributes, const QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
QPen pen (const QModelIndex &index) const
 Retrieve the pen to be used, for painting the datapoint at the given index in the model.
QPen pen (int dataset) const
 Retrieve the pen to be used for the given dataset.
QPen pen () const
 Retrieve the pen to be used for painting datapoints globally.
bool percentMode () const
virtual AbstractCartesianDiagramreferenceDiagram () const
 
Returns:
this diagram's reference diagram

virtual QPointF referenceDiagramOffset () const
 
Returns:
the relative offset of this diagram's reference diagram

void resetLineAttributes (const QModelIndex &index)
 Remove any explicit line attributes settings that might have been specified before.
void resetLineAttributes (int column)
 Resets the line attributes of data set column.
void resize (const QSizeF &area)
 Called by the widget's sizeEvent.
QPen scanLinePen () const
 Returns the pen being used for drawing the scan line.
virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)
 [reimplemented]
Qt::Alignment sensorChangedSymbolPosition () const
 Returns the position of the sensor changed symbol.
QVector< QDateTime > sensorChanges () const
 Returns the list of all sensor changes.
void setAllowOverlappingDataValueTexts (bool allow)
 Set whether data value labels are allowed to overlap.
void setAntiAliasing (bool enabled)
 Set whether anti-aliasing is to be used while rendering this diagram.
void setAttributesModel (AttributesModel *model)
 Associate an AttributesModel with this diagram.
void setBrush (const QBrush &brush)
 Set the brush to be used, for painting all datasets in the model.
void setBrush (int dataset, const QBrush &brush)
 Set the brush to be used, for painting the given dataset.
void setBrush (const QModelIndex &index, const QBrush &brush)
 Set the brush to be used, for painting the datapoint at the given index.
void setCenterDataPoints (bool center)
 If centerDataPoints() is true, all data points are moved by an offset of 0.5 to the right.
virtual void setCoordinatePlane (AbstractCoordinatePlane *plane)
 [reimplemented]
void setDatasetDimension (int dimension)
 
void setDataValueAttributes (const DataValueAttributes &a)
 Set the DataValueAttributes for all datapoints in the model.
void setDataValueAttributes (int dataset, const DataValueAttributes &a)
 Set the DataValueAttributes for the given dataset.
void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)
 Set the DataValueAttributes for the given index.
void setExpectedMeanValue (float meanValue)
 Sets the expected mean value over all QC values to meanValue.
void setExpectedStandardDeviation (float sd)
 Sets the expected standard deviaction over all QC values to sd.
void setFluidicsPackChangedSymbolPosition (Qt::Alignment pos)
 Sets the position of the fluidics pack changed symbol to pos.
void setFluidicsPackChanges (const QVector< QDateTime > &changes)
 Sets the date/time of all fluidics pack changes to changes.
void setHidden (bool hidden)
 Hide (or unhide, resp.
void setHidden (int dataset, bool hidden)
 Hide (or unhide, resp.
void setHidden (const QModelIndex &index, bool hidden)
 Hide (or unhide, resp.
void setLineAttributes (const QModelIndex &index, const LineAttributes &a)
 Sets the line attributes for the model index index to la.
void setLineAttributes (int column, const LineAttributes &a)
 Sets the line attributes of data set column to la.
void setLineAttributes (const LineAttributes &a)
 Sets the global line attributes to la.
void setLotChangedSymbolPosition (Qt::Alignment pos)
 Sets the position of the lot change symbol to pos.
void setModel (QAbstractItemModel *model)
 Associate a model with the diagram.
void setPen (const QPen &pen)
 Set the pen to be used, for painting all datasets in the model.
void setPen (int dataset, const QPen &pen)
 Set the pen to be used, for painting the given dataset.
void setPen (const QModelIndex &index, const QPen &pen)
 Set the pen to be used, for painting the datapoint at the given index.
void setPercentMode (bool percent)
virtual void setReferenceDiagram (AbstractCartesianDiagram *diagram, const QPointF &offset=QPointF())
 Makes this diagram use another diagram diagram as reference diagram with relative offset offset.
void setRootIndex (const QModelIndex &index)
 Set the root index in the model, where the diagram starts referencing data for display.
void setScanLinePen (const QPen &pen)
 Sets the pen used for drawing the scan line to pen.
virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)
 [reimplemented]
virtual void setSelectionModel (QItemSelectionModel *selectionModel)
 Associate a seleection model with the diagrom.
void setSensorChangedSymbolPosition (Qt::Alignment pos)
 Sets the position of the sensor changed symbol to pos.
void setSensorChanges (const QVector< QDateTime > &changes)
 Sets the date/time of all sensor changes to changes.
void setSymbol (Symbol symbol, const QString &filename)
 Sets the symbol being used for symbol to a SVG file filename.
void setThreeDLineAttributes (const QModelIndex &index, const ThreeDLineAttributes &a)
 Sets the 3D line attributes of model index index to la.
void setThreeDLineAttributes (int column, const ThreeDLineAttributes &a)
 Sets the 3D line attributes of data set column to ta.
void setThreeDLineAttributes (const ThreeDLineAttributes &a)
 Sets the global 3D line attributes to la.
void setTimeRange (const QPair< QDateTime, QDateTime > &timeRange)
 Sets the timeRange visible on the x axis.
void setType (const LineType type)
 Sets the line diagram's type to type.
void setUnitPrefix (const QString &prefix, Qt::Orientation orientation)
 Set the unit prefix to be used on axes for all columns.
void setUnitPrefix (const QString &prefix, int column, Qt::Orientation orientation)
 Set the unit prefix to be used on axes for one specific column.
void setUnitSuffix (const QString &suffix, Qt::Orientation orientation)
 Set the unit prefix to be used on axes for all columns.
void setUnitSuffix (const QString &suffix, int column, Qt::Orientation orientation)
 Set the unit prefix to be used on axes for one specific column.
void setValueTrackerAttributes (const QModelIndex &index, const ValueTrackerAttributes &a)
 Sets the value tracker attributes of the model index index to va.
QString symbol (Symbol symbol) const
 Returns the SVG file name usef for symbol.
virtual void takeAxis (CartesianAxis *axis)
 Removes the axis from the diagram, without deleting it.
ThreeDLineAttributes threeDLineAttributes (const QModelIndex &index) const
 
Returns:
the 3D line attributes of the model index index

ThreeDLineAttributes threeDLineAttributes (int column) const
 
Returns:
the 3D line attributes of data set column

ThreeDLineAttributes threeDLineAttributes () const
 
Returns:
the global 3D line attributes

QPair< QDateTime, QDateTime > timeRange () const
 Returns the timerange of the diagram's data.
LineType type () const
 
Returns:
the type of the line diagram

QString unitPrefix (Qt::Orientation orientation) const
 Retrieves the axis unit prefix.
QString unitPrefix (int column, Qt::Orientation orientation, bool fallback=false) const
 Retrieves the axis unit prefix for a specific column.
QString unitSuffix (Qt::Orientation orientation) const
 Retrieves the axis unit suffix.
QString unitSuffix (int column, Qt::Orientation orientation, bool fallback=false) const
 Retrieves the axis unit suffix for a specific column.
void update () const
void useDefaultColors ()
 Set the palette to be used, for painting datasets to the default palette.
void useRainbowColors ()
 Set the palette to be used, for painting datasets to the rainbow palette.
virtual bool usesExternalAttributesModel () const
 Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel.
void useSubduedColors ()
 Set the palette to be used, for painting datasets to the subdued palette.
ValueTrackerAttributes valueTrackerAttributes (const QModelIndex &index) const
 Returns the value tracker attributes of the model index index.
virtual int verticalOffset () const
 [reimplemented]
virtual QRect visualRect (const QModelIndex &index) const
 [reimplemented]
virtual QRegion visualRegion (const QModelIndex &index) const
virtual QRegion visualRegionForSelection (const QItemSelection &selection) const
 [reimplemented]
virtual ~LeveyJenningsDiagram ()

Protected Slots

void calculateMeanAndStandardDeviation () const
void setDataBoundariesDirty () const

Protected Member Functions

QModelIndex attributesModelRootIndex () const
const QPair< QPointF, QPointF > calculateDataBoundaries () const
 [reimplemented]
virtual bool checkInvariants (bool justReturnTheStatus=false) const
void drawChanges (PaintContext *paintContext)
 Draws the fluidics pack and sensor changed symbols.
virtual void drawDataPointSymbol (PaintContext *paintContext, const QPointF &pos, bool ok)
 Draws a data point symbol for the data point at pos.
virtual void drawFluidicsPackChangedSymbol (PaintContext *paintContext, const QPointF &pos)
 Draws a fluidics pack changed symbol for the data point at pos.
virtual void drawLotChangeSymbol (PaintContext *paintContext, const QPointF &pos)
 Draws a lot changed symbol for the data point at pos.
virtual void drawSensorChangedSymbol (PaintContext *paintContext, const QPointF &pos)
 Draws a sensor changed symbol for the data point at pos.
LineAttributes::MissingValuesPolicy getCellValues (int row, int column, bool shiftCountedXValuesByHalfSection, double &valueX, double &valueY) const
virtual QRectF iconRect () const
 Returns the rectangle being used for drawing the icons.
QSvgRenderer * iconRenderer (Symbol symbol)
 Returns the SVG icon renderer for symbol.
void paint (PaintContext *paintContext)
 [reimplemented]
virtual void paintDataValueTexts (QPainter *painter)
 This method is obsolete and provided for backward-compatibility only.
void paintEvent (QPaintEvent *)
virtual void paintMarkers (QPainter *painter)
 This method is obsolete and provided for backward-compatibility only.
void resizeEvent (QResizeEvent *)
void setAttributesModelRootIndex (const QModelIndex &)
void setDatasetDimensionInternal (int dimension)
virtual double threeDItemDepth (int column) const
 
Returns:
the 3D item depth of the data set column

virtual double threeDItemDepth (const QModelIndex &index) const
 
Returns:
the 3D item depth of the model index index

double valueForCell (int row, int column) const
 Helper method, retrieving the data value (DisplayRole) for a given row and column.
double valueForCellTesting (int row, int column, bool &bOK, bool showHiddenCellsAsInvalid=false) const

Member Enumeration Documentation

enum KDChart::LineDiagram::LineType [inherited]

Enumerator:
Normal 
Stacked 
Percent 

Definition at line 73 of file KDChartLineDiagram.h.

00073                   {
00074         Normal =  0,
00075         Stacked = 1,
00076         Percent = 2
00077     };

enum KDChart::LeveyJenningsDiagram::Symbol

Enumerator:
OkDataPoint 
NotOkDataPoint 
LotChanged 
SensorChanged 
FluidicsPackChanged 

Definition at line 65 of file KDChartLeveyJenningsDiagram.h.

00066     {
00067         OkDataPoint,
00068         NotOkDataPoint,
00069         LotChanged,
00070         SensorChanged,
00071         FluidicsPackChanged
00072     };


Constructor & Destructor Documentation

LeveyJenningsDiagram::LeveyJenningsDiagram ( QWidget parent = 0,
LeveyJenningsCoordinatePlane plane = 0 
) [explicit]

Definition at line 54 of file KDChartLeveyJenningsDiagram.cpp.

References StockDiagram::init().

Referenced by clone().

00055     : LineDiagram( new Private(), parent, plane )
00056 {
00057     init();
00058 }

LeveyJenningsDiagram::~LeveyJenningsDiagram (  )  [virtual]

Definition at line 83 of file KDChartLeveyJenningsDiagram.cpp.

00084 {
00085 }


Member Function Documentation

void AbstractCartesianDiagram::addAxis ( CartesianAxis axis  )  [virtual, inherited]

Add the axis to the diagram.

The diagram takes ownership of the axis and will delete it.

To gain back ownership (e.g. for assigning the axis to another diagram) use the takeAxis method, before calling addAxis on the other diagram.

See also:
takeAxis

Definition at line 92 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractAxis::createObserver(), d, and KDChart::AbstractCartesianDiagram::layoutPlanes().

00093 {
00094     if ( !d->axesList.contains( axis ) ) {
00095         d->axesList.append( axis );
00096         axis->createObserver( this );
00097         layoutPlanes();
00098     }
00099 }

bool AbstractDiagram::allowOverlappingDataValueTexts (  )  const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 511 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::compare().

00512 {
00513     return d->allowOverlappingDataValueTexts;
00514 }

bool AbstractDiagram::antiAliasing (  )  const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 522 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::compare().

00523 {
00524     return d->antiAliasing;
00525 }

AttributesModel * AbstractDiagram::attributesModel (  )  const [virtual, inherited]

Returns the AttributesModel, that is used by this diagram.

By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.
See also:
setAttributesModel
Returns:
a pointer to the AttributesModel currently used by this diagram.

Definition at line 315 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::brush(), StockDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::compare(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::dataValueAttributes(), StockDiagram::init(), KDChart::AbstractDiagram::isHidden(), KDChart::AbstractDiagram::itemRowLabels(), StockDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::pen(), KDChart::AbstractCartesianDiagram::setAttributesModel(), KDChart::BarDiagram::setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractCartesianDiagram::setCoordinatePlane(), KDChart::AbstractCartesianDiagram::setModel(), KDChart::AbstractDiagram::setPen(), KDChart::AbstractCartesianDiagram::setRootIndex(), StockDiagram::setStockBarAttributes(), StockDiagram::setThreeDBarAttributes(), StockDiagram::stockBarAttributes(), KDChart::TernaryLineDiagram::TernaryLineDiagram(), and StockDiagram::threeDBarAttributes().

00316 {
00317     return d->attributesModel;
00318 }

QModelIndex AbstractDiagram::attributesModelRootIndex (  )  const [protected, inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.

Definition at line 345 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by StockDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::itemRowLabels(), KDChart::Plotter::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::BarDiagram::numberOfAbscissaSegments(), KDChart::Plotter::numberOfOrdinateSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(), KDChart::BarDiagram::numberOfOrdinateSegments(), StockDiagram::paint(), KDChart::AbstractDiagram::valueForCell(), and KDChart::LineDiagram::valueForCellTesting().

00346 {
00347     if ( !d->attributesModelRootIndex.isValid() )
00348         d->attributesModelRootIndex = d->attributesModel->mapFromSource( rootIndex() );
00349     return d->attributesModelRootIndex;
00350 }

KDChart::CartesianAxisList AbstractCartesianDiagram::axes (  )  const [virtual, inherited]

Returns:
a list of all axes added to the diagram

Definition at line 111 of file KDChartAbstractCartesianDiagram.cpp.

References d.

Referenced by KDChart::Widget::setType(), and KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().

00112 {
00113     return d->axesList;
00114 }

QBrush AbstractDiagram::brush ( const QModelIndex &  index  )  const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model. With a dataset dimension of two, this is the index of the key of each key/value pair.
Returns:
The brush to use for painting.

Definition at line 850 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetBrushRole.

00851 {
00852     return qVariantValue<QBrush>(
00853         attributesModel()->data( conditionallyMapFromSource( index ), DatasetBrushRole ) );
00854 }

QBrush AbstractDiagram::brush ( int  dataset  )  const [inherited]

Retrieve the brush to be used for the given dataset.

This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.
Returns:
The brush to use for painting.

Definition at line 835 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::brush(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().

00836 {
00837     // To store the brush for a dataset, we use the first column
00838     // that's associated with it. (i.e., with a dataset dimension
00839     // of two, the column of the keys)
00840     const int column = dataset * datasetDimension();
00841     
00842     const QVariant brushSettings(
00843             attributesModel()->headerData( column, Qt::Vertical,
00844                     DatasetBrushRole ) );
00845     if( brushSettings.isValid() )
00846         return qVariantValue< QBrush >( brushSettings );
00847     return brush();
00848 }

QBrush AbstractDiagram::brush (  )  const [inherited]

Retrieve the brush to be used for painting datapoints globally.

This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 829 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetBrushRole.

Referenced by KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

00830 {
00831     return qVariantValue<QBrush>(
00832         attributesModel()->data( DatasetBrushRole ) );
00833 }

const QPair< QPointF, QPointF > LeveyJenningsDiagram::calculateDataBoundaries (  )  const [protected, virtual]

[reimplemented]

Reimplemented from KDChart::LineDiagram.

Definition at line 426 of file KDChartLeveyJenningsDiagram.cpp.

References d, and timeRange().

00427 {
00428     const double yMin = d->expectedMeanValue - 4 * d->expectedStandardDeviation;
00429     const double yMax = d->expectedMeanValue + 4 * d->expectedStandardDeviation;
00430 
00431     d->setYAxisRange();
00432 
00433     // rounded down/up to the prev/next midnight (at least that's the default)
00434     const QPair< QDateTime, QDateTime > range = timeRange();
00435     const unsigned int minTime = range.first.toTime_t();
00436     const unsigned int maxTime = range.second.toTime_t();
00437 
00438     const double xMin = minTime / static_cast< double >( 24 * 60 * 60 );
00439     const double xMax = maxTime / static_cast< double >( 24 * 60 * 60 ) - xMin;
00440 
00441     const QPointF bottomLeft( QPointF( 0, yMin ) );
00442     const QPointF topRight( QPointF( xMax, yMax ) );
00443 
00444     return QPair< QPointF, QPointF >( bottomLeft, topRight );
00445 }

float LeveyJenningsDiagram::calculatedMeanValue (  )  const

Returns the calculated mean values over all QC values.

Definition at line 303 of file KDChartLeveyJenningsDiagram.cpp.

References d.

Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate().

00304 {
00305     return d->calculatedMeanValue;
00306 }

float LeveyJenningsDiagram::calculatedStandardDeviation (  )  const

Returns the calculated standard deviation over all QC values.

Definition at line 311 of file KDChartLeveyJenningsDiagram.cpp.

References d.

Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate().

00312 {
00313     return d->calculatedStandardDeviation;
00314 }

void LeveyJenningsDiagram::calculateMeanAndStandardDeviation (  )  const [protected, slot]

Definition at line 359 of file KDChartLeveyJenningsDiagram.cpp.

References d, and m.

Referenced by setModel().

00360 {
00361     QVector< double > values;
00362     // first fetch all values
00363     const QAbstractItemModel& m = *model();
00364     const int rowCount = m.rowCount( rootIndex() );
00365 
00366     for( int row = 0; row < rowCount; ++row )
00367     {
00368         const QVariant var = m.data( m.index( row, 1, rootIndex() ) );
00369         if( !var.isValid() )
00370             continue;
00371         const double value = var.toDouble();
00372         if( ISNAN( value ) )
00373             continue;
00374         values << value;
00375     }
00376 
00377     double sum = 0.0;
00378     double sumSquares = 0.0;
00379     KDAB_FOREACH( double value, values )
00380     {
00381         sum += value;
00382         sumSquares += value * value;
00383     }
00384 
00385     const int N = values.count();
00386 
00387     d->calculatedMeanValue = sum / N;
00388     d->calculatedStandardDeviation = sqrt( ( static_cast< double >( N ) * sumSquares - sum * sum ) / ( N * ( N - 1 ) ) );
00389 }

bool LineDiagram::centerDataPoints (  )  const [inherited]

Returns:
option set by setCenterDataPoints()

Definition at line 161 of file KDChartLineDiagram.cpp.

References d.

Referenced by KDChart::LineDiagram::compare(), and referenceDiagramNeedsCenteredAbscissaTicks().

00162 {
00163         return d->centerDataPoints;
00164 }

bool AbstractDiagram::checkInvariants ( bool  justReturnTheStatus = false  )  const [protected, virtual, inherited]

Definition at line 1077 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::coordinatePlane().

Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), KDChart::Plotter::calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Plotter::paint(), KDChart::LineDiagram::paint(), paint(), KDChart::BarDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::PieDiagram::paintInternal(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().

01078 {
01079     if( ! justReturnTheStatus ){
01080         Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
01081                     "There is no usable model set, for the diagram." );
01082 
01083         Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
01084                     "There is no usable coordinate plane set, for the diagram." );
01085     }
01086     return model() && coordinatePlane();
01087 }

LineDiagram * LeveyJenningsDiagram::clone (  )  const [virtual]

Creates an exact copy of this diagram.

Reimplemented from KDChart::LineDiagram.

Definition at line 90 of file KDChartLeveyJenningsDiagram.cpp.

References d, LeveyJenningsDiagram(), and StockDiagram::Private::Private().

00091 {
00092     LeveyJenningsDiagram* newDiagram = new LeveyJenningsDiagram( new Private( *d ) );
00093     return newDiagram;
00094 }

bool AbstractDiagram::compare ( const AbstractDiagram other  )  const [inherited]

Returns true if both diagrams have the same settings.

Definition at line 131 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::allowOverlappingDataValueTexts(), KDChart::AbstractDiagram::antiAliasing(), KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::compare(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::percentMode().

00132 {
00133     if( other == this ) return true;
00134     if( ! other ){
00135         //qDebug() << "AbstractDiagram::compare() cannot compare to Null pointer";
00136         return false;
00137     }
00138     /*
00139     qDebug() << "\n             AbstractDiagram::compare() QAbstractScrollArea:";
00140             // compare QAbstractScrollArea properties
00141     qDebug() <<
00142             ((horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) &&
00143             (verticalScrollBarPolicy()    == other->verticalScrollBarPolicy()));
00144     qDebug() << "AbstractDiagram::compare() QFrame:";
00145             // compare QFrame properties
00146     qDebug() <<
00147             ((frameShadow() == other->frameShadow()) &&
00148             (frameShape()   == other->frameShape()) &&
00149             (frameWidth()   == other->frameWidth()) &&
00150             (lineWidth()    == other->lineWidth()) &&
00151             (midLineWidth() == other->midLineWidth()));
00152     qDebug() << "AbstractDiagram::compare() QAbstractItemView:";
00153             // compare QAbstractItemView properties
00154     qDebug() <<
00155             ((alternatingRowColors() == other->alternatingRowColors()) &&
00156             (hasAutoScroll()         == other->hasAutoScroll()) &&
00157 #if QT_VERSION > 0x040199
00158             (dragDropMode()          == other->dragDropMode()) &&
00159             (dragDropOverwriteMode() == other->dragDropOverwriteMode()) &&
00160             (horizontalScrollMode()  == other->horizontalScrollMode ()) &&
00161             (verticalScrollMode()    == other->verticalScrollMode()) &&
00162 #endif
00163             (dragEnabled()           == other->dragEnabled()) &&
00164             (editTriggers()          == other->editTriggers()) &&
00165             (iconSize()              == other->iconSize()) &&
00166             (selectionBehavior()     == other->selectionBehavior()) &&
00167             (selectionMode()         == other->selectionMode()) &&
00168             (showDropIndicator()     == other->showDropIndicator()) &&
00169             (tabKeyNavigation()      == other->tabKeyNavigation()) &&
00170             (textElideMode()         == other->textElideMode()));
00171     qDebug() << "AbstractDiagram::compare() AttributesModel: ";
00172             // compare all of the properties stored in the attributes model
00173     qDebug() << attributesModel()->compare( other->attributesModel() );
00174     qDebug() << "AbstractDiagram::compare() own:";
00175             // compare own properties
00176     qDebug() <<
00177             ((rootIndex().column()            == other->rootIndex().column()) &&
00178             (rootIndex().row()                == other->rootIndex().row()) &&
00179             (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) &&
00180             (antiAliasing()                   == other->antiAliasing()) &&
00181             (percentMode()                    == other->percentMode()) &&
00182             (datasetDimension()               == other->datasetDimension()));
00183     */
00184     return  // compare QAbstractScrollArea properties
00185             (horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) &&
00186             (verticalScrollBarPolicy()   == other->verticalScrollBarPolicy()) &&
00187             // compare QFrame properties
00188             (frameShadow()  == other->frameShadow()) &&
00189             (frameShape()   == other->frameShape()) &&
00190 // frameWidth is a read-only property defined by the style, it should not be in here:
00191             // (frameWidth()   == other->frameWidth()) &&
00192             (lineWidth()    == other->lineWidth()) &&
00193             (midLineWidth() == other->midLineWidth()) &&
00194             // compare QAbstractItemView properties
00195             (alternatingRowColors()  == other->alternatingRowColors()) &&
00196             (hasAutoScroll()         == other->hasAutoScroll()) &&
00197 #if QT_VERSION > 0x040199
00198             (dragDropMode()          == other->dragDropMode()) &&
00199             (dragDropOverwriteMode() == other->dragDropOverwriteMode()) &&
00200             (horizontalScrollMode()  == other->horizontalScrollMode ()) &&
00201             (verticalScrollMode()    == other->verticalScrollMode()) &&
00202 #endif
00203             (dragEnabled()           == other->dragEnabled()) &&
00204             (editTriggers()          == other->editTriggers()) &&
00205             (iconSize()              == other->iconSize()) &&
00206             (selectionBehavior()     == other->selectionBehavior()) &&
00207             (selectionMode()         == other->selectionMode()) &&
00208             (showDropIndicator()     == other->showDropIndicator()) &&
00209             (tabKeyNavigation()      == other->tabKeyNavigation()) &&
00210             (textElideMode()         == other->textElideMode()) &&
00211             // compare all of the properties stored in the attributes model
00212             attributesModel()->compare( other->attributesModel() ) &&
00213             // compare own properties
00214             (rootIndex().column()             == other->rootIndex().column()) &&
00215             (rootIndex().row()                == other->rootIndex().row()) &&
00216             (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) &&
00217             (antiAliasing()                   == other->antiAliasing()) &&
00218             (percentMode()                    == other->percentMode()) &&
00219             (datasetDimension()               == other->datasetDimension());
00220 }

bool AbstractCartesianDiagram::compare ( const AbstractCartesianDiagram other  )  const [inherited]

Returns true if both diagrams have the same settings.

Definition at line 47 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractCartesianDiagram::referenceDiagram(), and KDChart::AbstractCartesianDiagram::referenceDiagramOffset().

00048 {
00049     if( other == this ) return true;
00050     if( ! other ){
00051         //qDebug() << "AbstractCartesianDiagram::compare() cannot compare to Null pointer";
00052         return false;
00053     }
00054     /*
00055     qDebug() << "\n             AbstractCartesianDiagram::compare():";
00056             // compare own properties
00057     qDebug() <<
00058             ((referenceDiagram() == other->referenceDiagram()) &&
00059             ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset())));
00060     */
00061     return  // compare the base class
00062             ( static_cast<const AbstractDiagram*>(this)->compare( other ) ) &&
00063             // compare own properties
00064             (referenceDiagram() == other->referenceDiagram()) &&
00065             ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset()));
00066 }

bool LineDiagram::compare ( const LineDiagram other  )  const [inherited]

Returns true if both diagrams have the same settings.

Definition at line 93 of file KDChartLineDiagram.cpp.

References KDChart::LineDiagram::centerDataPoints(), and KDChart::LineDiagram::type().

00094 {
00095     if( other == this ) return true;
00096     if( ! other ){
00097         return false;
00098     }
00099     /*
00100     qDebug() <<"\n             LineDiagram::compare():";
00101             // compare own properties
00102     qDebug() << (type() == other->type());
00103     */
00104     return  // compare the base class
00105             ( static_cast<const AbstractCartesianDiagram*>(this)->compare( other ) ) &&
00106             // compare own properties
00107             (type()             == other->type()) &&
00108             (centerDataPoints() == other->centerDataPoints());
00109 }

bool LeveyJenningsDiagram::compare ( const LeveyJenningsDiagram other  )  const

Returns true if both diagrams have the same settings.

Definition at line 96 of file KDChartLeveyJenningsDiagram.cpp.

00097 {
00098     if( other == this ) return true;
00099     if( ! other ){
00100         return false;
00101     }
00102     /*
00103     qDebug() <<"\n             LineDiagram::compare():";
00104             // compare own properties
00105     qDebug() << (type() == other->type());
00106     */
00107     return  // compare the base class
00108             ( static_cast<const LineDiagram*>(this)->compare( other ) );
00109 }

AbstractCoordinatePlane * AbstractDiagram::coordinatePlane (  )  const [inherited]

The coordinate plane associated with the diagram.

This determines how coordinates in value space are mapped into pixel space. By default this is a CartesianCoordinatePlane.

Returns:
The coordinate plane associated with the diagram.

Definition at line 222 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::checkInvariants(), iconRect(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), StockDiagram::resize(), KDChart::Plotter::resize(), KDChart::LineDiagram::resize(), KDChart::BarDiagram::resize(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().

00223 {
00224     return d->plane;
00225 }

const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries (  )  const [inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values).

This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they can call setDataBoundariesDirty()

Returned value is in diagram coordinates.

Definition at line 227 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.

Referenced by KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::Plotter::paint(), KDChart::LineDiagram::paint(), paint(), and KDChart::BarDiagram::paint().

00228 {
00229     if( d->databoundariesDirty ){
00230         d->databoundaries = calculateDataBoundaries ();
00231         d->databoundariesDirty = false;
00232     }
00233     return d->databoundaries;
00234 }

void AbstractDiagram::dataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
) [virtual, inherited]

[reimplemented]

Definition at line 366 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::setDataBoundariesDirty().

Referenced by setModel().

00368 {
00369     Q_UNUSED( topLeft );
00370     Q_UNUSED( bottomRight );
00371     // We are still too dumb to do intelligent updates...
00372     setDataBoundariesDirty();
00373     scheduleDelayedItemsLayout();
00374 }

void KDChart::AbstractDiagram::dataHidden (  )  [signal, inherited]

This signal is emitted, when the hidden status of at least one data cell was (un)set.

Referenced by KDChart::AbstractDiagram::setHidden().

QList< QBrush > AbstractDiagram::datasetBrushes (  )  const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check these too, in order to find the brush, that is used for a single cell.
Returns:
The current set of dataset brushes.

Definition at line 1038 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AbstractDiagram::brush(), KDChart::AttributesModel::columnCount(), and KDChart::AbstractDiagram::datasetDimension().

Referenced by KDChart::Legend::datasetCount(), and KDChart::Legend::setBrushesFromDiagram().

01039 {
01040     QList<QBrush> ret;
01041     if( model() == 0 )
01042         return ret;
01043 
01044     const int datasetCount = attributesModel()->columnCount(attributesModelRootIndex()) / datasetDimension();
01045     for ( int dataset = 0; dataset < datasetCount; dataset++ )
01046         ret << brush( dataset );
01047 
01048     return ret;
01049 }

int AbstractDiagram::datasetDimension (  )  const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to have.

For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic values will be used for the abscissa.

For example a diagram with the default dimension of 1, will have one column per datapoint (the y values) and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y values.

Returns:
The dataset dimension of the diagram.

Definition at line 1089 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::compare(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::LineDiagram::getCellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::AbstractDiagram::isHidden(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractDiagram::pen(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::AbstractDiagram::setHidden(), KDChart::AbstractDiagram::setPen(), KDChart::Plotter::setType(), and KDChart::LineDiagram::setType().

01090 {
01091     return d->datasetDimension;
01092 }

QStringList AbstractDiagram::datasetLabels (  )  const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 1025 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AttributesModel::headerData().

Referenced by KDChart::Legend::datasetCount().

01026 {
01027     QStringList ret;
01028     if( model() == 0 )
01029         return ret;
01030     
01031     const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
01032     for( int i = 0; i < columnCount; i += datasetDimension() )
01033         ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();
01034     
01035     return ret;
01036 }

QList< MarkerAttributes > AbstractDiagram::datasetMarkers (  )  const [inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check these too, in order to find the marker, that is shown for a single cell.
Returns:
The current set of dataset brushes.

Definition at line 1064 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::dataValueAttributes(), and KDChart::DataValueAttributes::markerAttributes().

01065 {
01066     QList<MarkerAttributes> ret;
01067     if( model() == 0 )
01068         return ret;
01069     
01070     const int datasetCount = attributesModel()->columnCount(attributesModelRootIndex()) / datasetDimension();
01071     for ( int dataset = 0; dataset < datasetCount; dataset++ )
01072         ret << dataValueAttributes( dataset ).markerAttributes();
01073 
01074     return ret;
01075 }

QList< QPen > AbstractDiagram::datasetPens (  )  const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check these too, in order to find the pens, that is used for a single cell.
Returns:
The current set of dataset pens.

Definition at line 1051 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::pen().

01052 {
01053     QList<QPen> ret;
01054     if( model() == 0 )
01055         return ret;
01056     
01057     const int datasetCount = attributesModel()->columnCount(attributesModelRootIndex()) / datasetDimension();
01058     for ( int dataset = 0; dataset < datasetCount; dataset++ )
01059         ret << pen( dataset );
01060     
01061     return ret;
01062 }

DataValueAttributes AbstractDiagram::dataValueAttributes ( const QModelIndex &  index  )  const [inherited]

Retrieve the DataValueAttributes for the given index.

This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific settings.

Parameters:
index The datapoint to retrieve the attributes for. With a dataset dimension of two, this is the index of the key of each key/value pair.
Returns:
The DataValueAttributes for the given index.

Definition at line 491 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataValueLabelAttributesRole.

00492 {
00493     return qVariantValue<DataValueAttributes>(
00494         attributesModel()->data(
00495             conditionallyMapFromSource( index ),
00496             KDChart::DataValueLabelAttributesRole ) );
00497 }

DataValueAttributes AbstractDiagram::dataValueAttributes ( int  dataset  )  const [inherited]

Retrieve the DataValueAttributes for the given dataset.

This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the attributes for.
Returns:
The DataValueAttributes for the given dataset.

Definition at line 465 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::dataValueAttributes(), and KDChart::DataValueLabelAttributesRole.

00466 {
00467     /*
00468     The following did not work!
00469     (khz, 2008-01-25)
00470     If there was some attrs specified for the 0-th cells of a dataset,
00471     then this logic would return the cell's settings instead of the header settings:
00472 
00473     return qVariantValue<DataValueAttributes>(
00474         attributesModel()->data( attributesModel()->mapFromSource(columnToIndex( column )),
00475         KDChart::DataValueLabelAttributesRole ) );
00476     */
00477     
00478     // To store the attributes for a dataset, we use the first column
00479     // that's associated with it. (i.e., with a dataset dimension
00480     // of two, the column of the keys)
00481     const int column = dataset * datasetDimension();
00482 
00483     const QVariant headerAttrs(
00484             attributesModel()->headerData( column, Qt::Vertical,
00485                 KDChart::DataValueLabelAttributesRole ) );
00486     if( headerAttrs.isValid() )
00487         return qVariantValue< DataValueAttributes >( headerAttrs );
00488     return dataValueAttributes();
00489 }

DataValueAttributes AbstractDiagram::dataValueAttributes (  )  const [inherited]

Retrieve the DataValueAttributes specified globally.

This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 459 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DataValueLabelAttributesRole, and KDChart::AttributesModel::modelData().

Referenced by KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::AbstractDiagram::paintMarker(), and KDChart::TernaryLineDiagram::TernaryLineDiagram().

00460 {
00461     return qVariantValue<DataValueAttributes>(
00462         attributesModel()->modelData( KDChart::DataValueLabelAttributesRole ) );
00463 }

void AbstractDiagram::doItemsLayout (  )  [virtual, inherited]

[reimplemented]

Definition at line 357 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00358 {
00359     if ( d->plane ) {
00360         d->plane->layoutDiagrams();
00361         update();
00362     }
00363     QAbstractItemView::doItemsLayout();
00364 }

void LeveyJenningsDiagram::drawChanges ( PaintContext paintContext  )  [protected]

Draws the fluidics pack and sensor changed symbols.

Definition at line 496 of file KDChartLeveyJenningsDiagram.cpp.

References d, drawFluidicsPackChangedSymbol(), drawSensorChangedSymbol(), and timeRange().

Referenced by paint().

00497 {
00498     const unsigned int minTime = timeRange().first.toTime_t();
00499 
00500     KDAB_FOREACH( const QDateTime& dt, d->fluidicsPackChanges )
00501     {
00502         const double xValue = ( dt.toTime_t() - minTime ) / static_cast< double >( 24 * 60 * 60 );
00503         const QPointF point( xValue, 0.0 );
00504         drawFluidicsPackChangedSymbol( ctx, point );
00505     }
00506 
00507     KDAB_FOREACH( const QDateTime& dt, d->sensorChanges )
00508     {
00509         const double xValue = ( dt.toTime_t() - minTime ) / static_cast< double >( 24 * 60 * 60 );
00510         const QPointF point( xValue, 0.0 );
00511         drawSensorChangedSymbol( ctx, point );
00512     }
00513 }

void LeveyJenningsDiagram::drawDataPointSymbol ( PaintContext ctx,
const QPointF &  pos,
bool  ok 
) [protected, virtual]

Draws a data point symbol for the data point at pos.

Parameters:
ok True, when the data point is ok, false otherwise (different symbol)
ctx The PaintContext being used

Definition at line 640 of file KDChartLeveyJenningsDiagram.cpp.

References KDChart::PaintContext::coordinatePlane(), iconRect(), iconRenderer(), NotOkDataPoint, OkDataPoint, KDChart::PaintContext::painter(), KDChart::AbstractCoordinatePlane::translate(), and KDChart::LineDiagram::type().

Referenced by paint().

00641 {
00642     const Symbol type = ok ? OkDataPoint : NotOkDataPoint;
00643 
00644     QPainter* const painter = ctx->painter();
00645     const PainterSaver ps( painter );
00646     const QPointF transPos = ctx->coordinatePlane()->translate( pos ).toPoint();
00647     painter->translate( transPos );
00648 
00649     painter->setClipping( false );
00650     iconRenderer( type )->render( painter, iconRect() );
00651 }

void LeveyJenningsDiagram::drawFluidicsPackChangedSymbol ( PaintContext ctx,
const QPointF &  pos 
) [protected, virtual]

Draws a fluidics pack changed symbol for the data point at pos.

Parameters:
ctx The PaintContext being used
See also:
fluidicsPackChangedSymbolPosition

Definition at line 699 of file KDChartLeveyJenningsDiagram.cpp.

References KDChart::PaintContext::coordinatePlane(), d, FluidicsPackChanged, iconRect(), iconRenderer(), KDChart::PaintContext::painter(), and KDChart::AbstractCoordinatePlane::translate().

Referenced by drawChanges().

00700 {
00701     const QPointF transPos = ctx->coordinatePlane()->translate(
00702         QPointF( pos.x(), d->fluidicsPackChangedPosition & Qt::AlignTop ? d->expectedMeanValue +
00703                                                                           4 * d->expectedStandardDeviation
00704                                                                         : d->expectedMeanValue -
00705                                                                           4 * d->expectedStandardDeviation ) );
00706 
00707     QPainter* const painter = ctx->painter();
00708     const PainterSaver ps( painter );
00709     painter->setClipping( false );
00710     painter->translate( transPos );
00711     iconRenderer( FluidicsPackChanged )->render( painter, iconRect() );
00712 }

void LeveyJenningsDiagram::drawLotChangeSymbol ( PaintContext ctx,
const QPointF &  pos 
) [protected, virtual]

Draws a lot changed symbol for the data point at pos.

Parameters:
ctx The PaintContext being used
See also:
lotChangedSymbolPosition

Definition at line 658 of file KDChartLeveyJenningsDiagram.cpp.

References KDChart::PaintContext::coordinatePlane(), d, iconRect(), iconRenderer(), LotChanged, KDChart::PaintContext::painter(), and KDChart::AbstractCoordinatePlane::translate().

Referenced by paint().

00659 {
00660     const QPointF transPos = ctx->coordinatePlane()->translate(
00661         QPointF( pos.x(), d->lotChangedPosition & Qt::AlignTop ? d->expectedMeanValue +
00662                                                                  4 * d->expectedStandardDeviation
00663                                                                : d->expectedMeanValue -
00664                                                                  4 * d->expectedStandardDeviation ) );
00665 
00666 
00667     QPainter* const painter = ctx->painter();
00668     const PainterSaver ps( painter );
00669     painter->setClipping( false );
00670     painter->translate( transPos );
00671     iconRenderer( LotChanged )->render( painter, iconRect() );
00672 }

void LeveyJenningsDiagram::drawSensorChangedSymbol ( PaintContext ctx,
const QPointF &  pos 
) [protected, virtual]

Draws a sensor changed symbol for the data point at pos.

Parameters:
ctx The PaintContext being used
See also:
sensorChangedSymbolPosition

Definition at line 679 of file KDChartLeveyJenningsDiagram.cpp.

References KDChart::PaintContext::coordinatePlane(), d, iconRect(), iconRenderer(), KDChart::PaintContext::painter(), SensorChanged, and KDChart::AbstractCoordinatePlane::translate().

Referenced by drawChanges().

00680 {
00681     const QPointF transPos = ctx->coordinatePlane()->translate(
00682         QPointF( pos.x(), d->sensorChangedPosition & Qt::AlignTop ? d->expectedMeanValue +
00683                                                                     4 * d->expectedStandardDeviation
00684                                                                   : d->expectedMeanValue -
00685                                                                     4 * d->expectedStandardDeviation ) );
00686 
00687     QPainter* const painter = ctx->painter();
00688     const PainterSaver ps( painter );
00689     painter->setClipping( false );
00690     painter->translate( transPos );
00691     iconRenderer( SensorChanged )->render( painter, iconRect() );
00692 }

float LeveyJenningsDiagram::expectedMeanValue (  )  const

Returns the expected mean values over all QC values.

Definition at line 274 of file KDChartLeveyJenningsDiagram.cpp.

References d.

Referenced by paint(), and KDChart::LeveyJenningsAxis::paintAsOrdinate().

00275 {
00276     return d->expectedMeanValue;
00277 }

float LeveyJenningsDiagram::expectedStandardDeviation (  )  const

Returns the expected standard deviation over all QC values.

Definition at line 295 of file KDChartLeveyJenningsDiagram.cpp.

References d.

Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate().

00296 {
00297     return d->expectedStandardDeviation;
00298 }

Qt::Alignment LeveyJenningsDiagram::fluidicsPackChangedSymbolPosition (  )  const

Returns the position of the fluidics pack changed symbol.

Definition at line 148 of file KDChartLeveyJenningsDiagram.cpp.

References d.

00149 {
00150     return d->fluidicsPackChangedPosition;
00151 }

QVector< QDateTime > LeveyJenningsDiagram::fluidicsPackChanges (  )  const

Returns the list of all fluidics pack changes.

Definition at line 189 of file KDChartLeveyJenningsDiagram.cpp.

References d.

00190 {
00191     return d->fluidicsPackChanges;
00192 }

LineAttributes::MissingValuesPolicy LineDiagram::getCellValues ( int  row,
int  column,
bool  shiftCountedXValuesByHalfSection,
double &  valueX,
double &  valueY 
) const [protected, inherited]

Definition at line 417 of file KDChartLineDiagram.cpp.

References KDChart::AbstractDiagram::datasetDimension(), KDChart::LineDiagram::lineAttributes(), KDChart::LineAttributes::missingValuesPolicy(), KDChart::LineAttributes::MissingValuesPolicyIgnored, and KDChart::LineDiagram::valueForCellTesting().

00421 {
00422     LineAttributes::MissingValuesPolicy policy;
00423 
00424     bool bOK = true;
00425     valueX = ( datasetDimension() > 1 && column > 0 )
00426              ? valueForCellTesting( row, column-1, bOK, true )
00427              : ((shiftCountedXValuesByHalfSection ? 0.5 : 0.0) + row);
00428     if( bOK )
00429         valueY = valueForCellTesting( row, column, bOK, true );
00430     if( bOK ){
00431         policy = LineAttributes::MissingValuesPolicyIgnored;
00432     }else{
00433         // missing value: find out the policy
00434         QModelIndex index = model()->index( row, column, rootIndex() );
00435         LineAttributes la = lineAttributes( index );
00436         policy = la.missingValuesPolicy();
00437     }
00438     return policy;
00439 }

int AbstractDiagram::horizontalOffset (  )  const [virtual, inherited]

[reimplemented]

Definition at line 958 of file KDChartAbstractDiagram.cpp.

00959 { return 0; }

QRectF LeveyJenningsDiagram::iconRect (  )  const [protected, virtual]

Returns the rectangle being used for drawing the icons.

Definition at line 717 of file KDChartLeveyJenningsDiagram.cpp.

References KDChart::TextAttributes::calculatedFont(), KDChart::AbstractDiagram::coordinatePlane(), m, KDChartEnums::MeasureCalculationModeAuto, KDChartEnums::MeasureOrientationAuto, and KDChart::TextAttributes::setFontSize().

Referenced by drawDataPointSymbol(), drawFluidicsPackChangedSymbol(), drawLotChangeSymbol(), drawSensorChangedSymbol(), and paint().

00718 {
00719     const Measure m( 12.5, KDChartEnums::MeasureCalculationModeAuto, KDChartEnums::MeasureOrientationAuto );
00720     TextAttributes test;
00721     test.setFontSize( m );
00722     const QFontMetrics fm( test.calculatedFont( coordinatePlane()->parent(), KDChartEnums::MeasureOrientationAuto ) );
00723     const qreal height = fm.height() / 1.2;
00724     return QRectF( -height / 2.0, -height / 2.0, height, height );
00725 }

QSvgRenderer * LeveyJenningsDiagram::iconRenderer ( Symbol  symbol  )  [protected]

Returns the SVG icon renderer for symbol.

Definition at line 730 of file KDChartLeveyJenningsDiagram.cpp.

References d.

Referenced by drawDataPointSymbol(), drawFluidicsPackChangedSymbol(), drawLotChangeSymbol(), and drawSensorChangedSymbol().

00731 {
00732     if( d->iconRenderer[ symbol ] == 0 )
00733         d->iconRenderer[ symbol ] = new QSvgRenderer( d->icons[ symbol ], this );
00734 
00735     return d->iconRenderer[ symbol ];
00736 }

QModelIndex AbstractDiagram::indexAt ( const QPoint &  point  )  const [virtual, inherited]

[reimplemented]

Definition at line 1123 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::Chart::event().

01124 {
01125     return d->indexAt( point );
01126 }

QModelIndexList AbstractDiagram::indexesAt ( const QPoint &  point  )  const [inherited]

This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot.

Definition at line 1128 of file KDChartAbstractDiagram.cpp.

References d.

01129 {
01130     return d->indexesAt( point );
01131 }

bool AbstractDiagram::isHidden ( const QModelIndex &  index  )  const [inherited]

Retrieve the hidden status for the given index.

This will fall back automatically to what was set at dataset or diagram level, if there are no datapoint specific settings.

Parameters:
index The datapoint to retrieve the hidden status for.
Returns:
The hidden status for the given index.

Definition at line 427 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataHiddenRole.

00428 {
00429     return qVariantValue<bool>(
00430         attributesModel()->data(
00431             conditionallyMapFromSource(index),
00432             DataHiddenRole ) );
00433 }

bool AbstractDiagram::isHidden ( int  dataset  )  const [inherited]

Retrieve the hidden status for the given dataset.

This will fall back automatically to what was set at diagram level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the hidden status for.
Returns:
The hidden status for the given dataset.

Definition at line 413 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DataHiddenRole, KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::isHidden().

00414 {
00415     // To store the flag for a dataset, we use the first column
00416     // that's associated with it. (i.e., with a dataset dimension
00417     // of two, the column of the keys)
00418     const int column = dataset * datasetDimension();
00419     const QVariant boolFlag(
00420             attributesModel()->headerData( column, Qt::Vertical,
00421                     DataHiddenRole ) );
00422     if( boolFlag.isValid() )
00423         return qVariantValue< bool >( boolFlag );
00424     return isHidden();
00425 }

bool AbstractDiagram::isHidden (  )  const [inherited]

Retrieve the hidden status specified globally.

This will fall back automatically to the default settings ( = not hidden), if there are no specific settings.

Returns:
The global hidden status.

Definition at line 407 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DataHiddenRole, and KDChart::AttributesModel::modelData().

Referenced by KDChart::AbstractDiagram::isHidden(), and KDChart::LineDiagram::valueForCellTesting().

00408 {
00409     return qVariantValue<bool>(
00410         attributesModel()->modelData( DataHiddenRole ) );
00411 }

bool AbstractDiagram::isIndexHidden ( const QModelIndex &  index  )  const [virtual, inherited]

[reimplemented]

Definition at line 964 of file KDChartAbstractDiagram.cpp.

00965 { return true; }

QStringList AbstractDiagram::itemRowLabels (  )  const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 1009 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::headerData(), KDChart::AttributesModel::rowCount(), KDChart::AbstractDiagram::unitPrefix(), and KDChart::AbstractDiagram::unitSuffix().

01010 {
01011     QStringList ret;
01012     if( model() ){
01013         //qDebug() << "AbstractDiagram::itemRowLabels(): " << attributesModel()->rowCount(attributesModelRootIndex()) << "entries";
01014         const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
01015         for( int i = 0; i < rowCount; ++i ){
01016             //qDebug() << "item row label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
01017             ret << unitPrefix( i, Qt::Horizontal, true ) +
01018                    attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString() +
01019                    unitSuffix( i, Qt::Horizontal, true );
01020         }
01021     }
01022     return ret;
01023 }

void KDChart::AbstractDiagram::layoutChanged ( AbstractDiagram  )  [signal, inherited]

Diagrams are supposed to emit this signal, when the layout of one of their element changes.

Layouts can change, for example, when axes are added or removed, or when the configuration was changed in a way that the axes or the diagram itself are displayed in a different geometry. Changes in the diagrams coordinate system also result in the layoutChanged() signal being emitted.

Referenced by KDChart::AbstractDiagram::setDatasetDimensionInternal(), setModel(), KDChart::AbstractDiagram::setModel(), KDChart::BarDiagram::setOrientation(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

void KDChart::AbstractCartesianDiagram::layoutPlanes (  )  [virtual, inherited]

Triggers layouting of all coordinate planes on the current chart.

Normally you don't need to call this method. It's handled automatically for you.

Definition at line 116 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractCoordinatePlane::layoutPlanes().

Referenced by KDChart::AbstractCartesianDiagram::addAxis(), and KDChart::AbstractCartesianDiagram::takeAxis().

00117 {
00118     //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes()";
00119     AbstractCoordinatePlane* plane = coordinatePlane();
00120     if( plane ){
00121         plane->layoutPlanes();
00122         //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes() OK";
00123     }
00124 }

LineAttributes LineDiagram::lineAttributes ( const QModelIndex &  index  )  const [inherited]

Returns:
the line attribute set of the model index index

Definition at line 251 of file KDChartLineDiagram.cpp.

References d, and KDChart::LineAttributesRole.

00253 {
00254     return qVariantValue<LineAttributes>(
00255         d->attributesModel->data(
00256             d->attributesModel->mapFromSource(index),
00257             KDChart::LineAttributesRole ) );
00258 }

LineAttributes LineDiagram::lineAttributes ( int  column  )  const [inherited]

Returns:
the line attribute set of data set column

Definition at line 238 of file KDChartLineDiagram.cpp.

References d, KDChart::LineDiagram::lineAttributes(), and KDChart::LineAttributesRole.

00239 {
00240     const QVariant attrs(
00241             d->attributesModel->headerData( column, Qt::Vertical,
00242                                             LineAttributesRole ) );
00243     if( attrs.isValid() )
00244         return qVariantValue< LineAttributes >( attrs );
00245     return lineAttributes();
00246 }

LineAttributes LineDiagram::lineAttributes (  )  const [inherited]

Returns:
the global line attribute set

Definition at line 229 of file KDChartLineDiagram.cpp.

References d, and KDChart::LineAttributesRole.

Referenced by KDChart::LineDiagram::getCellValues(), and KDChart::LineDiagram::lineAttributes().

00230 {
00231     return qVariantValue<LineAttributes>(
00232         d->attributesModel->data( KDChart::LineAttributesRole ) );
00233 }

Qt::Alignment LeveyJenningsDiagram::lotChangedSymbolPosition (  )  const

Returns the position of the lot change symbol.

Definition at line 127 of file KDChartLeveyJenningsDiagram.cpp.

References d.

00128 {
00129     return d->lotChangedPosition;
00130 }

void KDChart::AbstractDiagram::modelsChanged (  )  [signal, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.

Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::setSelectionModel().

QModelIndex AbstractDiagram::moveCursor ( CursorAction  cursorAction,
Qt::KeyboardModifiers  modifiers 
) [virtual, inherited]

[reimplemented]

Definition at line 955 of file KDChartAbstractDiagram.cpp.

00956 { return QModelIndex(); }

const int LineDiagram::numberOfAbscissaSegments (  )  const [virtual, inherited]

Implements KDChart::AbstractCartesianDiagram.

Definition at line 471 of file KDChartLineDiagram.cpp.

References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

00472 {
00473     return d->attributesModel->rowCount(attributesModelRootIndex());
00474 }

const int LineDiagram::numberOfOrdinateSegments (  )  const [virtual, inherited]

Implements KDChart::AbstractCartesianDiagram.

Definition at line 479 of file KDChartLineDiagram.cpp.

References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

00480 {
00481     return d->attributesModel->columnCount(attributesModelRootIndex());
00482 }

void LeveyJenningsDiagram::paint ( PaintContext paintContext  )  [protected, virtual]

[reimplemented]

Reimplemented from KDChart::LineDiagram.

Definition at line 516 of file KDChartLeveyJenningsDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), KDChart::PaintContext::coordinatePlane(), d, KDChart::AbstractDiagram::dataBoundaries(), drawChanges(), drawDataPointSymbol(), drawLotChangeSymbol(), expectedMeanValue(), iconRect(), m, p, KDChart::PaintContext::painter(), KDChart::AbstractDiagram::pen(), KDChart::PaintContext::setCoordinatePlane(), KDChart::AbstractCoordinatePlane::sharedAxisMasterPlane(), timeRange(), and KDChart::AbstractCoordinatePlane::translate().

00517 {
00518     d->reverseMapper.clear();
00519 
00520     // note: Not having any data model assigned is no bug
00521     //       but we can not draw a diagram then either.
00522     if ( !checkInvariants( true ) ) return;
00523     if ( !AbstractGrid::isBoundariesValid(dataBoundaries()) ) return;
00524 
00525     QPainter* const painter = ctx->painter();
00526     const PainterSaver p( painter );
00527     if( model()->rowCount( rootIndex() ) == 0 || model()->columnCount( rootIndex() ) < 4 )
00528         return; // nothing to paint for us
00529 
00530     AbstractCoordinatePlane* const plane = ctx->coordinatePlane();
00531     ctx->setCoordinatePlane( plane->sharedAxisMasterPlane( painter ) );
00532 
00533     const QAbstractItemModel& m = *model();
00534     const int rowCount = m.rowCount( rootIndex() );
00535 
00536     const unsigned int minTime = timeRange().first.toTime_t();
00537 
00538     painter->setRenderHint( QPainter::Antialiasing, true );
00539 
00540     int prevLot = -1;
00541     QPointF prevPoint;
00542     bool hadMissingValue = false;
00543 
00544     for( int row = 0; row < rowCount; ++row )
00545     {
00546         const QModelIndex lotIndex = m.index( row, 0, rootIndex() );
00547         const QModelIndex valueIndex = m.index( row, 1, rootIndex() );
00548         const QModelIndex okIndex = m.index( row, 2, rootIndex() );
00549         const QModelIndex timeIndex = m.index( row, 3, rootIndex() );
00550         const QModelIndex expectedMeanIndex = m.index( row, 4, rootIndex() );
00551         const QModelIndex expectedSDIndex = m.index( row, 5, rootIndex() );
00552 
00553         painter->setPen( pen( lotIndex ) );
00554 
00555         const int lot = m.data( lotIndex ).toInt();
00556         double value = m.data( valueIndex ).toDouble();
00557         const bool ok = m.data( okIndex ).toBool();
00558         const QDateTime time = m.data( timeIndex ).toDateTime();
00559         const double xValue = ( time.toTime_t() - minTime ) / static_cast< double >( 24 * 60 * 60 );
00560 
00561         const double expectedMean = m.data( expectedMeanIndex ).toDouble();
00562         const double expectedSD = m.data( expectedSDIndex ).toDouble();
00563 
00564         QPointF point = ctx->coordinatePlane()->translate( QPointF( xValue, value ) );
00565 
00566         if( static_cast< int >( value ) == 0 )
00567         {
00568             hadMissingValue = true;
00569         }
00570         else
00571         {
00572             if( static_cast< int >( expectedMean ) != 0 && static_cast< int >( expectedSD ) != 0 )
00573             {
00574                 // this calculates the 'logical' value relative to the expected mean and SD of this point
00575                 value -= expectedMean;
00576                 value /= expectedSD;
00577                 value *= d->expectedStandardDeviation;
00578                 value += d->expectedMeanValue;
00579                 point = ctx->coordinatePlane()->translate( QPointF( xValue, value ) );
00580             }
00581 
00582             if( prevLot == lot )
00583             {
00584                 const QPen pen = painter->pen();
00585                 QPen newPen = pen;
00586 
00587                 if( hadMissingValue )
00588                 {
00589                     newPen.setDashPattern( QVector< qreal >() << 4.0 << 4.0 );
00590                 }
00591 
00592                 painter->setPen( newPen );
00593                 painter->drawLine( prevPoint, point );
00594                 painter->setPen( pen );
00595                 // d->reverseMapper.addLine( valueIndex.row(), valueIndex.column(), prevPoint, point );
00596             }
00597             else if( row > 0 )
00598             {
00599                 drawLotChangeSymbol( ctx, QPointF( xValue, value ) );
00600             }
00601 
00602             if( value <= d->expectedMeanValue + 4 * d->expectedStandardDeviation &&
00603                 value >= d->expectedMeanValue - 4 * d->expectedStandardDeviation )
00604             {
00605                 const QPointF location( xValue, value );
00606                 drawDataPointSymbol( ctx, location, ok );
00607                 d->reverseMapper.addCircle( valueIndex.row(),
00608                                             valueIndex.column(),
00609                                             ctx->coordinatePlane()->translate( location ),
00610                                             iconRect().size() );
00611             }
00612             prevLot = lot;
00613             prevPoint = point;
00614             hadMissingValue = false;
00615         }
00616 
00617         const QModelIndex current = selectionModel()->currentIndex();
00618         if( selectionModel()->rowIntersectsSelection( lotIndex.row(), lotIndex.parent() ) || current.sibling( current.row(), 0 ) == lotIndex )
00619         {
00620             const QPen pen = ctx->painter()->pen();
00621             painter->setPen( d->scanLinePen );
00622             painter->drawLine( ctx->coordinatePlane()->translate( QPointF( xValue, d->expectedMeanValue - 4 *
00623                                                                                    d->expectedStandardDeviation ) ),
00624                                ctx->coordinatePlane()->translate( QPointF( xValue, d->expectedMeanValue + 4 *
00625                                                                                    d->expectedStandardDeviation ) ) );
00626             painter->setPen( pen );
00627         }
00628     }
00629 
00630     drawChanges( ctx );
00631 
00632     ctx->setCoordinatePlane( plane );
00633 }

void AbstractDiagram::paintDataValueText ( QPainter *  painter,
const QModelIndex &  index,
const QPointF &  pos,
double  value 
) [inherited]

Definition at line 539 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::paintDataValueTexts().

00543 {
00544     d->paintDataValueText( this, painter, index, pos, value );
00545 }

void AbstractDiagram::paintDataValueTexts ( QPainter *  painter  )  [protected, virtual, inherited]

This method is obsolete and provided for backward-compatibility only.

Your own diagram classes should call d->paintDataValueTextsAndMarkers() instead which also is taking care for showing your cell-specific comments, if any,

Definition at line 555 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), d, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractCoordinatePlane::translate().

00556 {
00557     if ( !checkInvariants() ) return;
00558     const int rowCount = model()->rowCount(rootIndex());
00559     const int columnCount = model()->columnCount(rootIndex());
00560     d->clearListOfAlreadyDrawnDataValueTexts();
00561     for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) {
00562        for ( int j=0; j< rowCount; ++j ) {
00563            const QModelIndex index = model()->index( j, i, rootIndex() );
00564            double value = model()->data( index ).toDouble();
00565            const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
00566            paintDataValueText( painter, index, pos, value );
00567        }
00568     }
00569 }

void LineDiagram::paintEvent ( QPaintEvent *   )  [protected, inherited]

Definition at line 391 of file KDChartLineDiagram.cpp.

References KDChart::LineDiagram::paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

00392 {
00393 //qDebug() << "starting LineDiagram::paintEvent ( QPaintEvent*)";
00394     QPainter painter ( viewport() );
00395     PaintContext ctx;
00396     ctx.setPainter ( &painter );
00397     ctx.setRectangle ( QRectF ( 0, 0, width(), height() ) );
00398     paint ( &ctx );
00399 //qDebug() << "         LineDiagram::paintEvent ( QPaintEvent*) ended.";
00400 }

void AbstractDiagram::paintMarker ( QPainter *  painter,
const QModelIndex &  index,
const QPointF &  pos 
) [inherited]

Definition at line 600 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::dataValueAttributes(), and KDChart::AbstractDiagram::paintMarker().

00603 {
00604     if ( !checkInvariants() ) return;
00605     paintMarker( painter, dataValueAttributes( index ), index, pos );
00606 }

void AbstractDiagram::paintMarker ( QPainter *  painter,
const DataValueAttributes a,
const QModelIndex &  index,
const QPointF &  pos 
) [inherited]

Definition at line 572 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(), d, KDChart::MarkerAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(), KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(), KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

00576 {
00577     if ( !checkInvariants() || !a.isVisible() ) return;
00578     const MarkerAttributes ma = a.markerAttributes();
00579     if ( !ma.isVisible() ) return;
00580 
00581     const PainterSaver painterSaver( painter );
00582     // the size of the marker - unscaled
00583     const QSizeF maSize( ma.markerSize().width() / painter->matrix().m11(), 
00584                          ma.markerSize().height() / painter->matrix().m22() );
00585     QBrush indexBrush( brush( index ) );
00586     QPen indexPen( ma.pen() );
00587     if ( ma.markerColor().isValid() )
00588         indexBrush.setColor( ma.markerColor() );
00589 
00590     paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
00591 
00592     // workaround: BC cannot be changed, otherwise we would pass the
00593     // index down to next-lower paintMarker function. So far, we
00594     // basically save a circle of radius maSize at pos in the
00595     // reverseMapper. This means that ^^^ this version of paintMarker
00596     // needs to be called to reverse-map the marker.
00597     d->reverseMapper.addCircle( index.row(), index.column(), pos, 2 * maSize );
00598 }

void AbstractDiagram::paintMarker ( QPainter *  painter,
const MarkerAttributes markerAttributes,
const QBrush &  brush,
const QPen &  pen,
const QPointF &  point,
const QSizeF &  size 
) [virtual, inherited]

Definition at line 608 of file KDChartAbstractDiagram.cpp.

References KDChart::MarkerAttributes::Marker1Pixel, KDChart::MarkerAttributes::Marker4Pixels, KDChart::MarkerAttributes::MarkerCircle, KDChart::MarkerAttributes::MarkerCross, KDChart::MarkerAttributes::MarkerDiamond, KDChart::MarkerAttributes::MarkerFastCross, KDChart::MarkerAttributes::MarkerRing, KDChart::MarkerAttributes::MarkerSquare, KDChart::MarkerAttributes::markerStyle(), p, and KDChart::PrintingParameters::scalePen().

Referenced by KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::MarkerLayoutItem::paintIntoRect(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().

00614 {
00615     const QPen oldPen( painter->pen() );
00616     // Pen is used to paint 4Pixels - 1 Pixel - Ring and FastCross types.
00617     // make sure to use the brush color - see above in those cases.
00618     const bool isFourPixels = (markerAttributes.markerStyle() == MarkerAttributes::Marker4Pixels);
00619     if( isFourPixels || (markerAttributes.markerStyle() == MarkerAttributes::Marker1Pixel) ){
00620         // for high-performance point charts with tiny point markers:
00621         painter->setPen( PrintingParameters::scalePen( QPen( brush.color().light() ) ) );
00622         if( isFourPixels ){
00623             const qreal x = pos.x();
00624             const qreal y = pos.y();
00625             painter->drawLine( QPointF(x-1.0,y-1.0),
00626                                QPointF(x+1.0,y-1.0) );
00627             painter->drawLine( QPointF(x-1.0,y),
00628                                QPointF(x+1.0,y) );
00629             painter->drawLine( QPointF(x-1.0,y+1.0),
00630                                QPointF(x+1.0,y+1.0) );
00631         }
00632         painter->drawPoint( pos );
00633     }else{
00634         const PainterSaver painterSaver( painter );
00635         // we only a solid line surrounding the markers
00636         QPen painterPen( pen );
00637         painterPen.setStyle( Qt::SolidLine );
00638         painter->setPen( PrintingParameters::scalePen( painterPen ) );
00639         painter->setBrush( brush );
00640         painter->setRenderHint ( QPainter::Antialiasing );
00641         painter->translate( pos );
00642         switch ( markerAttributes.markerStyle() ) {
00643             case MarkerAttributes::MarkerCircle:
00644                 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
00645                             maSize.height(), maSize.width()) );
00646                 break;
00647             case MarkerAttributes::MarkerSquare:
00648                 {
00649                     QRectF rect( 0 - maSize.width()/2, 0 - maSize.height()/2,
00650                                 maSize.width(), maSize.height() );
00651                     painter->drawRect( rect );
00652                     break;
00653                 }
00654             case MarkerAttributes::MarkerDiamond:
00655                 {
00656                     QVector <QPointF > diamondPoints;
00657                     QPointF top, left, bottom, right;
00658                     top    = QPointF( 0, 0 - maSize.height()/2 );
00659                     left   = QPointF( 0 - maSize.width()/2, 0 );
00660                     bottom = QPointF( 0, maSize.height()/2 );
00661                     right  = QPointF( maSize.width()/2, 0 );
00662                     diamondPoints << top << left << bottom << right;
00663                     painter->drawPolygon( diamondPoints );
00664                     break;
00665                 }
00666             // both handled on top of the method:
00667             case MarkerAttributes::Marker1Pixel:
00668             case MarkerAttributes::Marker4Pixels:
00669                     break;
00670             case MarkerAttributes::MarkerRing:
00671                 {
00672                     painter->setPen( PrintingParameters::scalePen( QPen( brush.color() ) ) );
00673                     painter->setBrush( Qt::NoBrush );
00674                     painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
00675                                         maSize.height(), maSize.width()) );
00676                     break;
00677                 }
00678             case MarkerAttributes::MarkerCross:
00679                 {
00680                     // Note: Markers can have outline,
00681                     //       so just drawing two rects is NOT the solution here!
00682                     const qreal w02 = maSize.width() * 0.2;
00683                     const qreal w05 = maSize.width() * 0.5;
00684                     const qreal h02 = maSize.height()* 0.2;
00685                     const qreal h05 = maSize.height()* 0.5;
00686                     QVector <QPointF > crossPoints;
00687                     QPointF p[12];
00688                     p[ 0] = QPointF( -w02, -h05 );
00689                     p[ 1] = QPointF(  w02, -h05 );
00690                     p[ 2] = QPointF(  w02, -h02 );
00691                     p[ 3] = QPointF(  w05, -h02 );
00692                     p[ 4] = QPointF(  w05,  h02 );
00693                     p[ 5] = QPointF(  w02,  h02 );
00694                     p[ 6] = QPointF(  w02,  h05 );
00695                     p[ 7] = QPointF( -w02,  h05 );
00696                     p[ 8] = QPointF( -w02,  h02 );
00697                     p[ 9] = QPointF( -w05,  h02 );
00698                     p[10] = QPointF( -w05, -h02 );
00699                     p[11] = QPointF( -w02, -h02 );
00700                     for( int i=0; i<12; ++i )
00701                         crossPoints << p[i];
00702                     crossPoints << p[0];
00703                     painter->drawPolygon( crossPoints );
00704                     break;
00705                 }
00706             case MarkerAttributes::MarkerFastCross:
00707                 {
00708                     QPointF left, right, top, bottom;
00709                     left  = QPointF( -maSize.width()/2, 0 );
00710                     right = QPointF( maSize.width()/2, 0 );
00711                     top   = QPointF( 0, -maSize.height()/2 );
00712                     bottom= QPointF( 0, maSize.height()/2 );
00713                     painter->setPen( PrintingParameters::scalePen( QPen( brush.color() ) ) );
00714                     painter->drawLine( left, right );
00715                     painter->drawLine(  top, bottom );
00716                     break;
00717                 }
00718             default:
00719                 Q_ASSERT_X ( false, "paintMarkers()",
00720                             "Type item does not match a defined Marker Type." );
00721         }
00722     }
00723     painter->setPen( oldPen );
00724 }

void AbstractDiagram::paintMarkers ( QPainter *  painter  )  [protected, virtual, inherited]

This method is obsolete and provided for backward-compatibility only.

Your own diagram classes should call d->paintDataValueTextsAndMarkers() instead which also is taking care for showing your cell-specific comments, if any,

Definition at line 726 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractCoordinatePlane::translate().

00727 {
00728     if ( !checkInvariants() ) return;
00729     const int rowCount = model()->rowCount(rootIndex());
00730     const int columnCount = model()->columnCount(rootIndex());
00731     for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) {
00732        for ( int j=0; j< rowCount; ++j ) {
00733            const QModelIndex index = model()->index( j, i, rootIndex() );
00734            double value = model()->data( index ).toDouble();
00735            const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
00736            paintMarker( painter, index, pos );
00737        }
00738     }
00739 }

QPen AbstractDiagram::pen ( const QModelIndex &  index  )  const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model. With a dataset dimension of two, this is the index of the key of each key/value pair.
Returns:
The pen to use for painting.

Definition at line 792 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetPenRole.

00793 {
00794     return qVariantValue<QPen>(
00795         attributesModel()->data(
00796             conditionallyMapFromSource( index ),
00797             DatasetPenRole ) );
00798 }

QPen AbstractDiagram::pen ( int  dataset  )  const [inherited]

Retrieve the pen to be used for the given dataset.

This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.
Returns:
The pen to use for painting.

Definition at line 777 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, and KDChart::AbstractDiagram::pen().

00778 {
00779     // To store the pen for a dataset, we use the first column
00780     // that's associated with it. (i.e., with a dataset dimension
00781     // of two, the column of the keys)
00782     const int column = dataset * datasetDimension();
00783     
00784     const QVariant penSettings(
00785             attributesModel()->headerData( column, Qt::Vertical,
00786                     DatasetPenRole ) );
00787     if( penSettings.isValid() )
00788         return qVariantValue< QPen >( penSettings );
00789     return pen();
00790 }

QPen AbstractDiagram::pen (  )  const [inherited]

Retrieve the pen to be used for painting datapoints globally.

This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 771 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetPenRole.

Referenced by KDChart::AbstractDiagram::datasetPens(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), paint(), and KDChart::AbstractDiagram::pen().

00772 {
00773     return qVariantValue<QPen>(
00774         attributesModel()->data( DatasetPenRole ) );
00775 }

bool AbstractDiagram::percentMode (  )  const [inherited]

Definition at line 533 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::compare().

00534 {
00535     return d->percent;
00536 }

void KDChart::AbstractDiagram::propertiesChanged (  )  [signal, inherited]

Emitted upon change of a property of the Diagram.

Referenced by KDChart::Plotter::resetLineAttributes(), KDChart::LineDiagram::resetLineAttributes(), KDChart::AbstractDiagram::setAllowOverlappingDataValueTexts(), KDChart::AbstractDiagram::setAntiAliasing(), KDChart::BarDiagram::setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::LineDiagram::setCenterDataPoints(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::Plotter::setLineAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::BarDiagram::setOrientation(), KDChart::AbstractDiagram::setPen(), KDChart::AbstractDiagram::setPercentMode(), StockDiagram::setStockBarAttributes(), StockDiagram::setThreeDBarAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), StockDiagram::setType(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), KDChart::BarDiagram::setType(), KDChart::Plotter::setValueTrackerAttributes(), and KDChart::LineDiagram::setValueTrackerAttributes().

AbstractCartesianDiagram * AbstractCartesianDiagram::referenceDiagram (  )  const [virtual, inherited]

Returns:
this diagram's reference diagram

See also:
setReferenceDiagram

Definition at line 170 of file KDChartAbstractCartesianDiagram.cpp.

References d.

Referenced by KDChart::AbstractCartesianDiagram::compare(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::CartesianAxis::paintCtx(), referenceDiagramIsBarDiagram(), and referenceDiagramNeedsCenteredAbscissaTicks().

00171 {
00172     return d->referenceDiagram;
00173 }

QPointF AbstractCartesianDiagram::referenceDiagramOffset (  )  const [virtual, inherited]

Returns:
the relative offset of this diagram's reference diagram

See also:
setReferenceDiagram

Definition at line 175 of file KDChartAbstractCartesianDiagram.cpp.

References d.

Referenced by KDChart::AbstractCartesianDiagram::compare().

00176 {
00177     return d->referenceDiagramOffset;
00178 }

void LineDiagram::resetLineAttributes ( const QModelIndex &  index  )  [inherited]

Remove any explicit line attributes settings that might have been specified before.

Definition at line 219 of file KDChartLineDiagram.cpp.

References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00220 {
00221     d->attributesModel->resetData(
00222             d->attributesModel->mapFromSource(index), LineAttributesRole );
00223     emit propertiesChanged();
00224 }

void LineDiagram::resetLineAttributes ( int  column  )  [inherited]

Resets the line attributes of data set column.

Definition at line 195 of file KDChartLineDiagram.cpp.

References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00196 {
00197     d->attributesModel->resetHeaderData(
00198             column, Qt::Vertical, LineAttributesRole );
00199     emit propertiesChanged();
00200 }

void LineDiagram::resize ( const QSizeF &  area  )  [virtual, inherited]

Called by the widget's sizeEvent.

Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area 

Implements KDChart::AbstractDiagram.

Definition at line 461 of file KDChartLineDiagram.cpp.

References KDChart::AbstractDiagram::coordinatePlane(), d, KDChart::AbstractDiagram::setDataBoundariesDirty(), KDChart::AbstractCoordinatePlane::zoomFactorX(), and KDChart::AbstractCoordinatePlane::zoomFactorY().

00462 {
00463     d->compressor.setResolution( static_cast<int>( size.width() * coordinatePlane()->zoomFactorX() ),
00464                                  static_cast<int>( size.height() * coordinatePlane()->zoomFactorY() ) );
00465     setDataBoundariesDirty();
00466 }

void LineDiagram::resizeEvent ( QResizeEvent *   )  [protected, inherited]

Definition at line 374 of file KDChartLineDiagram.cpp.

00375 {
00376 }

QPen LeveyJenningsDiagram::scanLinePen (  )  const

Returns the pen being used for drawing the scan line.

Definition at line 221 of file KDChartLeveyJenningsDiagram.cpp.

References d.

00222 {
00223     return d->scanLinePen;
00224 }

void AbstractDiagram::scrollTo ( const QModelIndex &  index,
ScrollHint  hint = EnsureVisible 
) [virtual, inherited]

[reimplemented]

Definition at line 950 of file KDChartAbstractDiagram.cpp.

00951 {}

Qt::Alignment LeveyJenningsDiagram::sensorChangedSymbolPosition (  )  const

Returns the position of the sensor changed symbol.

Definition at line 169 of file KDChartLeveyJenningsDiagram.cpp.

References d.

00170 {
00171     return d->sensorChangedPosition;
00172 }

QVector< QDateTime > LeveyJenningsDiagram::sensorChanges (  )  const

Returns the list of all sensor changes.

Definition at line 253 of file KDChartLeveyJenningsDiagram.cpp.

References d.

00254 {
00255     return d->sensorChanges;
00256 }

void AbstractDiagram::setAllowOverlappingDataValueTexts ( bool  allow  )  [inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 505 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::propertiesChanged().

00506 {
00507     d->allowOverlappingDataValueTexts = allow;
00508     emit propertiesChanged();
00509 }

void AbstractDiagram::setAntiAliasing ( bool  enabled  )  [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 516 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::propertiesChanged().

00517 {
00518     d->antiAliasing = enabled;
00519     emit propertiesChanged();
00520 }

void AbstractCartesianDiagram::setAttributesModel ( AttributesModel amodel  )  [virtual, inherited]

Associate an AttributesModel with this diagram.

Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used with AttributesModels that have been explicitly created by the user, and are owned by her. Setting an AttributesModel that is internal to another diagram is an error.

Correct:

 AttributesModel *am = new AttributesModel( model, 0 );
 diagram1->setAttributesModel( am );
 diagram2->setAttributesModel( am );

Wrong:

 diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.
See also:
AttributesModel, usesExternalAttributesModel
Sets an external AttributesModel on this diagram. By default, a diagram has it's own internal set of attributes, but an external one can be set. This can be used to share attributes between several diagrams. The diagram does not take ownership of the attributesmodel.

Reimplemented from KDChart::AbstractDiagram.

Definition at line 192 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setAttributesModel().

00193 {
00194     AbstractDiagram::setAttributesModel( model );
00195     d->compressor.setModel( attributesModel() );
00196 }

void AbstractDiagram::setAttributesModelRootIndex ( const QModelIndex &  idx  )  [protected, inherited]

Definition at line 336 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::setDataBoundariesDirty().

Referenced by KDChart::AbstractDiagram::setRootIndex().

00337 {
00338     d->attributesModelRootIndex=idx;
00339     setDataBoundariesDirty();
00340     scheduleDelayedItemsLayout();
00341 }

void AbstractDiagram::setBrush ( const QBrush &  brush  )  [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 808 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().

00809 {
00810     attributesModel()->setModelData(
00811         qVariantFromValue( brush ), DatasetBrushRole );
00812     emit propertiesChanged();
00813 }

void AbstractDiagram::setBrush ( int  dataset,
const QBrush &  brush 
) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset to set the brush for.
brush The brush to use.

Definition at line 815 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().

00816 {
00817     // To store the brush for a dataset, we use the first column
00818     // that's associated with it. (i.e., with a dataset dimension
00819     // of two, the column of the keys)
00820     const int column = dataset * datasetDimension();
00821     
00822     attributesModel()->setHeaderData(
00823         column, Qt::Vertical,
00824         qVariantFromValue( brush ),
00825         DatasetBrushRole );
00826     emit propertiesChanged();
00827 }

void AbstractDiagram::setBrush ( const QModelIndex &  index,
const QBrush &  brush 
) [inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint's index in the model. With a dataset dimension of two, this is the index of the key of each key/value pair.
brush The brush to use.

Definition at line 800 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().

00801 {
00802     attributesModel()->setData(
00803         conditionallyMapFromSource( index ),
00804         qVariantFromValue( brush ), DatasetBrushRole );
00805     emit propertiesChanged();
00806 }

void LineDiagram::setCenterDataPoints ( bool  center  )  [inherited]

If centerDataPoints() is true, all data points are moved by an offset of 0.5 to the right.

This is useful in conjunction with bar diagrams, since data points are then centered just like bars.

See also:
centerDataPoints()

Definition at line 155 of file KDChartLineDiagram.cpp.

References d, and KDChart::AbstractDiagram::propertiesChanged().

00156 {
00157         d->centerDataPoints = center;
00158         emit propertiesChanged();
00159 }

void KDChart::AbstractCartesianDiagram::setCoordinatePlane ( AbstractCoordinatePlane plane  )  [virtual, inherited]

[reimplemented]

Reimplemented from KDChart::AbstractDiagram.

Definition at line 126 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractDiagram::setCoordinatePlane().

00127 {
00128     if( coordinatePlane() ) {
00129         disconnect( attributesModel(), SIGNAL( rowsRemoved( const QModelIndex&, int, int ) ),
00130                  coordinatePlane(), SLOT( relayout() ) );
00131         disconnect( attributesModel(), SIGNAL( rowsInserted( const QModelIndex&, int, int ) ),
00132                  coordinatePlane(), SLOT( relayout() ) );
00133         disconnect( attributesModel(), SIGNAL( columnsRemoved( const QModelIndex&, int, int ) ),
00134                  coordinatePlane(), SLOT( relayout() ) );
00135         disconnect( attributesModel(), SIGNAL( columnsInserted( const QModelIndex&, int, int ) ),
00136                  coordinatePlane(), SLOT( relayout() ) );
00137         disconnect( coordinatePlane() );
00138     }
00139     
00140     AbstractDiagram::setCoordinatePlane(plane);
00141     if ( plane ) {
00142         // Readjust the layout when the dataset count changes
00143         connect( attributesModel(), SIGNAL( rowsRemoved( const QModelIndex&, int, int ) ),
00144                  plane, SLOT( relayout() ), Qt::QueuedConnection );
00145         connect( attributesModel(), SIGNAL( rowsInserted( const QModelIndex&, int, int ) ),
00146                  plane, SLOT( relayout() ), Qt::QueuedConnection );
00147         connect( attributesModel(), SIGNAL( columnsRemoved( const QModelIndex&, int, int ) ),
00148                  plane, SLOT( relayout() ), Qt::QueuedConnection );
00149         connect( attributesModel(), SIGNAL( columnsInserted( const QModelIndex&, int, int ) ),
00150                  plane, SLOT( relayout() ), Qt::QueuedConnection );
00151     }
00152     // show the axes, after all have been layoutPlanes
00153     // (because they might depend on each other)
00154     /*
00155     if( plane )
00156         Q_FOREACH( CartesianAxis* axis, d->axesList )
00157             axis->show();
00158     else
00159         Q_FOREACH( CartesianAxis* axis, d->axesList )
00160             axis->hide();
00161     */
00162 }

void AbstractDiagram::setDataBoundariesDirty (  )  const [protected, slot, inherited]

Definition at line 236 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::dataChanged(), StockDiagram::resize(), KDChart::Plotter::resize(), KDChart::LineDiagram::resize(), KDChart::BarDiagram::resize(), KDChart::AbstractDiagram::setAttributesModel(), KDChart::AbstractDiagram::setAttributesModelRootIndex(), KDChart::AbstractDiagram::setDatasetDimensionInternal(), KDChart::AbstractDiagram::setModel(), KDChart::BarDiagram::setOrientation(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

00237 {
00238     d->databoundariesDirty = true;
00239 }

void AbstractDiagram::setDatasetDimension ( int  dimension  )  [inherited]

Sets the dataset dimension of the diagram. Using this method is obsolete. Use the specific diagram types instead.

Definition at line 1094 of file KDChartAbstractDiagram.cpp.

01095 {
01096     Q_UNUSED( dimension );
01097     qDebug() << "Setting the dataset dimension using AbstractDiagram::setDatasetDimension is obsolete. Use the specific diagram types instead.";
01098 }

void AbstractDiagram::setDatasetDimensionInternal ( int  dimension  )  [protected, inherited]

Definition at line 1100 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::AbstractDiagram::setDataBoundariesDirty().

Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram(), and KDChart::TernaryPointDiagram::TernaryPointDiagram().

01101 {
01102     Q_ASSERT( dimension != 0 );
01103     
01104     if ( d->datasetDimension == dimension ) return;
01105     d->datasetDimension = dimension;
01106     setDataBoundariesDirty();
01107     emit layoutChanged( this );
01108 }

void AbstractDiagram::setDataValueAttributes ( const DataValueAttributes a  )  [inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 499 of file KDChartAbstractDiagram.cpp.

References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00500 {
00501     d->attributesModel->setModelData( qVariantFromValue( a ), DataValueLabelAttributesRole );
00502     emit propertiesChanged();
00503 }

void AbstractDiagram::setDataValueAttributes ( int  dataset,
const DataValueAttributes a 
) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 447 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::datasetDimension(), KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00448 {
00449     // To store the attributes for a dataset, we use the first column
00450     // that's associated with it. (i.e., with a dataset dimension
00451     // of two, the column of the keys)
00452     const int column = dataset * datasetDimension();
00453     d->attributesModel->setHeaderData(
00454         column, Qt::Vertical,
00455         qVariantFromValue( a ), DataValueLabelAttributesRole );
00456     emit propertiesChanged();
00457 }

void AbstractDiagram::setDataValueAttributes ( const QModelIndex &  index,
const DataValueAttributes a 
) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for. With a dataset dimension of two, this is the index of the key of each key/value pair.
a The attributes to set.

Definition at line 436 of file KDChartAbstractDiagram.cpp.

References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00438 {
00439     d->attributesModel->setData(
00440         conditionallyMapFromSource( index ),
00441         qVariantFromValue( a ),
00442         DataValueLabelAttributesRole );
00443     emit propertiesChanged();
00444 }

void LeveyJenningsDiagram::setExpectedMeanValue ( float  meanValue  ) 

Sets the expected mean value over all QC values to meanValue.

Definition at line 261 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00262 {
00263     if( d->expectedMeanValue == meanValue )
00264         return;
00265 
00266     d->expectedMeanValue = meanValue;
00267     d->setYAxisRange();
00268     update();
00269 }

void LeveyJenningsDiagram::setExpectedStandardDeviation ( float  sd  ) 

Sets the expected standard deviaction over all QC values to sd.

Definition at line 282 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00283 {
00284     if( d->expectedStandardDeviation == sd )
00285         return;
00286 
00287     d->expectedStandardDeviation = sd;
00288     d->setYAxisRange();
00289     update();
00290 }

void LeveyJenningsDiagram::setFluidicsPackChangedSymbolPosition ( Qt::Alignment  pos  ) 

Sets the position of the fluidics pack changed symbol to pos.

Valid values are: Qt::AlignBottom (default), Qt::AlignTop.

Definition at line 136 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00137 {
00138     if( d->fluidicsPackChangedPosition == pos )
00139         return;
00140 
00141     d->fluidicsPackChangedPosition = pos;
00142     update();
00143 }

void LeveyJenningsDiagram::setFluidicsPackChanges ( const QVector< QDateTime > &  changes  ) 

Sets the date/time of all fluidics pack changes to changes.

Definition at line 177 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00178 {
00179     if( d->fluidicsPackChanges == changes )
00180         return;
00181 
00182     d->fluidicsPackChanges = changes;
00183     update();
00184 }

void AbstractDiagram::setHidden ( bool  hidden  )  [inherited]

Hide (or unhide, resp.

) all datapoints in the model.

Note:
Hidden data are still taken into account by the coordinate plane, so neither the grid nor your axes' ranges will change, when you hide data. For totally removing data from KD Chart's view you can use another approach: e.g. you could define a proxy model on top of your data model, and register the proxy model calling setModel() instead of registering your real data model.
Parameters:
hidden The hidden status to set.

Definition at line 399 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.

00400 {
00401     d->attributesModel->setModelData(
00402         qVariantFromValue( hidden ),
00403         DataHiddenRole );
00404     emit dataHidden();
00405 }

void AbstractDiagram::setHidden ( int  dataset,
bool  hidden 
) [inherited]

Hide (or unhide, resp.

) a dataset.

Note:
Hidden data are still taken into account by the coordinate plane, so neither the grid nor your axes' ranges will change, when you hide data. For totally removing data from KD Chart's view you can use another approach: e.g. you could define a proxy model on top of your data model, and register the proxy model calling setModel() instead of registering your real data model.
Parameters:
dataset The dataset to set the hidden status for.
hidden The hidden status to set.

Definition at line 386 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::dataHidden(), KDChart::DataHiddenRole, and KDChart::AbstractDiagram::datasetDimension().

00387 {
00388     // To store the flag for a dataset, we use the first column
00389     // that's associated with it. (i.e., with a dataset dimension
00390     // of two, the column of the keys)
00391     const int column = dataset * datasetDimension();
00392     d->attributesModel->setHeaderData(
00393         column, Qt::Vertical,
00394         qVariantFromValue( hidden ),
00395         DataHiddenRole );
00396     emit dataHidden();
00397 }

void AbstractDiagram::setHidden ( const QModelIndex &  index,
bool  hidden 
) [inherited]

Hide (or unhide, resp.

) a data cell.

Note:
Hidden data are still taken into account by the coordinate plane, so neither the grid nor your axes' ranges will change, when you hide data. For totally removing data from KD Chart's view you can use another approach: e.g. you could define a proxy model on top of your data model, and register the proxy model calling setModel() instead of registering your real data model.
Parameters:
index The datapoint to set the hidden status for. With a dataset dimension of two, this is the index of the key of each key/value pair.
hidden The hidden status to set.

Definition at line 377 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.

00378 {
00379     d->attributesModel->setData(
00380         conditionallyMapFromSource( index ),
00381         qVariantFromValue( hidden ),
00382         DataHiddenRole );
00383     emit dataHidden();
00384 }

void LineDiagram::setLineAttributes ( const QModelIndex &  index,
const LineAttributes a 
) [inherited]

Sets the line attributes for the model index index to la.

Definition at line 205 of file KDChartLineDiagram.cpp.

References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00208 {
00209     d->attributesModel->setData(
00210             d->attributesModel->mapFromSource(index),
00211     qVariantFromValue( la ),
00212     LineAttributesRole );
00213     emit propertiesChanged();
00214 }

void LineDiagram::setLineAttributes ( int  column,
const LineAttributes a 
) [inherited]

Sets the line attributes of data set column to la.

Definition at line 180 of file KDChartLineDiagram.cpp.

References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00183 {
00184     d->attributesModel->setHeaderData(
00185             column,
00186             Qt::Vertical,
00187             qVariantFromValue( la ),
00188             LineAttributesRole );
00189     emit propertiesChanged();
00190 }

void LineDiagram::setLineAttributes ( const LineAttributes a  )  [inherited]

Sets the global line attributes to la.

Definition at line 169 of file KDChartLineDiagram.cpp.

References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00170 {
00171     d->attributesModel->setModelData(
00172         qVariantFromValue( la ),
00173         LineAttributesRole );
00174     emit propertiesChanged();
00175 }

void LeveyJenningsDiagram::setLotChangedSymbolPosition ( Qt::Alignment  pos  ) 

Sets the position of the lot change symbol to pos.

Valid values are: Qt::AlignTop (default), Qt::AlignBottom.

Definition at line 115 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00116 {
00117     if( d->lotChangedPosition == pos )
00118         return;
00119 
00120     d->lotChangedPosition = pos;
00121     update();
00122 }

void LeveyJenningsDiagram::setModel ( QAbstractItemModel *  model  )  [virtual]

Associate a model with the diagram.

Reimplemented from KDChart::AbstractCartesianDiagram.

Definition at line 316 of file KDChartLeveyJenningsDiagram.cpp.

References calculateMeanAndStandardDeviation(), KDChart::AbstractDiagram::dataChanged(), KDChart::AbstractDiagram::layoutChanged(), and KDChart::AbstractCartesianDiagram::setModel().

00317 {
00318     if( this->model() != 0 )
00319     {
00320         disconnect( this->model(), SIGNAL( dataChanged( const QModelIndex&, const QModelIndex& ) ),
00321                                    this, SLOT( calculateMeanAndStandardDeviation() ) );
00322         disconnect( this->model(), SIGNAL( rowsInserted( const QModelIndex&, int, int ) ),
00323                                    this, SLOT( calculateMeanAndStandardDeviation() ) );
00324         disconnect( this->model(), SIGNAL( rowsRemoved( const QModelIndex&, int, int ) ),
00325                                    this, SLOT( calculateMeanAndStandardDeviation() ) );
00326         disconnect( this->model(), SIGNAL( columnsInserted( const QModelIndex&, int, int ) ),
00327                                    this, SLOT( calculateMeanAndStandardDeviation() ) );
00328         disconnect( this->model(), SIGNAL( columnsRemoved( const QModelIndex&, int, int ) ),
00329                                    this, SLOT( calculateMeanAndStandardDeviation() ) );
00330         disconnect( this->model(), SIGNAL( modelReset() ),
00331                                    this, SLOT( calculateMeanAndStandardDeviation() ) );
00332         disconnect( this->model(), SIGNAL( layoutChanged() ),
00333                                    this, SLOT( calculateMeanAndStandardDeviation() ) );
00334     }
00335     LineDiagram::setModel( model );
00336     if( this->model() != 0 )
00337     {
00338         connect( this->model(), SIGNAL( dataChanged( const QModelIndex&, const QModelIndex& ) ),
00339                                 this, SLOT( calculateMeanAndStandardDeviation() ) );
00340         connect( this->model(), SIGNAL( rowsInserted( const QModelIndex&, int, int ) ),
00341                                 this, SLOT( calculateMeanAndStandardDeviation() ) );
00342         connect( this->model(), SIGNAL( rowsRemoved( const QModelIndex&, int, int ) ),
00343                                 this, SLOT( calculateMeanAndStandardDeviation() ) );
00344         connect( this->model(), SIGNAL( columnsInserted( const QModelIndex&, int, int ) ),
00345                                 this, SLOT( calculateMeanAndStandardDeviation() ) );
00346         connect( this->model(), SIGNAL( columnsRemoved( const QModelIndex&, int, int ) ),
00347                                 this, SLOT( calculateMeanAndStandardDeviation() ) );
00348         connect( this->model(), SIGNAL( modelReset() ),
00349                                 this, SLOT( calculateMeanAndStandardDeviation() ) );
00350         connect( this->model(), SIGNAL( layoutChanged() ),
00351                                 this, SLOT( calculateMeanAndStandardDeviation() ) );
00352 
00353         calculateMeanAndStandardDeviation();
00354     }
00355 }

void AbstractDiagram::setPen ( const QPen &  pen  )  [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 750 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().

00751 {
00752     attributesModel()->setModelData(
00753         qVariantFromValue( pen ), DatasetPenRole );
00754     emit propertiesChanged();
00755 }

void AbstractDiagram::setPen ( int  dataset,
const QPen &  pen 
) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset to set the pen for.
pen The pen to use.

Definition at line 757 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().

00758 {
00759     // To store the pen for a dataset, we use the first column
00760     // that's associated with it. (i.e., with a dataset dimension
00761     // of two, the column of the keys)
00762     const int column = dataset * datasetDimension();
00763     
00764     attributesModel()->setHeaderData(
00765         column, Qt::Vertical,
00766         qVariantFromValue( pen ),
00767         DatasetPenRole );
00768     emit propertiesChanged();
00769 }

void AbstractDiagram::setPen ( const QModelIndex &  index,
const QPen &  pen 
) [inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint's index in the model. With a dataset dimension of two, this is the index of the key of each key/value pair.
pen The pen to use.

Definition at line 742 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().

Referenced by StockDiagram::init().

00743 {
00744     attributesModel()->setData(
00745         conditionallyMapFromSource( index ),
00746         qVariantFromValue( pen ), DatasetPenRole );
00747     emit propertiesChanged();
00748 }

void AbstractDiagram::setPercentMode ( bool  percent  )  [inherited]

Definition at line 527 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::propertiesChanged().

Referenced by KDChart::BarDiagram::setOrientation(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().

00528 {
00529     d->percent = percent;
00530     emit propertiesChanged();
00531 }

void AbstractCartesianDiagram::setReferenceDiagram ( AbstractCartesianDiagram diagram,
const QPointF &  offset = QPointF() 
) [virtual, inherited]

Makes this diagram use another diagram diagram as reference diagram with relative offset offset.

To share cartesian axes between different diagrams there might be cases when you need that. Normally you don't.

See also:
examples/SharedAbscissa

Definition at line 164 of file KDChartAbstractCartesianDiagram.cpp.

References d.

00165 {
00166     d->referenceDiagram = diagram;
00167     d->referenceDiagramOffset = offset;
00168 }

void AbstractCartesianDiagram::setRootIndex ( const QModelIndex &  idx  )  [virtual, inherited]

Set the root index in the model, where the diagram starts referencing data for display.

[reimplemented]

Reimplemented from KDChart::AbstractDiagram.

Definition at line 180 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setRootIndex().

00181 {
00182     AbstractDiagram::setRootIndex( index );
00183     d->compressor.setRootIndex( attributesModel()->mapFromSource( index ) );
00184 }

void LeveyJenningsDiagram::setScanLinePen ( const QPen &  pen  ) 

Sets the pen used for drawing the scan line to pen.

Definition at line 209 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00210 {
00211     if( d->scanLinePen == pen )
00212         return;
00213 
00214     d->scanLinePen = pen;
00215     update();
00216 }

void AbstractDiagram::setSelection ( const QRect &  rect,
QItemSelectionModel::SelectionFlags  command 
) [virtual, inherited]

[reimplemented]

Definition at line 967 of file KDChartAbstractDiagram.cpp.

References d.

00968 {
00969     const QModelIndexList indexes = d->indexesIn( rect );
00970     QItemSelection selection;
00971     KDAB_FOREACH( const QModelIndex& index, indexes )
00972     {
00973         selection.append( QItemSelectionRange( index ) );
00974     }
00975     selectionModel()->select( selection, command );
00976 }

void AbstractDiagram::setSelectionModel ( QItemSelectionModel *  selectionModel  )  [virtual, inherited]

Associate a seleection model with the diagrom.

Definition at line 269 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::modelsChanged().

00270 {
00271     if( selectionModel() )
00272     {
00273         disconnect( selectionModel(), SIGNAL( currentChanged( QModelIndex, QModelIndex ) ), this, SIGNAL( modelsChanged() ) );
00274         disconnect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SIGNAL( modelsChanged() ) );
00275     }
00276     QAbstractItemView::setSelectionModel( newSelectionModel );
00277     if( selectionModel() )
00278     {
00279         connect( selectionModel(), SIGNAL( currentChanged( QModelIndex, QModelIndex ) ), this, SIGNAL( modelsChanged() ) );
00280         connect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SIGNAL( modelsChanged() ) );
00281     }
00282     emit modelsChanged();
00283 }

void LeveyJenningsDiagram::setSensorChangedSymbolPosition ( Qt::Alignment  pos  ) 

Sets the position of the sensor changed symbol to pos.

Valid values are: Qt::AlignBottom (default), Qt::AlignTop.

Definition at line 157 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00158 {
00159     if( d->sensorChangedPosition == pos )
00160         return;
00161 
00162     d->sensorChangedPosition = pos;
00163     update();
00164 }

void LeveyJenningsDiagram::setSensorChanges ( const QVector< QDateTime > &  changes  ) 

Sets the date/time of all sensor changes to changes.

Definition at line 197 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00198 {
00199     if( d->sensorChanges == changes )
00200         return;
00201 
00202     d->sensorChanges = changes;
00203     update();
00204 }

void LeveyJenningsDiagram::setSymbol ( Symbol  symbol,
const QString &  filename 
)

Sets the symbol being used for symbol to a SVG file filename.

Definition at line 237 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00238 {
00239     if( d->icons[ symbol ] == filename )
00240         return;
00241 
00242     delete d->iconRenderer[ symbol ];
00243     d->iconRenderer[ symbol ] = 0;
00244 
00245     d->icons[ symbol ] = filename;
00246 
00247     update();
00248 }

void LineDiagram::setThreeDLineAttributes ( const QModelIndex &  index,
const ThreeDLineAttributes a 
) [inherited]

Sets the 3D line attributes of model index index to la.

Definition at line 292 of file KDChartLineDiagram.cpp.

References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.

00295 {
00296     setDataBoundariesDirty();
00297     d->attributesModel->setData(
00298         d->attributesModel->mapFromSource(index),
00299         qVariantFromValue( la ),
00300         ThreeDLineAttributesRole );
00301    emit propertiesChanged();
00302 }

void LineDiagram::setThreeDLineAttributes ( int  column,
const ThreeDLineAttributes a 
) [inherited]

Sets the 3D line attributes of data set column to ta.

Definition at line 276 of file KDChartLineDiagram.cpp.

References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.

00279 {
00280     setDataBoundariesDirty();
00281     d->attributesModel->setHeaderData(
00282         column,
00283         Qt::Vertical,
00284         qVariantFromValue( la ),
00285         ThreeDLineAttributesRole );
00286    emit propertiesChanged();
00287 }

void LineDiagram::setThreeDLineAttributes ( const ThreeDLineAttributes a  )  [inherited]

Sets the global 3D line attributes to la.

Definition at line 263 of file KDChartLineDiagram.cpp.

References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.

00265 {
00266     setDataBoundariesDirty();
00267     d->attributesModel->setModelData(
00268         qVariantFromValue( la ),
00269         ThreeDLineAttributesRole );
00270    emit propertiesChanged();
00271 }

void LeveyJenningsDiagram::setTimeRange ( const QPair< QDateTime, QDateTime > &  timeRange  ) 

Sets the timeRange visible on the x axis.

Set it to QPair< QDateTime, QDateTime >() to use the default auto calculation.

Definition at line 484 of file KDChartLeveyJenningsDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00485 {
00486     if( d->timeRange == timeRange )
00487         return;
00488 
00489     d->timeRange = timeRange;
00490     update();
00491 }

void LineDiagram::setType ( const LineType  type  )  [inherited]

Sets the line diagram's type to type.

See also:
LineDiagram::LineType

Definition at line 115 of file KDChartLineDiagram.cpp.

References d, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::layoutChanged(), KDChart::LineDiagram::Normal, KDChart::LineDiagram::Percent, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), KDChart::AbstractDiagram::setPercentMode(), and KDChart::LineDiagram::Stacked.

Referenced by KDChart::LineDiagram::clone().

00116 {
00117     if ( d->implementor->type() == type ) return;
00118    if ( type != LineDiagram::Normal && datasetDimension() > 1 ) {
00119        Q_ASSERT_X ( false, "setType()",
00120                     "This line chart type can't be used with multi-dimensional data." );
00121        return;
00122    }
00123    switch( type ) {
00124    case Normal:
00125        d->implementor = d->normalDiagram;
00126        break;
00127    case Stacked:
00128        d->implementor = d->stackedDiagram;
00129        break;
00130    case Percent:
00131        d->implementor = d->percentDiagram;
00132        break;
00133    default:
00134        Q_ASSERT_X( false, "LineDiagram::setType", "unknown diagram subtype" );
00135    };
00136 
00137    // d->lineType = type;
00138    Q_ASSERT( d->implementor->type() == type );
00139 
00140    // AbstractAxis settings - see AbstractDiagram and CartesianAxis
00141    setPercentMode( type == LineDiagram::Percent );
00142    setDataBoundariesDirty();
00143    emit layoutChanged( this );
00144    emit propertiesChanged();
00145 }

void AbstractDiagram::setUnitPrefix ( const QString &  prefix,
Qt::Orientation  orientation 
) [inherited]

Set the unit prefix to be used on axes for all columns.

Sets the unit prefix for all values.

Parameters:
prefix The prefix to be used.
orientation The orientation of the axis to use.
prefix the prefix to be set
orientation the orientantion of the axis to set

Definition at line 872 of file KDChartAbstractDiagram.cpp.

References d.

00873 {
00874     d->unitPrefix[ orientation ] = prefix;
00875 }

void AbstractDiagram::setUnitPrefix ( const QString &  prefix,
int  column,
Qt::Orientation  orientation 
) [inherited]

Set the unit prefix to be used on axes for one specific column.

Sets the unit prefix for one value.

Parameters:
prefix The prefix to be used.
column The column which should be set.
orientation The orientation of the axis to use.
prefix the prefix to be set
column the value using that prefix
orientation the orientantion of the axis to set

Definition at line 862 of file KDChartAbstractDiagram.cpp.

References d.

00863 {
00864     d->unitPrefixMap[ column ][ orientation ]= prefix;
00865 }

void AbstractDiagram::setUnitSuffix ( const QString &  suffix,
Qt::Orientation  orientation 
) [inherited]

Set the unit prefix to be used on axes for all columns.

Sets the unit suffix for all values.

Parameters:
suffix The suffix to be used.
orientation The orientation of the axis to use.
suffix the suffix to be set
orientation the orientantion of the axis to set

Definition at line 893 of file KDChartAbstractDiagram.cpp.

References d.

00894 {
00895     d->unitSuffix[ orientation ] = suffix;
00896 }

void AbstractDiagram::setUnitSuffix ( const QString &  suffix,
int  column,
Qt::Orientation  orientation 
) [inherited]

Set the unit prefix to be used on axes for one specific column.

Sets the unit suffix for one value.

Parameters:
suffix The suffix to be used.
column The column which should be set.
orientation The orientation of the axis to use.
suffix the suffix to be set
column the value using that suffix
orientation the orientantion of the axis to set

Definition at line 883 of file KDChartAbstractDiagram.cpp.

References d.

00884 {
00885     d->unitSuffixMap[ column ][ orientation ]= suffix;
00886 }

void LineDiagram::setValueTrackerAttributes ( const QModelIndex &  index,
const ValueTrackerAttributes a 
) [inherited]

Sets the value tracker attributes of the model index index to va.

Definition at line 354 of file KDChartLineDiagram.cpp.

References d, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::ValueTrackerAttributesRole.

00356 {
00357     d->attributesModel->setData( d->attributesModel->mapFromSource(index),
00358                                  qVariantFromValue( va ),
00359                                  KDChart::ValueTrackerAttributesRole );
00360     emit propertiesChanged();
00361 }

QString LeveyJenningsDiagram::symbol ( Symbol  symbol  )  const

Returns the SVG file name usef for symbol.

Definition at line 229 of file KDChartLeveyJenningsDiagram.cpp.

References d.

00230 {
00231     return d->icons[ symbol ];
00232 }

void AbstractCartesianDiagram::takeAxis ( CartesianAxis axis  )  [virtual, inherited]

Removes the axis from the diagram, without deleting it.

The diagram no longer owns the axis, so it is the caller's responsibility to delete the axis.

See also:
addAxis

Definition at line 101 of file KDChartAbstractCartesianDiagram.cpp.

References d, KDChart::AbstractAxis::deleteObserver(), KDChart::AbstractCartesianDiagram::layoutPlanes(), and KDChart::AbstractLayoutItem::setParentWidget().

Referenced by KDChart::Widget::setType(), KDChart::CartesianAxis::~CartesianAxis(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().

00102 {
00103     const int idx = d->axesList.indexOf( axis );
00104     if( idx != -1 )
00105         d->axesList.takeAt( idx );
00106     axis->deleteObserver( this );
00107     axis->setParentWidget( 0 );
00108     layoutPlanes();
00109 }

double LineDiagram::threeDItemDepth ( int  column  )  const [protected, virtual, inherited]

Returns:
the 3D item depth of the data set column

Implements KDChart::AbstractCartesianDiagram.

Definition at line 342 of file KDChartLineDiagram.cpp.

References d, and KDChart::ThreeDLineAttributesRole.

00343 {
00344     return qVariantValue<ThreeDLineAttributes>(
00345         d->attributesModel->headerData (
00346             column,
00347             Qt::Vertical,
00348             KDChart::ThreeDLineAttributesRole ) ).validDepth();
00349 }

double LineDiagram::threeDItemDepth ( const QModelIndex &  index  )  const [protected, virtual, inherited]

Returns:
the 3D item depth of the model index index

Implements KDChart::AbstractCartesianDiagram.

Definition at line 337 of file KDChartLineDiagram.cpp.

References KDChart::LineDiagram::threeDLineAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().

00338 {
00339     return threeDLineAttributes( index ).validDepth();
00340 }

ThreeDLineAttributes LineDiagram::threeDLineAttributes ( const QModelIndex &  index  )  const [inherited]

Returns:
the 3D line attributes of the model index index

Definition at line 329 of file KDChartLineDiagram.cpp.

References d, and KDChart::ThreeDLineAttributesRole.

00330 {
00331     return qVariantValue<ThreeDLineAttributes>(
00332         d->attributesModel->data(
00333             d->attributesModel->mapFromSource( index ),
00334             KDChart::ThreeDLineAttributesRole ) );
00335 }

ThreeDLineAttributes LineDiagram::threeDLineAttributes ( int  column  )  const [inherited]

Returns:
the 3D line attributes of data set column

Definition at line 316 of file KDChartLineDiagram.cpp.

References d, KDChart::LineDiagram::threeDLineAttributes(), and KDChart::ThreeDLineAttributesRole.

00317 {
00318     const QVariant attrs(
00319             d->attributesModel->headerData( column, Qt::Vertical,
00320                                             ThreeDLineAttributesRole ) );
00321     if( attrs.isValid() )
00322         return qVariantValue< ThreeDLineAttributes >( attrs );
00323     return threeDLineAttributes();
00324 }

ThreeDLineAttributes LineDiagram::threeDLineAttributes (  )  const [inherited]

Returns:
the global 3D line attributes

Definition at line 307 of file KDChartLineDiagram.cpp.

References d, and KDChart::ThreeDLineAttributesRole.

Referenced by KDChart::LineDiagram::threeDItemDepth(), and KDChart::LineDiagram::threeDLineAttributes().

00308 {
00309     return qVariantValue<ThreeDLineAttributes>(
00310         d->attributesModel->data( KDChart::ThreeDLineAttributesRole ) );
00311 }

QPair< QDateTime, QDateTime > LeveyJenningsDiagram::timeRange (  )  const

Returns the timerange of the diagram's data.

Definition at line 450 of file KDChartLeveyJenningsDiagram.cpp.

References ceilDay(), ceilHour(), d, floorDay(), floorHour(), and m.

Referenced by calculateDataBoundaries(), drawChanges(), paint(), and KDChart::LeveyJenningsAxis::paintAsAbscissa().

00451 {
00452     if( d->timeRange != QPair< QDateTime, QDateTime >() )
00453         return d->timeRange;
00454 
00455     const QAbstractItemModel& m = *model();
00456     const int rowCount = m.rowCount( rootIndex() );
00457 
00458     const QDateTime begin = m.data( m.index( 0, 3, rootIndex() ) ).toDateTime();
00459     const QDateTime end = m.data( m.index( rowCount - 1, 3, rootIndex() ) ).toDateTime();
00460 
00461     if( begin.secsTo( end ) > 86400 )
00462     {
00463         // if begin to end is more than 24h
00464         // round down/up to the prev/next midnight
00465         const QDate min = floorDay( begin );
00466         const QDate max = ceilDay( end );
00467         return QPair< QDateTime, QDateTime >( QDateTime( min ), QDateTime( max ) );
00468     }
00469     else if( begin.secsTo( end ) > 3600 )
00470     {
00471         // more than 1h: rond down up to the prex/next hour
00472         // if begin to end is more than 24h
00473         const QDateTime min = floorHour( begin );
00474         const QDateTime max = ceilHour( end );
00475         return QPair< QDateTime, QDateTime >( min, max );
00476     }
00477     return QPair< QDateTime, QDateTime >( begin, end );
00478 }

LineDiagram::LineType LineDiagram::type (  )  const [inherited]

Returns:
the type of the line diagram

Definition at line 150 of file KDChartLineDiagram.cpp.

References d.

Referenced by KDChart::LineDiagram::clone(), KDChart::LineDiagram::compare(), and drawDataPointSymbol().

00151 {
00152     return d->implementor->type();
00153 }

QString AbstractDiagram::unitPrefix ( Qt::Orientation  orientation  )  const [inherited]

Retrieves the axis unit prefix.

Returns the global unit prefix.

Parameters:
orientation The orientation of the axis.
Returns:
The axis unit prefix.
Parameters:
orientation the orientation of the axis
Returns:
the unit prefix

Definition at line 916 of file KDChartAbstractDiagram.cpp.

References d.

00917 {
00918     return d->unitPrefix[ orientation ];
00919 }

QString AbstractDiagram::unitPrefix ( int  column,
Qt::Orientation  orientation,
bool  fallback = false 
) const [inherited]

Retrieves the axis unit prefix for a specific column.

Returns the unit prefix for a special value.

Parameters:
column The column whose prefix should be retrieved.
orientation The orientation of the axis.
fallback If true, the prefix for all columns is returned, when none is set for the selected column.
Returns:
The axis unit prefix.
Parameters:
column the value which's prefix is requested
orientation the orientation of the axis
fallback if true, the global prefix is return when no specific one is set for that value
Returns:
the unit prefix

Definition at line 905 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().

00906 {
00907     if( !fallback || d->unitPrefixMap[ column ].contains( orientation ) )
00908         return d->unitPrefixMap[ column ][ orientation ];
00909     return d->unitPrefix[ orientation ];
00910 }

QString AbstractDiagram::unitSuffix ( Qt::Orientation  orientation  )  const [inherited]

Retrieves the axis unit suffix.

Returns the global unit suffix.

Parameters:
orientation The orientation of the axis.
Returns:
The axis unit suffix.
Parameters:
orientation the orientation of the axis
Returns:
the unit siffix

Definition at line 939 of file KDChartAbstractDiagram.cpp.

References d.

00940 {
00941     return d->unitSuffix[ orientation ];
00942 }

QString AbstractDiagram::unitSuffix ( int  column,
Qt::Orientation  orientation,
bool  fallback = false 
) const [inherited]

Retrieves the axis unit suffix for a specific column.

Returns the unit suffix for a special value.

Parameters:
column The column whose prefix should be retrieved.
orientation The orientation of the axis.
fallback If true, the suffix for all columns is returned, when none is set for the selected column.
Returns:
The axis unit suffix.
Parameters:
column the value which's suffix is requested
orientation the orientation of the axis
fallback if true, the global suffix is return when no specific one is set for that value
Returns:
the unit suffix

Definition at line 928 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().

00929 {
00930     if( !fallback || d->unitSuffixMap[ column ].contains( orientation ) )
00931         return d->unitSuffixMap[ column ][ orientation ];
00932     return d->unitSuffix[ orientation ];
00933 }

void AbstractDiagram::update (  )  const [inherited]

Definition at line 1116 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::doItemsLayout(), setExpectedMeanValue(), setExpectedStandardDeviation(), setFluidicsPackChangedSymbolPosition(), setFluidicsPackChanges(), setLotChangedSymbolPosition(), setScanLinePen(), setSensorChangedSymbolPosition(), setSensorChanges(), setSymbol(), and setTimeRange().

01117 {
01118     //qDebug("KDChart::AbstractDiagram::update() called");
01119     if( d->plane )
01120         d->plane->update();
01121 }

void KDChart::AbstractDiagram::useDefaultColors (  )  [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 994 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AttributesModel::PaletteTypeDefault.

00995 {
00996     d->attributesModel->setPaletteType( AttributesModel::PaletteTypeDefault );
00997 }

void KDChart::AbstractDiagram::useRainbowColors (  )  [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 1004 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AttributesModel::PaletteTypeRainbow.

01005 {
01006     d->attributesModel->setPaletteType( AttributesModel::PaletteTypeRainbow );
01007 }

bool AbstractDiagram::usesExternalAttributesModel (  )  const [virtual, inherited]

Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel.

See also:
setAttributesModel

Definition at line 309 of file KDChartAbstractDiagram.cpp.

References d.

00310 {
00311     return d->usesExternalAttributesModel();
00312 }

void KDChart::AbstractDiagram::useSubduedColors (  )  [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 999 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AttributesModel::PaletteTypeSubdued.

01000 {
01001     d->attributesModel->setPaletteType( AttributesModel::PaletteTypeSubdued );
01002 }

double AbstractDiagram::valueForCell ( int  row,
int  column 
) const [protected, inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.
Returns:
The value of the display role at the given row and column as a double.
Deprecated:

Definition at line 1110 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

01111 {
01112     return d->attributesModel->data(
01113             d->attributesModel->index( row, column, attributesModelRootIndex() ) ).toDouble();
01114 }

double LineDiagram::valueForCellTesting ( int  row,
int  column,
bool &  bOK,
bool  showHiddenCellsAsInvalid = false 
) const [protected, inherited]

Definition at line 403 of file KDChartLineDiagram.cpp.

References KDChart::AbstractDiagram::attributesModelRootIndex(), d, and KDChart::AbstractDiagram::isHidden().

Referenced by KDChart::LineDiagram::getCellValues().

00406 {
00407     double value;
00408     if( showHiddenCellsAsInvalid && isHidden( model()->index( row, column, rootIndex() ) ) )
00409         bOK = false;
00410     else
00411         value = d->attributesModel->data(
00412                     d->attributesModel->index( row, column, attributesModelRootIndex() )
00413                 ).toDouble( &bOK );
00414     return bOK ? value : 0.0;
00415 }

ValueTrackerAttributes LineDiagram::valueTrackerAttributes ( const QModelIndex &  index  )  const [inherited]

Returns the value tracker attributes of the model index index.

Definition at line 366 of file KDChartLineDiagram.cpp.

References d, and KDChart::ValueTrackerAttributesRole.

00368 {
00369     return qVariantValue<ValueTrackerAttributes>( d->attributesModel->data(
00370             d->attributesModel->mapFromSource( index ),
00371             KDChart::ValueTrackerAttributesRole ) );
00372 }

int AbstractDiagram::verticalOffset (  )  const [virtual, inherited]

[reimplemented]

Definition at line 961 of file KDChartAbstractDiagram.cpp.

00962 { return 0; }

QRect AbstractDiagram::visualRect ( const QModelIndex &  index  )  const [virtual, inherited]

[reimplemented]

Definition at line 945 of file KDChartAbstractDiagram.cpp.

References d.

00946 {
00947     return d->reverseMapper.boundingRect( index.row(), index.column() ).toRect();
00948 }

QRegion AbstractDiagram::visualRegion ( const QModelIndex &  index  )  const [virtual, inherited]

Definition at line 988 of file KDChartAbstractDiagram.cpp.

References d.

00989 {
00990     QPolygonF polygon = d->reverseMapper.polygon(index.row(), index.column());
00991     return polygon.isEmpty() ? QRegion() : QRegion( polygon.toPolygon() );
00992 }

QRegion AbstractDiagram::visualRegionForSelection ( const QItemSelection &  selection  )  const [virtual, inherited]

[reimplemented]

Definition at line 978 of file KDChartAbstractDiagram.cpp.

References d.

00979 {
00980     QPolygonF polygon;
00981     KDAB_FOREACH( const QModelIndex& index, selection.indexes() )
00982     {
00983         polygon << d->reverseMapper.polygon(index.row(), index.column());
00984     }
00985     return polygon.isEmpty() ? QRegion() : QRegion( polygon.toPolygon() );
00986 }


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