#include <KDChartLineDiagram.h>
Inheritance diagram for KDChart::LineDiagram:
It provides different subtypes which are set using setType.
Definition at line 49 of file KDChartLineDiagram.h.
Public Types | |
enum | LineType { Normal = 0, Stacked = 1, Percent = 2 } |
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 |
| |
bool | antiAliasing () const |
| |
virtual AttributesModel * | attributesModel () const |
Returns the AttributesModel, that is used by this diagram. | |
virtual KDChart::CartesianAxisList | axes () const |
| |
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. | |
virtual LineDiagram * | clone () 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. | |
AbstractCoordinatePlane * | coordinatePlane () 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< MarkerAttributes > | datasetMarkers () 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 column) const |
Retrieve the DataValueAttributes for the given dataset. | |
DataValueAttributes | dataValueAttributes () const |
Retrieve the DataValueAttributes speficied globally. | |
virtual void | doItemsLayout () |
[reimplemented] | |
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 column) const |
Retrieve the hidden status for the given dataset. | |
bool | isHidden () const |
Retrieve the hidden status speficied 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. | |
LineAttributes | lineAttributes (const QModelIndex &index) const |
| |
LineAttributes | lineAttributes (int column) const |
| |
LineAttributes | lineAttributes () const |
| |
LineDiagram (QWidget *parent=0, CartesianCoordinatePlane *plane=0) | |
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) |
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 AbstractCartesianDiagram * | referenceDiagram () const |
| |
virtual QPointF | referenceDiagramOffset () const |
| |
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. | |
virtual void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) |
[reimplemented] | |
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. | |
virtual void | setCoordinatePlane (AbstractCoordinatePlane *plane) |
[reimplemented] | |
void | setDatasetDimension (int dimension) |
Sets the dataset dimension of the diagram. | |
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 | setHidden (bool hidden) |
Hide (or unhide, resp. | |
void | setHidden (int column, 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 | 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. | |
virtual void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command) |
[reimplemented] | |
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 | setType (const LineType type) |
Sets the line diagram's type to type. | |
void | setUnitPrefix (const QString &prefix, Qt::Orientation orientation) |
Sets the unit prefix for all values. | |
void | setUnitPrefix (const QString &prefix, int column, Qt::Orientation orientation) |
Sets the unit prefix for one value. | |
void | setUnitSuffix (const QString &suffix, Qt::Orientation orientation) |
Sets the unit suffix for all values. | |
void | setUnitSuffix (const QString &suffix, int column, Qt::Orientation orientation) |
Sets the unit suffix for one value. | |
void | setValueTrackerAttributes (const QModelIndex &index, const ValueTrackerAttributes &a) |
Sets the value tracker attributes of the model index index to va. | |
virtual void | takeAxis (CartesianAxis *axis) |
Removes the axis from the diagram, without deleting it. | |
ThreeDLineAttributes | threeDLineAttributes (const QModelIndex &index) const |
| |
ThreeDLineAttributes | threeDLineAttributes (int column) const |
| |
ThreeDLineAttributes | threeDLineAttributes () const |
| |
LineType | type () const |
| |
QString | unitPrefix (Qt::Orientation orientation) const |
Returns the global unit prefix. | |
QString | unitPrefix (int column, Qt::Orientation orientation, bool fallback=false) const |
Returns the unit prefix for a special value. | |
QString | unitSuffix (Qt::Orientation orientation) const |
Returns the global unit suffix. | |
QString | unitSuffix (int column, Qt::Orientation orientation, bool fallback=false) const |
Returns the unit suffix for a special value. | |
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 | visualRegionForSelection (const QItemSelection &selection) const |
[reimplemented] | |
virtual | ~LineDiagram () |
Protected Member Functions | |
QModelIndex | attributesModelRootIndex () const |
virtual const QPair< QPointF, QPointF > | calculateDataBoundaries () const |
[reimplemented] | |
virtual bool | checkInvariants (bool justReturnTheStatus=false) const |
QModelIndex | columnToIndex (int column) const |
LineAttributes::MissingValuesPolicy | getCellValues (int row, int column, bool shiftCountedXValuesByHalfSection, double &valueX, double &valueY) const |
void | paint (PaintContext *paintContext) |
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context. | |
virtual void | paintDataValueTexts (QPainter *painter) |
void | paintEvent (QPaintEvent *) |
virtual void | paintMarkers (QPainter *painter) |
void | resizeEvent (QResizeEvent *) |
void | setAttributesModelRootIndex (const QModelIndex &) |
void | setDataBoundariesDirty () const |
virtual double | threeDItemDepth (int column) const |
| |
virtual double | threeDItemDepth (const QModelIndex &index) const |
| |
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 |
LineDiagram::LineDiagram | ( | QWidget * | parent = 0 , |
|
CartesianCoordinatePlane * | plane = 0 | |||
) |
Definition at line 61 of file KDChartLineDiagram.cpp.
Referenced by clone().
00061 : 00062 AbstractCartesianDiagram( new Private(), parent, plane ) 00063 { 00064 init(); 00065 }
LineDiagram::~LineDiagram | ( | ) | [virtual] |
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.
Definition at line 91 of file KDChartAbstractCartesianDiagram.cpp.
References d, and KDChart::AbstractCartesianDiagram::layoutPlanes().
00092 { 00093 if ( !d->axesList.contains( axis ) ) { 00094 d->axesList.append( axis ); 00095 axis->createObserver( this ); 00096 layoutPlanes(); 00097 } 00098 }
bool AbstractDiagram::allowOverlappingDataValueTexts | ( | ) | const [inherited] |
Definition at line 440 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::compare().
00441 { 00442 return d->allowOverlappingDataValueTexts; 00443 }
bool AbstractDiagram::antiAliasing | ( | ) | const [inherited] |
Definition at line 451 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::compare().
00452 { 00453 return d->antiAliasing; 00454 }
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.
Definition at line 280 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::AbstractDiagram::isHidden(), KDChart::AbstractDiagram::itemRowLabels(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::pen(), KDChart::AbstractCartesianDiagram::setAttributesModel(), KDChart::BarDiagram::setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractCartesianDiagram::setModel(), KDChart::AbstractDiagram::setPen(), and KDChart::TernaryLineDiagram::TernaryLineDiagram().
00281 { 00282 return d->attributesModel; 00283 }
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 302 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::itemRowLabels(), KDChart::Plotter::numberOfAbscissaSegments(), numberOfAbscissaSegments(), KDChart::BarDiagram::numberOfAbscissaSegments(), KDChart::Plotter::numberOfOrdinateSegments(), numberOfOrdinateSegments(), KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::AbstractDiagram::valueForCell(), and valueForCellTesting().
00303 { 00304 if ( !d->attributesModelRootIndex.isValid() ) 00305 d->attributesModelRootIndex = d->attributesModel->mapFromSource( rootIndex() ); 00306 return d->attributesModelRootIndex; 00307 }
KDChart::CartesianAxisList AbstractCartesianDiagram::axes | ( | ) | const [virtual, inherited] |
Definition at line 110 of file KDChartAbstractCartesianDiagram.cpp.
References d.
Referenced by KDChart::Widget::setType(), and KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().
00111 { 00112 return d->axesList; 00113 }
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.
index | The index of the datapoint in the model. |
Definition at line 838 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::brush(), KDChart::AttributesModel::data(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().
00839 { 00840 if( datasetDimension() > 1 ) 00841 return brush( index.column() ); 00842 return qVariantValue<QBrush>( 00843 attributesModel()->data( 00844 attributesModel()->mapFromSource( index ), 00845 DatasetBrushRole ) ); 00846 }
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.
dataset | The dataset to retrieve the brush for. |
Definition at line 828 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().
00829 { 00830 if( datasetDimension() > 1 ) 00831 dataset /= datasetDimension(); 00832 return qVariantValue<QBrush>( 00833 attributesModel()->data( 00834 attributesModel()->mapFromSource( columnToIndex( dataset ) ), 00835 DatasetBrushRole ) ); 00836 }
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.
Definition at line 822 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetBrushRole.
Referenced by KDChart::AbstractDiagram::brush(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().
00823 { 00824 return qVariantValue<QBrush>( 00825 attributesModel()->data( DatasetBrushRole ) ); 00826 }
const QPair< QPointF, QPointF > LineDiagram::calculateDataBoundaries | ( | ) | const [protected, virtual] |
[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 360 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), and d.
00361 { 00362 if ( !checkInvariants( true ) ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) ); 00363 00364 // note: calculateDataBoundaries() is ignoring the hidden flags. 00365 // That's not a bug but a feature: Hiding data does not mean removing them. 00366 // For totally removing data from KD Chart's view people can use e.g. a proxy model ... 00367 00368 // calculate boundaries for different line types Normal - Stacked - Percent - Default Normal 00369 return d->implementor->calculateDataBoundaries(); 00370 }
bool AbstractDiagram::checkInvariants | ( | bool | justReturnTheStatus = false |
) | const [protected, virtual, inherited] |
Definition at line 1060 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), KDChart::Plotter::calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), calculateDataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Plotter::paint(), KDChart::PieDiagram::paint(), paint(), KDChart::BarDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().
01061 { 01062 if( ! justReturnTheStatus ){ 01063 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()", 01064 "There is no usable model set, for the diagram." ); 01065 01066 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()", 01067 "There is no usable coordinate plane set, for the diagram." ); 01068 } 01069 return model() && coordinatePlane(); 01070 }
LineDiagram * LineDiagram::clone | ( | ) | const [virtual] |
Creates an exact copy of this diagram.
Definition at line 83 of file KDChartLineDiagram.cpp.
References d, LineDiagram(), setType(), and type().
00084 { 00085 LineDiagram* newDiagram = new LineDiagram( new Private( *d ) ); 00086 newDiagram->setType( type() ); 00087 return newDiagram; 00088 }
QModelIndex AbstractDiagram::columnToIndex | ( | int | column | ) | const [protected, inherited] |
Definition at line 309 of file KDChartAbstractDiagram.cpp.
Referenced by KDChart::BarDiagram::barAttributes(), KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::AbstractDiagram::isHidden(), KDChart::Plotter::lineAttributes(), lineAttributes(), KDChart::AbstractDiagram::pen(), KDChart::AbstractPieDiagram::pieAttributes(), KDChart::BarDiagram::threeDBarAttributes(), KDChart::Plotter::threeDLineAttributes(), threeDLineAttributes(), and KDChart::AbstractPieDiagram::threeDPieAttributes().
00310 { // FIXME (Mirko): shouldn't this be headerData? instead of the index for the first row? 00311 if( model() ) 00312 return QModelIndex( model()->index( 0, column, rootIndex() ) ); 00313 return QModelIndex(); 00314 }
bool AbstractDiagram::compare | ( | const AbstractDiagram * | other | ) | const [inherited] |
Returns true if both diagrams have the same settings.
Definition at line 129 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::allowOverlappingDataValueTexts(), KDChart::AbstractDiagram::antiAliasing(), KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::compare(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::percentMode().
00130 { 00131 if( other == this ) return true; 00132 if( ! other ){ 00133 //qDebug() << "AbstractDiagram::compare() cannot compare to Null pointer"; 00134 return false; 00135 } 00136 /* 00137 qDebug() << "\n AbstractDiagram::compare() QAbstractScrollArea:"; 00138 // compare QAbstractScrollArea properties 00139 qDebug() << 00140 ((horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00141 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy())); 00142 qDebug() << "AbstractDiagram::compare() QFrame:"; 00143 // compare QFrame properties 00144 qDebug() << 00145 ((frameShadow() == other->frameShadow()) && 00146 (frameShape() == other->frameShape()) && 00147 (frameWidth() == other->frameWidth()) && 00148 (lineWidth() == other->lineWidth()) && 00149 (midLineWidth() == other->midLineWidth())); 00150 qDebug() << "AbstractDiagram::compare() QAbstractItemView:"; 00151 // compare QAbstractItemView properties 00152 qDebug() << 00153 ((alternatingRowColors() == other->alternatingRowColors()) && 00154 (hasAutoScroll() == other->hasAutoScroll()) && 00155 #if QT_VERSION > 0x040199 00156 (dragDropMode() == other->dragDropMode()) && 00157 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00158 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00159 (verticalScrollMode() == other->verticalScrollMode()) && 00160 #endif 00161 (dragEnabled() == other->dragEnabled()) && 00162 (editTriggers() == other->editTriggers()) && 00163 (iconSize() == other->iconSize()) && 00164 (selectionBehavior() == other->selectionBehavior()) && 00165 (selectionMode() == other->selectionMode()) && 00166 (showDropIndicator() == other->showDropIndicator()) && 00167 (tabKeyNavigation() == other->tabKeyNavigation()) && 00168 (textElideMode() == other->textElideMode())); 00169 qDebug() << "AbstractDiagram::compare() AttributesModel: "; 00170 // compare all of the properties stored in the attributes model 00171 qDebug() << attributesModel()->compare( other->attributesModel() ); 00172 qDebug() << "AbstractDiagram::compare() own:"; 00173 // compare own properties 00174 qDebug() << 00175 ((rootIndex().column() == other->rootIndex().column()) && 00176 (rootIndex().row() == other->rootIndex().row()) && 00177 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00178 (antiAliasing() == other->antiAliasing()) && 00179 (percentMode() == other->percentMode()) && 00180 (datasetDimension() == other->datasetDimension())); 00181 */ 00182 return // compare QAbstractScrollArea properties 00183 (horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00184 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy()) && 00185 // compare QFrame properties 00186 (frameShadow() == other->frameShadow()) && 00187 (frameShape() == other->frameShape()) && 00188 // frameWidth is a read-only property defined by the style, it should not be in here: 00189 // (frameWidth() == other->frameWidth()) && 00190 (lineWidth() == other->lineWidth()) && 00191 (midLineWidth() == other->midLineWidth()) && 00192 // compare QAbstractItemView properties 00193 (alternatingRowColors() == other->alternatingRowColors()) && 00194 (hasAutoScroll() == other->hasAutoScroll()) && 00195 #if QT_VERSION > 0x040199 00196 (dragDropMode() == other->dragDropMode()) && 00197 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00198 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00199 (verticalScrollMode() == other->verticalScrollMode()) && 00200 #endif 00201 (dragEnabled() == other->dragEnabled()) && 00202 (editTriggers() == other->editTriggers()) && 00203 (iconSize() == other->iconSize()) && 00204 (selectionBehavior() == other->selectionBehavior()) && 00205 (selectionMode() == other->selectionMode()) && 00206 (showDropIndicator() == other->showDropIndicator()) && 00207 (tabKeyNavigation() == other->tabKeyNavigation()) && 00208 (textElideMode() == other->textElideMode()) && 00209 // compare all of the properties stored in the attributes model 00210 attributesModel()->compare( other->attributesModel() ) && 00211 // compare own properties 00212 (rootIndex().column() == other->rootIndex().column()) && 00213 (rootIndex().row() == other->rootIndex().row()) && 00214 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00215 (antiAliasing() == other->antiAliasing()) && 00216 (percentMode() == other->percentMode()) && 00217 (datasetDimension() == other->datasetDimension()); 00218 }
bool AbstractCartesianDiagram::compare | ( | const AbstractCartesianDiagram * | other | ) | const [inherited] |
Returns true if both diagrams have the same settings.
Definition at line 46 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractCartesianDiagram::referenceDiagram(), and KDChart::AbstractCartesianDiagram::referenceDiagramOffset().
00047 { 00048 if( other == this ) return true; 00049 if( ! other ){ 00050 //qDebug() << "AbstractCartesianDiagram::compare() cannot compare to Null pointer"; 00051 return false; 00052 } 00053 /* 00054 qDebug() << "\n AbstractCartesianDiagram::compare():"; 00055 // compare own properties 00056 qDebug() << 00057 ((referenceDiagram() == other->referenceDiagram()) && 00058 ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset()))); 00059 */ 00060 return // compare the base class 00061 ( static_cast<const AbstractDiagram*>(this)->compare( other ) ) && 00062 // compare own properties 00063 (referenceDiagram() == other->referenceDiagram()) && 00064 ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset())); 00065 }
bool LineDiagram::compare | ( | const LineDiagram * | other | ) | const |
Returns true if both diagrams have the same settings.
Definition at line 91 of file KDChartLineDiagram.cpp.
References type().
00092 { 00093 if( other == this ) return true; 00094 if( ! other ){ 00095 return false; 00096 } 00097 /* 00098 qDebug() <<"\n LineDiagram::compare():"; 00099 // compare own properties 00100 qDebug() << (type() == other->type()); 00101 */ 00102 return // compare the base class 00103 ( static_cast<const AbstractCartesianDiagram*>(this)->compare( other ) ) && 00104 // compare own properties 00105 (type() == other->type()); 00106 }
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.
Definition at line 220 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().
00221 { 00222 return d->plane; 00223 }
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 225 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::Plotter::paint(), paint(), and KDChart::BarDiagram::paint().
00226 { 00227 if( d->databoundariesDirty ){ 00228 d->databoundaries = calculateDataBoundaries (); 00229 d->databoundariesDirty = false; 00230 } 00231 return d->databoundaries; 00232 }
void AbstractDiagram::dataChanged | ( | const QModelIndex & | topLeft, | |
const QModelIndex & | bottomRight | |||
) | [virtual, inherited] |
[reimplemented]
Definition at line 330 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::setDataBoundariesDirty().
00332 { 00333 Q_UNUSED( topLeft ); 00334 Q_UNUSED( bottomRight ); 00335 // We are still too dumb to do intelligent updates... 00336 setDataBoundariesDirty(); 00337 scheduleDelayedItemsLayout(); 00338 }
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.
Definition at line 1018 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().
Referenced by KDChart::Legend::setBrushesFromDiagram().
01019 { 01020 QList<QBrush> ret; 01021 if( model() == 0 ) 01022 return ret; 01023 01024 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex()); 01025 for( int i = 0; i < columnCount / datasetDimension(); ++i ) 01026 ret << qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetBrushRole ) ); 01027 01028 return ret; 01029 }
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.
Definition at line 1072 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(), getCellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractDiagram::pen(), KDChart::AbstractDiagram::setPen(), KDChart::Plotter::setType(), and setType().
01073 { 01074 return d->datasetDimension; 01075 }
QStringList AbstractDiagram::datasetLabels | ( | ) | const [inherited] |
The set of dataset labels currently displayed, for use in legends, etc.
Definition at line 1005 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AttributesModel::headerData().
01006 { 01007 QStringList ret; 01008 if( model() == 0 ) 01009 return ret; 01010 01011 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex()); 01012 for( int i = 0; i < columnCount / datasetDimension(); ++i ) 01013 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString(); 01014 01015 return ret; 01016 }
QList< MarkerAttributes > AbstractDiagram::datasetMarkers | ( | ) | const [inherited] |
The set of dataset markers currently used, for use in legends, etc.
Definition at line 1044 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::DataValueLabelAttributesRole.
01045 { 01046 QList<MarkerAttributes> ret; 01047 if( model() == 0 ) 01048 return ret; 01049 01050 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex()); 01051 for( int i = 0; i < columnCount / datasetDimension(); ++i ) 01052 { 01053 const DataValueAttributes a = 01054 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataValueLabelAttributesRole ) ); 01055 ret << a.markerAttributes(); 01056 } 01057 return ret; 01058 }
QList< QPen > AbstractDiagram::datasetPens | ( | ) | const [inherited] |
The set of dataset pens currently used, for use in legends, etc.
Definition at line 1031 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::DatasetPenRole.
01032 { 01033 QList<QPen> ret; 01034 if( model() == 0 ) 01035 return ret; 01036 01037 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex()); 01038 for( int i = 0; i < columnCount / datasetDimension(); ++i ) 01039 ret << qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole ) ); 01040 01041 return ret; 01042 }
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.
index | The datapoint to retrieve the attributes for. |
Definition at line 421 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataValueLabelAttributesRole.
00422 { 00423 return qVariantValue<DataValueAttributes>( 00424 attributesModel()->data( attributesModel()->mapFromSource(index), 00425 KDChart::DataValueLabelAttributesRole ) ); 00426 }
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | int | column | ) | 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.
column | The dataset to retrieve the attributes for. |
Definition at line 414 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), and KDChart::DataValueLabelAttributesRole.
00415 { 00416 return qVariantValue<DataValueAttributes>( 00417 attributesModel()->data( attributesModel()->mapFromSource(columnToIndex( column )), 00418 KDChart::DataValueLabelAttributesRole ) ); 00419 }
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | ) | const [inherited] |
Retrieve the DataValueAttributes speficied globally.
This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 408 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DataValueLabelAttributesRole, and KDChart::AttributesModel::modelData().
Referenced by KDChart::AbstractDiagram::paintDataValueText(), KDChart::AbstractDiagram::paintMarker(), and KDChart::TernaryLineDiagram::TernaryLineDiagram().
00409 { 00410 return qVariantValue<DataValueAttributes>( 00411 attributesModel()->modelData( KDChart::DataValueLabelAttributesRole ) ); 00412 }
void AbstractDiagram::doItemsLayout | ( | ) | [virtual, inherited] |
[reimplemented]
Definition at line 321 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().
00322 { 00323 if ( d->plane ) { 00324 d->plane->layoutDiagrams(); 00325 update(); 00326 } 00327 QAbstractItemView::doItemsLayout(); 00328 }
LineAttributes::MissingValuesPolicy LineDiagram::getCellValues | ( | int | row, | |
int | column, | |||
bool | shiftCountedXValuesByHalfSection, | |||
double & | valueX, | |||
double & | valueY | |||
) | const [protected] |
Definition at line 399 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::datasetDimension(), lineAttributes(), KDChart::LineAttributes::missingValuesPolicy(), KDChart::LineAttributes::MissingValuesPolicyIgnored, and valueForCellTesting().
00403 { 00404 LineAttributes::MissingValuesPolicy policy; 00405 00406 bool bOK = true; 00407 valueX = ( datasetDimension() > 1 && column > 0 ) 00408 ? valueForCellTesting( row, column-1, bOK, true ) 00409 : ((shiftCountedXValuesByHalfSection ? 0.5 : 0.0) + row); 00410 if( bOK ) 00411 valueY = valueForCellTesting( row, column, bOK, true ); 00412 if( bOK ){ 00413 policy = LineAttributes::MissingValuesPolicyIgnored; 00414 }else{ 00415 // missing value: find out the policy 00416 QModelIndex index = model()->index( row, column, rootIndex() ); 00417 LineAttributes la = lineAttributes( index ); 00418 policy = la.missingValuesPolicy(); 00419 } 00420 return policy; 00421 }
int AbstractDiagram::horizontalOffset | ( | ) | const [virtual, inherited] |
QModelIndex AbstractDiagram::indexAt | ( | const QPoint & | point | ) | const [virtual, inherited] |
[reimplemented]
Definition at line 1098 of file KDChartAbstractDiagram.cpp.
References d.
01099 { 01100 return d->indexAt( point ); 01101 }
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 1103 of file KDChartAbstractDiagram.cpp.
References d.
01104 { 01105 return d->indexesAt( point ); 01106 }
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.
index | The datapoint to retrieve the hidden status for. |
Definition at line 380 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataHiddenRole.
00381 { 00382 return qVariantValue<bool>( 00383 attributesModel()->data( 00384 attributesModel()->mapFromSource(index), 00385 DataHiddenRole ) ); 00386 }
bool AbstractDiagram::isHidden | ( | int | column | ) | 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.
column | The dataset to retrieve the hidden status for. |
Definition at line 373 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), and KDChart::DataHiddenRole.
00374 { 00375 return qVariantValue<bool>( 00376 attributesModel()->data( 00377 attributesModel()->mapFromSource(columnToIndex( column )), 00378 DataHiddenRole ) ); 00379 }
bool AbstractDiagram::isHidden | ( | ) | const [inherited] |
Retrieve the hidden status speficied globally.
This will fall back automatically to the default settings ( = not hidden), if there are no specific settings.
Definition at line 367 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DataHiddenRole, and KDChart::AttributesModel::modelData().
Referenced by valueForCellTesting().
00368 { 00369 return qVariantValue<bool>( 00370 attributesModel()->modelData( DataHiddenRole ) ); 00371 }
bool AbstractDiagram::isIndexHidden | ( | const QModelIndex & | index | ) | const [virtual, inherited] |
QStringList AbstractDiagram::itemRowLabels | ( | ) | const [inherited] |
The set of item row labels currently displayed, for use in Abscissa axes, etc.
Definition at line 989 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::rowCount(), KDChart::AbstractDiagram::unitPrefix(), and KDChart::AbstractDiagram::unitSuffix().
00990 { 00991 QStringList ret; 00992 if( model() ){ 00993 //qDebug() << "AbstractDiagram::itemRowLabels(): " << attributesModel()->rowCount(attributesModelRootIndex()) << "entries"; 00994 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex()); 00995 for( int i = 0; i < rowCount; ++i ){ 00996 //qDebug() << "item row label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString(); 00997 ret << unitPrefix( i, Qt::Horizontal, true ) + 00998 attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString() + 00999 unitSuffix( i, Qt::Horizontal, true ); 01000 } 01001 } 01002 return ret; 01003 }
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::setDatasetDimension(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::Plotter::setType(), 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 115 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractCoordinatePlane::layoutPlanes().
Referenced by KDChart::AbstractCartesianDiagram::addAxis(), and KDChart::AbstractCartesianDiagram::takeAxis().
00116 { 00117 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes()"; 00118 AbstractCoordinatePlane* plane = coordinatePlane(); 00119 if( plane ){ 00120 plane->layoutPlanes(); 00121 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes() OK"; 00122 } 00123 }
LineAttributes LineDiagram::lineAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 235 of file KDChartLineDiagram.cpp.
References d, and KDChart::LineAttributesRole.
00237 { 00238 return qVariantValue<LineAttributes>( 00239 d->attributesModel->data( 00240 d->attributesModel->mapFromSource(index), 00241 KDChart::LineAttributesRole ) ); 00242 }
LineAttributes LineDiagram::lineAttributes | ( | int | column | ) | const |
Definition at line 224 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::columnToIndex(), d, and KDChart::LineAttributesRole.
00225 { 00226 return qVariantValue<LineAttributes>( 00227 d->attributesModel->data( 00228 d->attributesModel->mapFromSource( columnToIndex( column ) ), 00229 KDChart::LineAttributesRole ) ); 00230 }
LineAttributes LineDiagram::lineAttributes | ( | ) | const |
Definition at line 215 of file KDChartLineDiagram.cpp.
References d, and KDChart::LineAttributesRole.
Referenced by getCellValues().
00216 { 00217 return qVariantValue<LineAttributes>( 00218 d->attributesModel->data( KDChart::LineAttributesRole ) ); 00219 }
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::setModel().
QModelIndex AbstractDiagram::moveCursor | ( | CursorAction | cursorAction, | |
Qt::KeyboardModifiers | modifiers | |||
) | [virtual, inherited] |
const int LineDiagram::numberOfAbscissaSegments | ( | ) | const [virtual] |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 450 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
00451 { 00452 return d->attributesModel->rowCount(attributesModelRootIndex()); 00453 }
const int LineDiagram::numberOfOrdinateSegments | ( | ) | const [virtual] |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 455 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
00456 { 00457 return d->attributesModel->columnCount(attributesModelRootIndex()); 00458 }
void LineDiagram::paint | ( | PaintContext * | paintContext | ) | [protected, virtual] |
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.
paintContext | All information needed for painting. |
Implements KDChart::AbstractDiagram.
Definition at line 423 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::PaintContext::coordinatePlane(), d, KDChart::AbstractDiagram::dataBoundaries(), KDChart::PaintContext::painter(), KDChart::PaintContext::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::sharedAxisMasterPlane().
Referenced by paintEvent().
00424 { 00425 // note: Not having any data model assigned is no bug 00426 // but we can not draw a diagram then either. 00427 if ( !checkInvariants( true ) ) return; 00428 if ( !AbstractGrid::isBoundariesValid(dataBoundaries()) ) return; 00429 const PainterSaver p( ctx->painter() ); 00430 if( model()->rowCount() == 0 || model()->columnCount() == 0 ) 00431 return; // nothing to paint for us 00432 00433 AbstractCoordinatePlane* const plane = ctx->coordinatePlane(); 00434 ctx->setCoordinatePlane( plane->sharedAxisMasterPlane( ctx->painter() ) ); 00435 00436 00437 // paint different line types Normal - Stacked - Percent - Default Normal 00438 d->implementor->paint( ctx ); 00439 00440 ctx->setCoordinatePlane( plane ); 00441 }
void AbstractDiagram::paintDataValueText | ( | QPainter * | painter, | |
const QModelIndex & | index, | |||
const QPointF & | pos, | |||
double | value | |||
) | [inherited] |
Definition at line 468 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::DataValueAttributes::isVisible(), KDChartEnums::MeasureOrientationMinimum, KDChart::DataValueAttributes::position(), KDChart::DataValueAttributes::prefix(), KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().
Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::AbstractDiagram::paintDataValueTexts().
00472 { 00473 // paint one data series 00474 const DataValueAttributes a( dataValueAttributes(index) ); 00475 if ( !a.isVisible() ) return; 00476 00477 // handle decimal digits 00478 int decimalDigits = a.decimalDigits(); 00479 int decimalPos = QString::number( value ).indexOf( QLatin1Char( '.' ) ); 00480 QString roundedValue; 00481 if ( a.dataLabel().isNull() ) { 00482 if ( decimalPos > 0 && value != 0 ) 00483 roundedValue = roundValues ( value, decimalPos, decimalDigits ); 00484 else 00485 roundedValue = QString::number( value ); 00486 } else 00487 roundedValue = a.dataLabel(); 00488 // handle prefix and suffix 00489 if ( !a.prefix().isNull() ) 00490 roundedValue.prepend( a.prefix() ); 00491 00492 if ( !a.suffix().isNull() ) 00493 roundedValue.append( a.suffix() ); 00494 00495 const TextAttributes ta( a.textAttributes() ); 00496 // FIXME draw the non-text bits, background, etc 00497 if ( ta.isVisible() ) { 00498 00499 QPointF pt( pos ); 00500 /* for debugging: 00501 PainterSaver painterSaver( painter ); 00502 painter->setPen( Qt::black ); 00503 painter->drawLine( pos - QPointF( 1,1), pos + QPointF( 1,1) ); 00504 painter->drawLine( pos - QPointF(-1,1), pos + QPointF(-1,1) ); 00505 */ 00506 00507 QTextDocument doc; 00508 if( Qt::mightBeRichText( roundedValue ) ) 00509 doc.setHtml( roundedValue ); 00510 else 00511 doc.setPlainText( roundedValue ); 00512 00513 const RelativePosition relPos( a.position( value >= 0.0 ) ); 00514 const Qt::Alignment alignBottomLeft = Qt::AlignBottom | Qt::AlignLeft; 00515 const QFont calculatedFont( ta.calculatedFont( d->plane, KDChartEnums::MeasureOrientationMinimum ) ); 00516 const QRectF boundRect( d->cachedFontMetrics( calculatedFont, painter->device() )->boundingRect( doc.toPlainText() ) ); 00517 00518 // To place correctly 00519 pt.ry() -= boundRect.height(); 00520 00521 //qDebug() << "calculatedFont's point size:" << calculatedFont.pointSizeF(); 00522 // adjust the text start point position, if alignment is not Bottom/Left 00523 if( (relPos.alignment() & alignBottomLeft) != alignBottomLeft ){ 00524 if( relPos.alignment() & Qt::AlignRight ) 00525 pt.rx() -= boundRect.width(); 00526 else if( relPos.alignment() & Qt::AlignHCenter ) 00527 pt.rx() -= 0.5 * boundRect.width(); 00528 00529 if( relPos.alignment() & Qt::AlignTop ) 00530 pt.ry() += boundRect.height(); 00531 else if( relPos.alignment() & Qt::AlignVCenter ) 00532 pt.ry() += 0.5 * boundRect.height(); 00533 } 00534 00535 // FIXME draw the non-text bits, background, etc 00536 00537 if ( a.showRepetitiveDataLabels() || 00538 pos.x() <= d->lastX || 00539 d->lastRoundedValue != roundedValue ) { 00540 d->lastRoundedValue = roundedValue; 00541 d->lastX = pos.x(); 00542 PainterSaver painterSaver( painter ); 00543 00544 doc.setDefaultFont( calculatedFont ); 00545 QAbstractTextDocumentLayout::PaintContext context; 00546 context.palette = palette(); 00547 context.palette.setColor(QPalette::Text, ta.pen().color() ); 00548 00549 painter->translate( pt ); 00550 painter->rotate( ta.rotation() ); 00551 00552 QAbstractTextDocumentLayout* layout = doc.documentLayout(); 00553 layout->draw( painter, context ); 00554 } 00555 } 00556 }
void AbstractDiagram::paintDataValueTexts | ( | QPainter * | painter | ) | [protected, virtual, inherited] |
Definition at line 584 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractCoordinatePlane::translate().
00585 { 00586 if ( !checkInvariants() ) return; 00587 const int rowCount = model()->rowCount(rootIndex()); 00588 const int columnCount = model()->columnCount(rootIndex()); 00589 for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) { 00590 for ( int j=0; j< rowCount; ++j ) { 00591 const QModelIndex index = model()->index( j, i, rootIndex() ); 00592 double value = model()->data( index ).toDouble(); 00593 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) ); 00594 paintDataValueText( painter, index, pos, value ); 00595 } 00596 } 00597 }
void LineDiagram::paintEvent | ( | QPaintEvent * | ) | [protected] |
Definition at line 373 of file KDChartLineDiagram.cpp.
References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().
00374 { 00375 //qDebug() << "starting LineDiagram::paintEvent ( QPaintEvent*)"; 00376 QPainter painter ( viewport() ); 00377 PaintContext ctx; 00378 ctx.setPainter ( &painter ); 00379 ctx.setRectangle ( QRectF ( 0, 0, width(), height() ) ); 00380 paint ( &ctx ); 00381 //qDebug() << " LineDiagram::paintEvent ( QPaintEvent*) ended."; 00382 }
void AbstractDiagram::paintMarker | ( | QPainter * | painter, | |
const QModelIndex & | index, | |||
const QPointF & | pos | |||
) | [inherited] |
Definition at line 600 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(), d, KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(), KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(), KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().
00603 { 00604 if ( !checkInvariants() ) return; 00605 DataValueAttributes a = dataValueAttributes(index); 00606 if ( !a.isVisible() ) return; 00607 const MarkerAttributes &ma = a.markerAttributes(); 00608 if ( !ma.isVisible() ) return; 00609 00610 PainterSaver painterSaver( painter ); 00611 QSizeF maSize( ma.markerSize() ); 00612 QBrush indexBrush( brush( index ) ); 00613 QPen indexPen( ma.pen() ); 00614 if ( ma.markerColor().isValid() ) 00615 indexBrush.setColor( ma.markerColor() ); 00616 00617 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize ); 00618 00619 // workaround: BC cannot be changed, otherwise we would pass the 00620 // index down to next-lower paintMarker function. So far, we 00621 // basically save a circle of radius maSize at pos in the 00622 // reverseMapper. This means that ^^^ this version of paintMarker 00623 // needs to be called to reverse-map the marker. 00624 d->reverseMapper.addCircle( index.row(), index.column(), pos, 2 * maSize ); 00625 }
void AbstractDiagram::paintMarker | ( | QPainter * | painter, | |
const MarkerAttributes & | markerAttributes, | |||
const QBrush & | brush, | |||
const QPen & | , | |||
const QPointF & | point, | |||
const QSizeF & | size | |||
) | [virtual, inherited] |
Definition at line 627 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, and KDChart::MarkerAttributes::markerStyle().
Referenced by KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::MarkerLayoutItem::paintIntoRect(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().
00633 { 00634 const QPen oldPen( painter->pen() ); 00635 // Pen is used to paint 4Pixels - 1 Pixel - Ring and FastCross types. 00636 // make sure to use the brush color - see above in those cases. 00637 const bool isFourPixels = (markerAttributes.markerStyle() == MarkerAttributes::Marker4Pixels); 00638 if( isFourPixels || (markerAttributes.markerStyle() == MarkerAttributes::Marker1Pixel) ){ 00639 // for high-performance point charts with tiny point markers: 00640 painter->setPen( QPen( brush.color().light() ) ); 00641 if( isFourPixels ){ 00642 const qreal x = pos.x(); 00643 const qreal y = pos.y(); 00644 painter->drawLine( QPointF(x-1.0,y-1.0), 00645 QPointF(x+1.0,y-1.0) ); 00646 painter->drawLine( QPointF(x-1.0,y), 00647 QPointF(x+1.0,y) ); 00648 painter->drawLine( QPointF(x-1.0,y+1.0), 00649 QPointF(x+1.0,y+1.0) ); 00650 } 00651 painter->drawPoint( pos ); 00652 }else{ 00653 PainterSaver painterSaver( painter ); 00654 // we only a solid line surrounding the markers 00655 QPen painterPen( pen ); 00656 painterPen.setStyle( Qt::SolidLine ); 00657 painter->setPen( painterPen ); 00658 painter->setBrush( brush ); 00659 painter->setRenderHint ( QPainter::Antialiasing ); 00660 painter->translate( pos ); 00661 switch ( markerAttributes.markerStyle() ) { 00662 case MarkerAttributes::MarkerCircle: 00663 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2, 00664 maSize.height(), maSize.width()) ); 00665 break; 00666 case MarkerAttributes::MarkerSquare: 00667 { 00668 QRectF rect( 0 - maSize.width()/2, 0 - maSize.height()/2, 00669 maSize.width(), maSize.height() ); 00670 painter->drawRect( rect ); 00671 break; 00672 } 00673 case MarkerAttributes::MarkerDiamond: 00674 { 00675 QVector <QPointF > diamondPoints; 00676 QPointF top, left, bottom, right; 00677 top = QPointF( 0, 0 - maSize.height()/2 ); 00678 left = QPointF( 0 - maSize.width()/2, 0 ); 00679 bottom = QPointF( 0, maSize.height()/2 ); 00680 right = QPointF( maSize.width()/2, 0 ); 00681 diamondPoints << top << left << bottom << right; 00682 painter->drawPolygon( diamondPoints ); 00683 break; 00684 } 00685 // both handled on top of the method: 00686 case MarkerAttributes::Marker1Pixel: 00687 case MarkerAttributes::Marker4Pixels: 00688 break; 00689 case MarkerAttributes::MarkerRing: 00690 { 00691 painter->setPen( QPen( brush.color() ) ); 00692 painter->setBrush( Qt::NoBrush ); 00693 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2, 00694 maSize.height(), maSize.width()) ); 00695 break; 00696 } 00697 case MarkerAttributes::MarkerCross: 00698 { 00699 QRectF rect( maSize.width()*-0.5, maSize.height()*-0.2, 00700 maSize.width(), maSize.height()*0.4 ); 00701 painter->drawRect( rect ); 00702 rect.setTopLeft(QPointF( maSize.width()*-0.2, maSize.height()*-0.5 )); 00703 rect.setSize(QSizeF( maSize.width()*0.4, maSize.height() )); 00704 painter->drawRect( rect ); 00705 break; 00706 } 00707 case MarkerAttributes::MarkerFastCross: 00708 { 00709 QPointF left, right, top, bottom; 00710 left = QPointF( -maSize.width()/2, 0 ); 00711 right = QPointF( maSize.width()/2, 0 ); 00712 top = QPointF( 0, -maSize.height()/2 ); 00713 bottom= QPointF( 0, maSize.height()/2 ); 00714 painter->setPen( QPen( brush.color() ) ); 00715 painter->drawLine( left, right ); 00716 painter->drawLine( top, bottom ); 00717 break; 00718 } 00719 default: 00720 Q_ASSERT_X ( false, "paintMarkers()", 00721 "Type item does not match a defined Marker Type." ); 00722 } 00723 } 00724 painter->setPen( oldPen ); 00725 }
void AbstractDiagram::paintMarkers | ( | QPainter * | painter | ) | [protected, virtual, inherited] |
Definition at line 727 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractCoordinatePlane::translate().
00728 { 00729 if ( !checkInvariants() ) return; 00730 const int rowCount = model()->rowCount(rootIndex()); 00731 const int columnCount = model()->columnCount(rootIndex()); 00732 for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) { 00733 for ( int j=0; j< rowCount; ++j ) { 00734 const QModelIndex index = model()->index( j, i, rootIndex() ); 00735 double value = model()->data( index ).toDouble(); 00736 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) ); 00737 paintMarker( painter, index, pos ); 00738 } 00739 } 00740 }
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.
index | The index of the datapoint in the model. |
Definition at line 788 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, and KDChart::AbstractDiagram::pen().
00789 { 00790 if( datasetDimension() > 1 ) 00791 return pen( index.column() ); 00792 return qVariantValue<QPen>( 00793 attributesModel()->data( 00794 attributesModel()->mapFromSource( index ), 00795 DatasetPenRole ) ); 00796 }
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.
dataset | The dataset to retrieve the pen for. |
Definition at line 777 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::DatasetPenRole.
00778 { 00779 if( datasetDimension() > 1 ) 00780 dataset /= datasetDimension(); 00781 00782 return qVariantValue<QPen>( 00783 attributesModel()->data( 00784 attributesModel()->mapFromSource( columnToIndex( dataset ) ), 00785 DatasetPenRole ) ); 00786 }
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.
Definition at line 771 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetPenRole.
Referenced by KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), and KDChart::AbstractDiagram::pen().
00772 { 00773 return qVariantValue<QPen>( 00774 attributesModel()->data( DatasetPenRole ) ); 00775 }
bool AbstractDiagram::percentMode | ( | ) | const [inherited] |
Definition at line 462 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::compare(), and KDChart::CartesianCoordinatePlane::getDataDimensionsList().
00463 { 00464 return d->percent; 00465 }
void KDChart::AbstractDiagram::propertiesChanged | ( | ) | [signal, inherited] |
Emitted upon change of a property of the Diagram.
Referenced by KDChart::Plotter::resetLineAttributes(), resetLineAttributes(), KDChart::AbstractDiagram::setAllowOverlappingDataValueTexts(), KDChart::AbstractDiagram::setAntiAliasing(), KDChart::BarDiagram::setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::Plotter::setLineAttributes(), setLineAttributes(), KDChart::AbstractDiagram::setPen(), KDChart::AbstractDiagram::setPercentMode(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), setThreeDLineAttributes(), KDChart::Plotter::setType(), setType(), KDChart::BarDiagram::setType(), KDChart::Plotter::setValueTrackerAttributes(), and setValueTrackerAttributes().
AbstractCartesianDiagram * AbstractCartesianDiagram::referenceDiagram | ( | ) | const [virtual, inherited] |
Definition at line 148 of file KDChartAbstractCartesianDiagram.cpp.
References d.
Referenced by KDChart::AbstractCartesianDiagram::compare(), and referenceDiagramIsBarDiagram().
00149 { 00150 return d->referenceDiagram; 00151 }
QPointF AbstractCartesianDiagram::referenceDiagramOffset | ( | ) | const [virtual, inherited] |
Definition at line 153 of file KDChartAbstractCartesianDiagram.cpp.
References d.
Referenced by KDChart::AbstractCartesianDiagram::compare().
00154 { 00155 return d->referenceDiagramOffset; 00156 }
void LineDiagram::resetLineAttributes | ( | const QModelIndex & | index | ) |
Remove any explicit line attributes settings that might have been specified before.
Definition at line 205 of file KDChartLineDiagram.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00206 { 00207 d->attributesModel->resetData( 00208 d->attributesModel->mapFromSource(index), LineAttributesRole ); 00209 emit propertiesChanged(); 00210 }
void LineDiagram::resetLineAttributes | ( | int | column | ) |
Resets the line attributes of data set column.
Definition at line 181 of file KDChartLineDiagram.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00182 { 00183 d->attributesModel->resetHeaderData( 00184 column, Qt::Vertical, LineAttributesRole ); 00185 emit propertiesChanged(); 00186 }
void LineDiagram::resize | ( | const QSizeF & | area | ) | [virtual] |
Called by the widget's sizeEvent.
Adjust all internal structures, that are calculated, dependending on the size of the widget.
area |
Implements KDChart::AbstractDiagram.
Definition at line 443 of file KDChartLineDiagram.cpp.
References d, and KDChart::AbstractDiagram::setDataBoundariesDirty().
00444 { 00445 d->compressor.setResolution( static_cast<int>( size.width() ), 00446 static_cast<int>( size.height() ) ); 00447 setDataBoundariesDirty(); 00448 }
void LineDiagram::resizeEvent | ( | QResizeEvent * | ) | [protected] |
void AbstractDiagram::scrollTo | ( | const QModelIndex & | index, | |
ScrollHint | hint = EnsureVisible | |||
) | [virtual, inherited] |
void AbstractDiagram::setAllowOverlappingDataValueTexts | ( | bool | allow | ) | [inherited] |
Set whether data value labels are allowed to overlap.
allow | True means that overlapping labels are allowed. |
Definition at line 434 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::propertiesChanged().
00435 { 00436 d->allowOverlappingDataValueTexts = allow; 00437 emit propertiesChanged(); 00438 }
void AbstractDiagram::setAntiAliasing | ( | bool | enabled | ) | [inherited] |
Set whether anti-aliasing is to be used while rendering this diagram.
enabled | True means that AA is enabled. |
Definition at line 445 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::propertiesChanged().
00446 { 00447 d->antiAliasing = enabled; 00448 emit propertiesChanged(); 00449 }
void AbstractCartesianDiagram::setAttributesModel | ( | AttributesModel * | model | ) | [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 explicitely 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() );
model | The AttributesModel to use for this diagram. |
Reimplemented from KDChart::AbstractDiagram.
Definition at line 170 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setAttributesModel().
00171 { 00172 AbstractDiagram::setAttributesModel( model ); 00173 d->compressor.setModel( attributesModel() ); 00174 }
void AbstractDiagram::setAttributesModelRootIndex | ( | const QModelIndex & | ) | [protected, inherited] |
Definition at line 293 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::AbstractDiagram::setRootIndex().
00294 { 00295 d->attributesModelRootIndex=idx; 00296 setDataBoundariesDirty(); 00297 scheduleDelayedItemsLayout(); 00298 }
void AbstractDiagram::setBrush | ( | const QBrush & | brush | ) | [inherited] |
Set the brush to be used, for painting all datasets in the model.
brush | The brush to use. |
Definition at line 806 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().
00807 { 00808 attributesModel()->setModelData( 00809 qVariantFromValue( brush ), DatasetBrushRole ); 00810 emit propertiesChanged(); 00811 }
void AbstractDiagram::setBrush | ( | int | dataset, | |
const QBrush & | brush | |||
) | [inherited] |
Set the brush to be used, for painting the given dataset.
dataset | The dataset's column in the model. | |
brush | The brush to use. |
Definition at line 813 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().
00814 { 00815 attributesModel()->setHeaderData( 00816 column, Qt::Vertical, 00817 qVariantFromValue( brush ), 00818 DatasetBrushRole ); 00819 emit propertiesChanged(); 00820 }
void AbstractDiagram::setBrush | ( | const QModelIndex & | index, | |
const QBrush & | brush | |||
) | [inherited] |
Set the brush to be used, for painting the datapoint at the given index.
index | The datapoint's index in the model. | |
brush | The brush to use. |
Definition at line 798 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().
00799 { 00800 attributesModel()->setData( 00801 attributesModel()->mapFromSource( index ), 00802 qVariantFromValue( brush ), DatasetBrushRole ); 00803 emit propertiesChanged(); 00804 }
void KDChart::AbstractCartesianDiagram::setCoordinatePlane | ( | AbstractCoordinatePlane * | plane | ) | [virtual, inherited] |
[reimplemented]
Reimplemented from KDChart::AbstractDiagram.
Definition at line 125 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractDiagram::setCoordinatePlane().
00126 { 00127 if( coordinatePlane() ) disconnect( coordinatePlane() ); 00128 AbstractDiagram::setCoordinatePlane(plane); 00129 00130 // show the axes, after all have been adjusted 00131 // (because they might be dependend on each other) 00132 /* 00133 if( plane ) 00134 Q_FOREACH( CartesianAxis* axis, d->axesList ) 00135 axis->show(); 00136 else 00137 Q_FOREACH( CartesianAxis* axis, d->axesList ) 00138 axis->hide(); 00139 */ 00140 }
void AbstractDiagram::setDataBoundariesDirty | ( | ) | const [protected, inherited] |
Definition at line 234 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::dataChanged(), KDChart::Plotter::resize(), resize(), KDChart::BarDiagram::resize(), KDChart::AbstractDiagram::setAttributesModel(), KDChart::AbstractDiagram::setAttributesModelRootIndex(), KDChart::AbstractDiagram::setDatasetDimension(), KDChart::AbstractDiagram::setModel(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), setThreeDLineAttributes(), KDChart::Plotter::setType(), setType(), and KDChart::BarDiagram::setType().
00235 { 00236 d->databoundariesDirty = true; 00237 }
void AbstractDiagram::setDatasetDimension | ( | int | dimension | ) | [inherited] |
Sets the dataset dimension of the diagram.
dimension |
Definition at line 1077 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::Widget::setType(), KDChart::TernaryLineDiagram::TernaryLineDiagram(), and KDChart::TernaryPointDiagram::TernaryPointDiagram().
01078 { 01079 if ( d->datasetDimension == dimension ) return; 01080 d->datasetDimension = dimension; 01081 setDataBoundariesDirty(); 01082 emit layoutChanged( this ); 01083 }
void AbstractDiagram::setDataValueAttributes | ( | const DataValueAttributes & | a | ) | [inherited] |
Set the DataValueAttributes for all datapoints in the model.
a | The attributes to set. |
Definition at line 428 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00429 { 00430 d->attributesModel->setModelData( qVariantFromValue( a ), DataValueLabelAttributesRole ); 00431 emit propertiesChanged(); 00432 }
void AbstractDiagram::setDataValueAttributes | ( | int | dataset, | |
const DataValueAttributes & | a | |||
) | [inherited] |
Set the DataValueAttributes for the given dataset.
dataset | The dataset to set the attributes for. | |
a | The attributes to set. |
Definition at line 400 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00401 { 00402 d->attributesModel->setHeaderData( 00403 column, Qt::Vertical, 00404 qVariantFromValue( a ), DataValueLabelAttributesRole ); 00405 emit propertiesChanged(); 00406 }
void AbstractDiagram::setDataValueAttributes | ( | const QModelIndex & | index, | |
const DataValueAttributes & | a | |||
) | [inherited] |
Set the DataValueAttributes for the given index.
index | The datapoint to set the attributes for. | |
a | The attributes to set. |
Definition at line 389 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00391 { 00392 d->attributesModel->setData( 00393 d->attributesModel->mapFromSource( index ), 00394 qVariantFromValue( a ), 00395 DataValueLabelAttributesRole ); 00396 emit propertiesChanged(); 00397 }
void AbstractDiagram::setHidden | ( | bool | hidden | ) | [inherited] |
Hide (or unhide, resp.
) all datapoints in the model.
hidden | The hidden status to set. |
Definition at line 359 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.
00360 { 00361 d->attributesModel->setModelData( 00362 qVariantFromValue( hidden ), 00363 DataHiddenRole ); 00364 emit dataHidden(); 00365 }
void AbstractDiagram::setHidden | ( | int | column, | |
bool | hidden | |||
) | [inherited] |
Hide (or unhide, resp.
) a dataset.
column | The dataset to set the hidden status for. | |
hidden | The hidden status to set. |
Definition at line 350 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.
00351 { 00352 d->attributesModel->setHeaderData( 00353 column, Qt::Vertical, 00354 qVariantFromValue( hidden ), 00355 DataHiddenRole ); 00356 emit dataHidden(); 00357 }
void AbstractDiagram::setHidden | ( | const QModelIndex & | index, | |
bool | hidden | |||
) | [inherited] |
Hide (or unhide, resp.
) a data cell.
index | The datapoint to set the hidden status for. | |
hidden | The hidden status to set. |
Definition at line 341 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.
00342 { 00343 d->attributesModel->setData( 00344 d->attributesModel->mapFromSource( index ), 00345 qVariantFromValue( hidden ), 00346 DataHiddenRole ); 00347 emit dataHidden(); 00348 }
void LineDiagram::setLineAttributes | ( | const QModelIndex & | index, | |
const LineAttributes & | a | |||
) |
Sets the line attributes for the model index index to la.
Definition at line 191 of file KDChartLineDiagram.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00194 { 00195 d->attributesModel->setData( 00196 d->attributesModel->mapFromSource(index), 00197 qVariantFromValue( la ), 00198 LineAttributesRole ); 00199 emit propertiesChanged(); 00200 }
void LineDiagram::setLineAttributes | ( | int | column, | |
const LineAttributes & | a | |||
) |
Sets the line attributes of data set column to la.
Definition at line 166 of file KDChartLineDiagram.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00169 { 00170 d->attributesModel->setHeaderData( 00171 column, 00172 Qt::Vertical, 00173 qVariantFromValue( la ), 00174 LineAttributesRole ); 00175 emit propertiesChanged(); 00176 }
void LineDiagram::setLineAttributes | ( | const LineAttributes & | a | ) |
Sets the global line attributes to la.
Definition at line 155 of file KDChartLineDiagram.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00156 { 00157 d->attributesModel->setModelData( 00158 qVariantFromValue( la ), 00159 LineAttributesRole ); 00160 emit propertiesChanged(); 00161 }
void AbstractCartesianDiagram::setModel | ( | QAbstractItemModel * | model | ) | [virtual, inherited] |
Associate a model with the diagram.
Reimplemented from KDChart::AbstractDiagram.
Definition at line 164 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setModel().
00165 { 00166 AbstractDiagram::setModel( model ); 00167 d->compressor.setModel( attributesModel() ); 00168 }
void AbstractDiagram::setPen | ( | const QPen & | pen | ) | [inherited] |
Set the pen to be used, for painting all datasets in the model.
pen | The pen to use. |
Definition at line 753 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().
00754 { 00755 attributesModel()->setModelData( 00756 qVariantFromValue( pen ), DatasetPenRole ); 00757 emit propertiesChanged(); 00758 }
void AbstractDiagram::setPen | ( | int | dataset, | |
const QPen & | pen | |||
) | [inherited] |
Set the pen to be used, for painting the given dataset.
dataset | The dataset's row in the model. | |
pen | The pen to use. |
Definition at line 760 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().
00761 { 00762 if( datasetDimension() > 1 ) 00763 column *= datasetDimension(); 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.
index | The datapoint's index in the model. | |
pen | The pen to use. |
Definition at line 743 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().
00744 { 00745 if( datasetDimension() > 1 ) 00746 return setPen( index.column(), pen ); 00747 attributesModel()->setData( 00748 attributesModel()->mapFromSource( index ), 00749 qVariantFromValue( pen ), DatasetPenRole ); 00750 emit propertiesChanged(); 00751 }
void AbstractDiagram::setPercentMode | ( | bool | percent | ) | [inherited] |
Definition at line 456 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::propertiesChanged().
Referenced by setType(), and KDChart::BarDiagram::setType().
00457 { 00458 d->percent = percent; 00459 emit propertiesChanged(); 00460 }
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.
Definition at line 142 of file KDChartAbstractCartesianDiagram.cpp.
References d.
void AbstractCartesianDiagram::setRootIndex | ( | const QModelIndex & | index | ) | [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 158 of file KDChartAbstractCartesianDiagram.cpp.
References d, and KDChart::AbstractDiagram::setRootIndex().
00159 { 00160 d->compressor.setRootIndex( index ); 00161 AbstractDiagram::setRootIndex( index ); 00162 }
void AbstractDiagram::setSelection | ( | const QRect & | rect, | |
QItemSelectionModel::SelectionFlags | command | |||
) | [virtual, inherited] |
[reimplemented]
Definition at line 959 of file KDChartAbstractDiagram.cpp.
References d.
00960 { 00961 const QModelIndexList indexes = d->indexesIn( rect ); 00962 QItemSelection selection; 00963 KDAB_FOREACH( const QModelIndex& index, indexes ) 00964 { 00965 selection.append( QItemSelectionRange( index ) ); 00966 } 00967 selectionModel()->select( selection, command ); 00968 }
void LineDiagram::setThreeDLineAttributes | ( | const QModelIndex & | index, | |
const ThreeDLineAttributes & | a | |||
) |
Sets the 3D line attributes of model index index to la.
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->setData( 00282 d->attributesModel->mapFromSource(index), 00283 qVariantFromValue( la ), 00284 ThreeDLineAttributesRole ); 00285 emit propertiesChanged(); 00286 }
void LineDiagram::setThreeDLineAttributes | ( | int | column, | |
const ThreeDLineAttributes & | a | |||
) |
Sets the 3D line attributes of data set column to ta.
Definition at line 260 of file KDChartLineDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.
00263 { 00264 setDataBoundariesDirty(); 00265 d->attributesModel->setHeaderData( 00266 column, 00267 Qt::Vertical, 00268 qVariantFromValue( la ), 00269 ThreeDLineAttributesRole ); 00270 emit propertiesChanged(); 00271 }
void LineDiagram::setThreeDLineAttributes | ( | const ThreeDLineAttributes & | a | ) |
Sets the global 3D line attributes to la.
Definition at line 247 of file KDChartLineDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.
00249 { 00250 setDataBoundariesDirty(); 00251 d->attributesModel->setModelData( 00252 qVariantFromValue( la ), 00253 ThreeDLineAttributesRole ); 00254 emit propertiesChanged(); 00255 }
void LineDiagram::setType | ( | const LineType | type | ) |
Sets the line diagram's type to type.
Definition at line 112 of file KDChartLineDiagram.cpp.
References d, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::layoutChanged(), Normal, Percent, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), KDChart::AbstractDiagram::setPercentMode(), and Stacked.
Referenced by clone().
00113 { 00114 if ( d->implementor->type() == type ) return; 00115 if ( type != LineDiagram::Normal && datasetDimension() > 1 ) { 00116 Q_ASSERT_X ( false, "setType()", 00117 "This line chart type can't be used with multi-dimensional data." ); 00118 return; 00119 } 00120 switch( type ) { 00121 case Normal: 00122 d->implementor = d->normalDiagram; 00123 break; 00124 case Stacked: 00125 d->implementor = d->stackedDiagram; 00126 break; 00127 case Percent: 00128 d->implementor = d->percentDiagram; 00129 break; 00130 default: 00131 Q_ASSERT_X( false, "LineDiagram::setType", "unknown diagram subtype" ); 00132 }; 00133 00134 // d->lineType = type; 00135 Q_ASSERT( d->implementor->type() == type ); 00136 00137 // AbstractAxis settings - see AbstractDiagram and CartesianAxis 00138 setPercentMode( type == LineDiagram::Percent ); 00139 setDataBoundariesDirty(); 00140 emit layoutChanged( this ); 00141 emit propertiesChanged(); 00142 }
void AbstractDiagram::setUnitPrefix | ( | const QString & | prefix, | |
Qt::Orientation | orientation | |||
) | [inherited] |
Sets the unit prefix for all values.
prefix | the prefix to be set | |
orientation | the orientantion of the axis to set |
Definition at line 864 of file KDChartAbstractDiagram.cpp.
References d.
00865 { 00866 d->unitPrefix[ orientation ] = prefix; 00867 }
void AbstractDiagram::setUnitPrefix | ( | const QString & | prefix, | |
int | column, | |||
Qt::Orientation | orientation | |||
) | [inherited] |
Sets the unit prefix for one value.
prefix | the prefix to be set | |
column | the value using that prefix | |
orientation | the orientantion of the axis to set |
Definition at line 854 of file KDChartAbstractDiagram.cpp.
References d.
00855 { 00856 d->unitPrefixMap[ column ][ orientation ]= prefix; 00857 }
void AbstractDiagram::setUnitSuffix | ( | const QString & | suffix, | |
Qt::Orientation | orientation | |||
) | [inherited] |
Sets the unit suffix for all values.
suffix | the suffix to be set | |
orientation | the orientantion of the axis to set |
Definition at line 885 of file KDChartAbstractDiagram.cpp.
References d.
00886 { 00887 d->unitSuffix[ orientation ] = suffix; 00888 }
void AbstractDiagram::setUnitSuffix | ( | const QString & | suffix, | |
int | column, | |||
Qt::Orientation | orientation | |||
) | [inherited] |
Sets the unit suffix for one value.
suffix | the suffix to be set | |
column | the value using that suffix | |
orientation | the orientantion of the axis to set |
Definition at line 875 of file KDChartAbstractDiagram.cpp.
References d.
00876 { 00877 d->unitSuffixMap[ column ][ orientation ]= suffix; 00878 }
void LineDiagram::setValueTrackerAttributes | ( | const QModelIndex & | index, | |
const ValueTrackerAttributes & | a | |||
) |
Sets the value tracker attributes of the model index index to va.
Definition at line 336 of file KDChartLineDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::ValueTrackerAttributesRole.
00338 { 00339 d->attributesModel->setData( d->attributesModel->mapFromSource(index), 00340 qVariantFromValue( va ), 00341 KDChart::ValueTrackerAttributesRole ); 00342 emit propertiesChanged(); 00343 }
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.
Definition at line 100 of file KDChartAbstractCartesianDiagram.cpp.
References d, KDChart::AbstractAxis::deleteObserver(), KDChart::AbstractCartesianDiagram::layoutPlanes(), and KDChart::AbstractLayoutItem::setParentWidget().
Referenced by KDChart::Widget::setType(), and KDChart::CartesianAxis::~CartesianAxis().
00101 { 00102 const int idx = d->axesList.indexOf( axis ); 00103 if( idx != -1 ) 00104 d->axesList.takeAt( idx ); 00105 axis->deleteObserver( this ); 00106 axis->setParentWidget( 0 ); 00107 layoutPlanes(); 00108 }
double LineDiagram::threeDItemDepth | ( | int | column | ) | const [protected, virtual] |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 324 of file KDChartLineDiagram.cpp.
References d, and KDChart::ThreeDLineAttributesRole.
00325 { 00326 return qVariantValue<ThreeDLineAttributes>( 00327 d->attributesModel->headerData ( 00328 column, 00329 Qt::Vertical, 00330 KDChart::ThreeDLineAttributesRole ) ).validDepth(); 00331 }
double LineDiagram::threeDItemDepth | ( | const QModelIndex & | index | ) | const [protected, virtual] |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 319 of file KDChartLineDiagram.cpp.
References threeDLineAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().
00320 { 00321 return threeDLineAttributes( index ).validDepth(); 00322 }
ThreeDLineAttributes LineDiagram::threeDLineAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 311 of file KDChartLineDiagram.cpp.
References d, and KDChart::ThreeDLineAttributesRole.
00312 { 00313 return qVariantValue<ThreeDLineAttributes>( 00314 d->attributesModel->data( 00315 d->attributesModel->mapFromSource( index ), 00316 KDChart::ThreeDLineAttributesRole ) ); 00317 }
ThreeDLineAttributes LineDiagram::threeDLineAttributes | ( | int | column | ) | const |
Definition at line 300 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::columnToIndex(), d, and KDChart::ThreeDLineAttributesRole.
00301 { 00302 return qVariantValue<ThreeDLineAttributes>( 00303 d->attributesModel->data( 00304 d->attributesModel->mapFromSource( columnToIndex( column ) ), 00305 KDChart::ThreeDLineAttributesRole ) ); 00306 }
ThreeDLineAttributes LineDiagram::threeDLineAttributes | ( | ) | const |
Definition at line 291 of file KDChartLineDiagram.cpp.
References d, and KDChart::ThreeDLineAttributesRole.
Referenced by threeDItemDepth().
00292 { 00293 return qVariantValue<ThreeDLineAttributes>( 00294 d->attributesModel->data( KDChart::ThreeDLineAttributesRole ) ); 00295 }
LineDiagram::LineType LineDiagram::type | ( | ) | const |
QString AbstractDiagram::unitPrefix | ( | Qt::Orientation | orientation | ) | const [inherited] |
Returns the global unit prefix.
orientation | the orientation of the axis |
Definition at line 908 of file KDChartAbstractDiagram.cpp.
References d.
00909 { 00910 return d->unitPrefix[ orientation ]; 00911 }
QString AbstractDiagram::unitPrefix | ( | int | column, | |
Qt::Orientation | orientation, | |||
bool | fallback = false | |||
) | const [inherited] |
Returns the unit prefix for a special value.
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 |
Definition at line 897 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().
00898 { 00899 if( !fallback || d->unitPrefixMap[ column ].contains( orientation ) ) 00900 return d->unitPrefixMap[ column ][ orientation ]; 00901 return d->unitPrefix[ orientation ]; 00902 }
QString AbstractDiagram::unitSuffix | ( | Qt::Orientation | orientation | ) | const [inherited] |
Returns the global unit suffix.
orientation | the orientation of the axis |
Definition at line 931 of file KDChartAbstractDiagram.cpp.
References d.
00932 { 00933 return d->unitSuffix[ orientation ]; 00934 }
QString AbstractDiagram::unitSuffix | ( | int | column, | |
Qt::Orientation | orientation, | |||
bool | fallback = false | |||
) | const [inherited] |
Returns the unit suffix for a special value.
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 |
Definition at line 920 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().
00921 { 00922 if( !fallback || d->unitSuffixMap[ column ].contains( orientation ) ) 00923 return d->unitSuffixMap[ column ][ orientation ]; 00924 return d->unitSuffix[ orientation ]; 00925 }
void AbstractDiagram::update | ( | ) | const [inherited] |
Definition at line 1091 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout().
01092 { 01093 //qDebug("KDChart::AbstractDiagram::update() called"); 01094 if( d->plane ) 01095 d->plane->update(); 01096 }
void KDChart::AbstractDiagram::useDefaultColors | ( | ) | [inherited] |
Set the palette to be used, for painting datasets to the default palette.
Definition at line 974 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeDefault.
00975 { 00976 d->attributesModel->setPaletteType( AttributesModel::PaletteTypeDefault ); 00977 }
void KDChart::AbstractDiagram::useRainbowColors | ( | ) | [inherited] |
Set the palette to be used, for painting datasets to the rainbow palette.
Definition at line 984 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeRainbow.
00985 { 00986 d->attributesModel->setPaletteType( AttributesModel::PaletteTypeRainbow ); 00987 }
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.
Definition at line 274 of file KDChartAbstractDiagram.cpp.
References d.
00275 { 00276 return d->usesExternalAttributesModel(); 00277 }
void KDChart::AbstractDiagram::useSubduedColors | ( | ) | [inherited] |
Set the palette to be used, for painting datasets to the subdued palette.
Definition at line 979 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeSubdued.
00980 { 00981 d->attributesModel->setPaletteType( AttributesModel::PaletteTypeSubdued ); 00982 }
double AbstractDiagram::valueForCell | ( | int | row, | |
int | column | |||
) | const [protected, inherited] |
Helper method, retrieving the data value (DisplayRole) for a given row and column.
row | The row to query. | |
column | The column to query. |
Definition at line 1085 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
01086 { 01087 return d->attributesModel->data( 01088 d->attributesModel->index( row, column, attributesModelRootIndex() ) ).toDouble(); 01089 }
double LineDiagram::valueForCellTesting | ( | int | row, | |
int | column, | |||
bool & | bOK, | |||
bool | showHiddenCellsAsInvalid = false | |||
) | const [protected] |
Definition at line 385 of file KDChartLineDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), d, and KDChart::AbstractDiagram::isHidden().
Referenced by getCellValues().
00388 { 00389 double value; 00390 if( showHiddenCellsAsInvalid && isHidden( model()->index( row, column, rootIndex() ) ) ) 00391 bOK = false; 00392 else 00393 value = d->attributesModel->data( 00394 d->attributesModel->index( row, column, attributesModelRootIndex() ) 00395 ).toDouble( &bOK ); 00396 return bOK ? value : 0.0; 00397 }
ValueTrackerAttributes LineDiagram::valueTrackerAttributes | ( | const QModelIndex & | index | ) | const |
Returns the value tracker attributes of the model index index.
Definition at line 348 of file KDChartLineDiagram.cpp.
References d, and KDChart::ValueTrackerAttributesRole.
00350 { 00351 return qVariantValue<ValueTrackerAttributes>( d->attributesModel->data( 00352 d->attributesModel->mapFromSource( index ), 00353 KDChart::ValueTrackerAttributesRole ) ); 00354 }
int AbstractDiagram::verticalOffset | ( | ) | const [virtual, inherited] |
QRect AbstractDiagram::visualRect | ( | const QModelIndex & | index | ) | const [virtual, inherited] |
QRegion AbstractDiagram::visualRegionForSelection | ( | const QItemSelection & | selection | ) | const [virtual, inherited] |