#include <KDChartRingDiagram.h>
Definition at line 40 of file KDChartRingDiagram.h.
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 | |
bool | allowOverlappingDataValueTexts () const |
| |
bool | antiAliasing () const |
| |
virtual AttributesModel * | attributesModel () const |
Returns the AttributesModel, that is used by this diagram. | |
QBrush | brush (const QModelIndex &index) const |
Retrieve the brush to be used, for painting the datapoint at the given index in the model. | |
QBrush | brush (int dataset) const |
Retrieve the brush to be used for the given dataset. | |
QBrush | brush () const |
Retrieve the brush to be used for painting datapoints globally. | |
virtual RingDiagram * | clone () const |
Creates an exact copy of this diagram. | |
int | columnCount () const |
bool | compare (const AbstractDiagram *other) const |
Returns true if both diagrams have the same settings. | |
bool | compare (const AbstractPieDiagram *other) const |
Returns true if both diagrams have the same settings. | |
bool | compare (const RingDiagram *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 dataset) const |
Retrieve the DataValueAttributes for the given dataset. | |
DataValueAttributes | dataValueAttributes () const |
Retrieve the DataValueAttributes specified globally. | |
virtual void | doItemsLayout () |
[reimplemented] | |
virtual bool | expandWhenExploded () const |
qreal | granularity () const |
| |
virtual int | horizontalOffset () const |
[reimplemented] | |
virtual QModelIndex | indexAt (const QPoint &point) const |
[reimplemented] | |
QModelIndexList | indexesAt (const QPoint &point) const |
This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot. | |
bool | isHidden (const QModelIndex &index) const |
Retrieve the hidden status for the given index. | |
bool | isHidden (int dataset) const |
Retrieve the hidden status for the given dataset. | |
bool | isHidden () const |
Retrieve the hidden status specified globally. | |
virtual bool | isIndexHidden (const QModelIndex &index) const |
[reimplemented] | |
QStringList | itemRowLabels () const |
The set of item row labels currently displayed, for use in Abscissa axes, etc. | |
virtual QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) |
[reimplemented] | |
virtual double | numberOfDatasets () const |
virtual double | numberOfGridRings () const |
[reimplemented] | |
virtual double | numberOfValuesPerDataset () const |
[reimplemented] | |
void | paintDataValueText (QPainter *painter, const QModelIndex &index, const QPointF &pos, double value) |
void | paintMarker (QPainter *painter, const QModelIndex &index, const QPointF &pos) |
void | paintMarker (QPainter *painter, const DataValueAttributes &a, const QModelIndex &index, const QPointF &pos) |
virtual void | paintMarker (QPainter *painter, const MarkerAttributes &markerAttributes, const QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size) |
QPen | pen (const QModelIndex &index) const |
Retrieve the pen to be used, for painting the datapoint at the given index in the model. | |
QPen | pen (int dataset) const |
Retrieve the pen to be used for the given dataset. | |
QPen | pen () const |
Retrieve the pen to be used for painting datapoints globally. | |
bool | percentMode () const |
PieAttributes | pieAttributes (const QModelIndex &index) const |
PieAttributes | pieAttributes (int column) const |
PieAttributes | pieAttributes () const |
const PolarCoordinatePlane * | polarCoordinatePlane () const |
bool | relativeThickness () const |
virtual void | resize (const QSizeF &area) |
[reimplemented] | |
RingDiagram (QWidget *parent=0, PolarCoordinatePlane *plane=0) | |
int | rowCount () const |
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. | |
virtual 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) |
Set the coordinate plane associated with the diagram. | |
void | setDatasetDimension (int dimension) |
| |
void | setDataValueAttributes (const DataValueAttributes &a) |
Set the DataValueAttributes for all datapoints in the model. | |
void | setDataValueAttributes (int dataset, const DataValueAttributes &a) |
Set the DataValueAttributes for the given dataset. | |
void | setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a) |
Set the DataValueAttributes for the given index. | |
virtual void | setExpandWhenExploded (bool expand) |
void | setGranularity (qreal value) |
Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead of rounded segments. | |
void | setHidden (bool hidden) |
Hide (or unhide, resp. | |
void | setHidden (int dataset, bool hidden) |
Hide (or unhide, resp. | |
void | setHidden (const QModelIndex &index, bool hidden) |
Hide (or unhide, resp. | |
virtual 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) |
void | setPieAttributes (const QModelIndex &index, const PieAttributes &a) |
void | setPieAttributes (int column, const PieAttributes &a) |
void | setPieAttributes (const PieAttributes &a) |
void | setRelativeThickness (bool relativeThickness) |
virtual void | setRootIndex (const QModelIndex &idx) |
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] | |
virtual void | setSelectionModel (QItemSelectionModel *selectionModel) |
Associate a seleection model with the diagrom. | |
void | setStartPosition (int degrees) |
void | setThreeDPieAttributes (const QModelIndex &index, const ThreeDPieAttributes &a) |
void | setThreeDPieAttributes (int column, const ThreeDPieAttributes &a) |
void | setThreeDPieAttributes (const ThreeDPieAttributes &a) |
void | setUnitPrefix (const QString &prefix, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for all columns. | |
void | setUnitPrefix (const QString &prefix, int column, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for one specific column. | |
void | setUnitSuffix (const QString &suffix, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for all columns. | |
void | setUnitSuffix (const QString &suffix, int column, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for one specific column. | |
int | startPosition () const |
ThreeDPieAttributes | threeDPieAttributes (const QModelIndex &index) const |
ThreeDPieAttributes | threeDPieAttributes (int column) const |
ThreeDPieAttributes | threeDPieAttributes () const |
QString | unitPrefix (Qt::Orientation orientation) const |
Retrieves the axis unit prefix. | |
QString | unitPrefix (int column, Qt::Orientation orientation, bool fallback=false) const |
Retrieves the axis unit prefix for a specific column. | |
QString | unitSuffix (Qt::Orientation orientation) const |
Retrieves the axis unit suffix. | |
QString | unitSuffix (int column, Qt::Orientation orientation, bool fallback=false) const |
Retrieves the axis unit suffix for a specific column. | |
void | update () const |
void | useDefaultColors () |
Set the palette to be used, for painting datasets to the default palette. | |
void | useRainbowColors () |
Set the palette to be used, for painting datasets to the rainbow palette. | |
virtual bool | usesExternalAttributesModel () const |
Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel. | |
void | useSubduedColors () |
Set the palette to be used, for painting datasets to the subdued palette. | |
double | valueTotals (int dataset) const |
virtual double | valueTotals () const |
[reimplemented] | |
virtual int | verticalOffset () const |
[reimplemented] | |
virtual QRect | visualRect (const QModelIndex &index) const |
[reimplemented] | |
virtual QRegion | visualRegion (const QModelIndex &index) const |
virtual QRegion | visualRegionForSelection (const QItemSelection &selection) const |
[reimplemented] | |
virtual | ~RingDiagram () |
Protected Slots | |
void | setDataBoundariesDirty () const |
Protected Member Functions | |
QModelIndex | attributesModelRootIndex () const |
virtual const QPair< QPointF, QPointF > | calculateDataBoundaries () const |
[reimplemented] | |
virtual bool | checkInvariants (bool justReturnTheStatus=false) const |
virtual void | paint (PaintContext *paintContext) |
[reimplemented] | |
virtual void | paintDataValueTexts (QPainter *painter) |
This method is obsolete and provided for backward-compatibility only. | |
void | paintEvent (QPaintEvent *) |
virtual void | paintMarkers (QPainter *painter) |
This method is obsolete and provided for backward-compatibility only. | |
void | resizeEvent (QResizeEvent *) |
void | setAttributesModelRootIndex (const QModelIndex &) |
void | setDatasetDimensionInternal (int dimension) |
double | valueForCell (int row, int column) const |
Helper method, retrieving the data value (DisplayRole) for a given row and column. |
RingDiagram::RingDiagram | ( | QWidget * | parent = 0 , |
|
PolarCoordinatePlane * | plane = 0 | |||
) | [explicit] |
Definition at line 51 of file KDChartRingDiagram.cpp.
References StockDiagram::init().
Referenced by clone().
00051 : 00052 AbstractPieDiagram( new Private(), parent, plane ) 00053 { 00054 init(); 00055 }
RingDiagram::~RingDiagram | ( | ) | [virtual] |
bool AbstractDiagram::allowOverlappingDataValueTexts | ( | ) | const [inherited] |
Definition at line 511 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::compare().
00512 { 00513 return d->allowOverlappingDataValueTexts; 00514 }
bool AbstractDiagram::antiAliasing | ( | ) | const [inherited] |
Definition at line 522 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::compare().
00523 { 00524 return d->antiAliasing; 00525 }
AttributesModel * AbstractDiagram::attributesModel | ( | ) | const [virtual, inherited] |
Returns the AttributesModel, that is used by this diagram.
By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-supplied AttributesModel has been set does the pointer returned here not belong to the diagram.
Definition at line 315 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::brush(), StockDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::compare(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::dataValueAttributes(), StockDiagram::init(), KDChart::AbstractDiagram::isHidden(), KDChart::AbstractDiagram::itemRowLabels(), StockDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::pen(), KDChart::AbstractCartesianDiagram::setAttributesModel(), KDChart::BarDiagram::setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractCartesianDiagram::setCoordinatePlane(), KDChart::AbstractCartesianDiagram::setModel(), KDChart::AbstractDiagram::setPen(), KDChart::AbstractCartesianDiagram::setRootIndex(), StockDiagram::setStockBarAttributes(), StockDiagram::setThreeDBarAttributes(), StockDiagram::stockBarAttributes(), KDChart::TernaryLineDiagram::TernaryLineDiagram(), and StockDiagram::threeDBarAttributes().
00316 { 00317 return d->attributesModel; 00318 }
QModelIndex AbstractDiagram::attributesModelRootIndex | ( | ) | const [protected, inherited] |
returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 345 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by StockDiagram::calculateDataBoundaries(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::itemRowLabels(), KDChart::Plotter::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::BarDiagram::numberOfAbscissaSegments(), KDChart::Plotter::numberOfOrdinateSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(), KDChart::BarDiagram::numberOfOrdinateSegments(), StockDiagram::paint(), KDChart::AbstractDiagram::valueForCell(), and KDChart::LineDiagram::valueForCellTesting().
00346 { 00347 if ( !d->attributesModelRootIndex.isValid() ) 00348 d->attributesModelRootIndex = d->attributesModel->mapFromSource( rootIndex() ); 00349 return d->attributesModelRootIndex; 00350 }
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. With a dataset dimension of two, this is the index of the key of each key/value pair. |
Definition at line 850 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetBrushRole.
00851 { 00852 return qVariantValue<QBrush>( 00853 attributesModel()->data( conditionallyMapFromSource( index ), DatasetBrushRole ) ); 00854 }
QBrush AbstractDiagram::brush | ( | int | dataset | ) | const [inherited] |
Retrieve the brush to be used for the given dataset.
This will fall back automatically to what was set at model level, if there are no dataset specific settings.
dataset | The dataset to retrieve the brush for. |
Definition at line 835 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::brush(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().
00836 { 00837 // To store the brush for a dataset, we use the first column 00838 // that's associated with it. (i.e., with a dataset dimension 00839 // of two, the column of the keys) 00840 const int column = dataset * datasetDimension(); 00841 00842 const QVariant brushSettings( 00843 attributesModel()->headerData( column, Qt::Vertical, 00844 DatasetBrushRole ) ); 00845 if( brushSettings.isValid() ) 00846 return qVariantValue< QBrush >( brushSettings ); 00847 return brush(); 00848 }
QBrush AbstractDiagram::brush | ( | ) | const [inherited] |
Retrieve the brush to be used for painting datapoints globally.
This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 829 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetBrushRole.
Referenced by KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().
00830 { 00831 return qVariantValue<QBrush>( 00832 attributesModel()->data( DatasetBrushRole ) ); 00833 }
const QPair< QPointF, QPointF > RingDiagram::calculateDataBoundaries | ( | ) | const [protected, virtual] |
[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 113 of file KDChartRingDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractPolarDiagram::columnCount(), d, KDChart::PieAttributes::explodeFactor(), KDChart::AbstractPieDiagram::pieAttributes(), and KDChart::AbstractPolarDiagram::rowCount().
00114 { 00115 if ( !checkInvariants( true ) ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) ); 00116 00117 const PieAttributes attrs( pieAttributes( model()->index( 0, 0, rootIndex() ) ) ); 00118 00119 QPointF bottomLeft ( QPointF( 0, 0 ) ); 00120 QPointF topRight; 00121 // If we explode, we need extra space for the pie slice that has 00122 // the largest explosion distance. 00123 if ( attrs.explode() ) { 00124 const int rCount = rowCount(); 00125 const int colCount = columnCount(); 00126 qreal maxExplode = 0.0; 00127 for( int i = 0; i < rCount; ++i ){ 00128 qreal maxExplodeInThisRow = 0.0; 00129 for( int j = 0; j < colCount; ++j ){ 00130 const PieAttributes columnAttrs( pieAttributes( model()->index( i, j, rootIndex() ) ) ); 00131 //qDebug() << columnAttrs.explodeFactor(); 00132 maxExplodeInThisRow = qMax( maxExplodeInThisRow, columnAttrs.explodeFactor() ); 00133 } 00134 maxExplode += maxExplodeInThisRow; 00135 00136 // FIXME: What if explode factor of inner ring is > 1.0 ? 00137 if ( !d->expandWhenExploded ) 00138 break; 00139 } 00140 // explode factor is relative to width (outer r - inner r) of one ring 00141 maxExplode /= ( rCount + 1); 00142 topRight = QPointF( 1.0+maxExplode, 1.0+maxExplode ); 00143 }else{ 00144 topRight = QPointF( 1.0, 1.0 ); 00145 } 00146 return QPair<QPointF, QPointF> ( bottomLeft, topRight ); 00147 }
bool AbstractDiagram::checkInvariants | ( | bool | justReturnTheStatus = false |
) | const [protected, virtual, inherited] |
Definition at line 1077 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane().
Referenced by calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), KDChart::Plotter::calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), paint(), KDChart::PolarDiagram::paint(), KDChart::Plotter::paint(), KDChart::LineDiagram::paint(), KDChart::LeveyJenningsDiagram::paint(), KDChart::BarDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::PieDiagram::paintInternal(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().
01078 { 01079 if( ! justReturnTheStatus ){ 01080 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()", 01081 "There is no usable model set, for the diagram." ); 01082 01083 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()", 01084 "There is no usable coordinate plane set, for the diagram." ); 01085 } 01086 return model() && coordinatePlane(); 01087 }
RingDiagram * RingDiagram::clone | ( | ) | const [virtual] |
Creates an exact copy of this diagram.
Definition at line 68 of file KDChartRingDiagram.cpp.
References d, StockDiagram::Private::Private(), and RingDiagram().
00069 { 00070 return new RingDiagram( new Private( *d ) ); 00071 }
int AbstractPolarDiagram::columnCount | ( | ) | const [inherited] |
Definition at line 60 of file KDChartAbstractPolarDiagram.cpp.
References KDChart::AbstractPolarDiagram::numberOfValuesPerDataset().
Referenced by calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), paint(), KDChart::PieDiagram::paintInternal(), valueTotals(), and KDChart::PieDiagram::valueTotals().
00061 { 00062 return static_cast<int>( numberOfValuesPerDataset() ); 00063 }
bool AbstractDiagram::compare | ( | const AbstractDiagram * | other | ) | const [inherited] |
Returns true if both diagrams have the same settings.
Definition at line 131 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::allowOverlappingDataValueTexts(), KDChart::AbstractDiagram::antiAliasing(), KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::compare(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::percentMode().
00132 { 00133 if( other == this ) return true; 00134 if( ! other ){ 00135 //qDebug() << "AbstractDiagram::compare() cannot compare to Null pointer"; 00136 return false; 00137 } 00138 /* 00139 qDebug() << "\n AbstractDiagram::compare() QAbstractScrollArea:"; 00140 // compare QAbstractScrollArea properties 00141 qDebug() << 00142 ((horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00143 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy())); 00144 qDebug() << "AbstractDiagram::compare() QFrame:"; 00145 // compare QFrame properties 00146 qDebug() << 00147 ((frameShadow() == other->frameShadow()) && 00148 (frameShape() == other->frameShape()) && 00149 (frameWidth() == other->frameWidth()) && 00150 (lineWidth() == other->lineWidth()) && 00151 (midLineWidth() == other->midLineWidth())); 00152 qDebug() << "AbstractDiagram::compare() QAbstractItemView:"; 00153 // compare QAbstractItemView properties 00154 qDebug() << 00155 ((alternatingRowColors() == other->alternatingRowColors()) && 00156 (hasAutoScroll() == other->hasAutoScroll()) && 00157 #if QT_VERSION > 0x040199 00158 (dragDropMode() == other->dragDropMode()) && 00159 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00160 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00161 (verticalScrollMode() == other->verticalScrollMode()) && 00162 #endif 00163 (dragEnabled() == other->dragEnabled()) && 00164 (editTriggers() == other->editTriggers()) && 00165 (iconSize() == other->iconSize()) && 00166 (selectionBehavior() == other->selectionBehavior()) && 00167 (selectionMode() == other->selectionMode()) && 00168 (showDropIndicator() == other->showDropIndicator()) && 00169 (tabKeyNavigation() == other->tabKeyNavigation()) && 00170 (textElideMode() == other->textElideMode())); 00171 qDebug() << "AbstractDiagram::compare() AttributesModel: "; 00172 // compare all of the properties stored in the attributes model 00173 qDebug() << attributesModel()->compare( other->attributesModel() ); 00174 qDebug() << "AbstractDiagram::compare() own:"; 00175 // compare own properties 00176 qDebug() << 00177 ((rootIndex().column() == other->rootIndex().column()) && 00178 (rootIndex().row() == other->rootIndex().row()) && 00179 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00180 (antiAliasing() == other->antiAliasing()) && 00181 (percentMode() == other->percentMode()) && 00182 (datasetDimension() == other->datasetDimension())); 00183 */ 00184 return // compare QAbstractScrollArea properties 00185 (horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00186 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy()) && 00187 // compare QFrame properties 00188 (frameShadow() == other->frameShadow()) && 00189 (frameShape() == other->frameShape()) && 00190 // frameWidth is a read-only property defined by the style, it should not be in here: 00191 // (frameWidth() == other->frameWidth()) && 00192 (lineWidth() == other->lineWidth()) && 00193 (midLineWidth() == other->midLineWidth()) && 00194 // compare QAbstractItemView properties 00195 (alternatingRowColors() == other->alternatingRowColors()) && 00196 (hasAutoScroll() == other->hasAutoScroll()) && 00197 #if QT_VERSION > 0x040199 00198 (dragDropMode() == other->dragDropMode()) && 00199 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00200 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00201 (verticalScrollMode() == other->verticalScrollMode()) && 00202 #endif 00203 (dragEnabled() == other->dragEnabled()) && 00204 (editTriggers() == other->editTriggers()) && 00205 (iconSize() == other->iconSize()) && 00206 (selectionBehavior() == other->selectionBehavior()) && 00207 (selectionMode() == other->selectionMode()) && 00208 (showDropIndicator() == other->showDropIndicator()) && 00209 (tabKeyNavigation() == other->tabKeyNavigation()) && 00210 (textElideMode() == other->textElideMode()) && 00211 // compare all of the properties stored in the attributes model 00212 attributesModel()->compare( other->attributesModel() ) && 00213 // compare own properties 00214 (rootIndex().column() == other->rootIndex().column()) && 00215 (rootIndex().row() == other->rootIndex().row()) && 00216 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00217 (antiAliasing() == other->antiAliasing()) && 00218 (percentMode() == other->percentMode()) && 00219 (datasetDimension() == other->datasetDimension()); 00220 }
bool AbstractPieDiagram::compare | ( | const AbstractPieDiagram * | other | ) | const [inherited] |
Returns true if both diagrams have the same settings.
Definition at line 63 of file KDChartAbstractPieDiagram.cpp.
References KDChart::AbstractPieDiagram::granularity(), and KDChart::AbstractPieDiagram::startPosition().
00064 { 00065 if( other == this ) return true; 00066 if( ! other ){ 00067 //qDebug() << "AbstractPieDiagram::compare() cannot compare to Null pointer"; 00068 return false; 00069 } 00070 /* 00071 qDebug() << "\n AbstractPieDiagram::compare():"; 00072 // compare own properties 00073 qDebug() << 00074 (granularity() == other->granularity()) && 00075 (startPosition() == other->startPosition()); 00076 */ 00077 return // compare the base class 00078 ( static_cast<const AbstractPolarDiagram*>(this)->compare( other ) ) && 00079 // compare own properties 00080 (granularity() == other->granularity()) && 00081 (startPosition() == other->startPosition()); 00082 }
bool RingDiagram::compare | ( | const RingDiagram * | other | ) | const |
Returns true if both diagrams have the same settings.
Definition at line 73 of file KDChartRingDiagram.cpp.
References expandWhenExploded(), and relativeThickness().
00074 { 00075 if( other == this ) return true; 00076 if( ! other ){ 00077 return false; 00078 } 00079 /* 00080 qDebug() <<"\n RingDiagram::compare():"; 00081 // compare own properties 00082 qDebug() << (type() == other->type()); 00083 qDebug() << (relativeThickness() == other->relativeThickness()); 00084 qDebug() << (expandWhenExploded() == other->expandWhenExploded()); 00085 */ 00086 return // compare the base class 00087 ( static_cast<const AbstractPieDiagram*>(this)->compare( other ) ) && 00088 // compare own properties 00089 (relativeThickness() == other->relativeThickness()) && 00090 (expandWhenExploded() == other->expandWhenExploded()); 00091 }
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 222 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::checkInvariants(), KDChart::LeveyJenningsDiagram::iconRect(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), StockDiagram::resize(), KDChart::Plotter::resize(), KDChart::LineDiagram::resize(), KDChart::BarDiagram::resize(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().
00223 { 00224 return d->plane; 00225 }
const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries | ( | ) | const [inherited] |
Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values).
This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 227 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.
Referenced by KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::Plotter::paint(), KDChart::LineDiagram::paint(), KDChart::LeveyJenningsDiagram::paint(), and KDChart::BarDiagram::paint().
00228 { 00229 if( d->databoundariesDirty ){ 00230 d->databoundaries = calculateDataBoundaries (); 00231 d->databoundariesDirty = false; 00232 } 00233 return d->databoundaries; 00234 }
void AbstractDiagram::dataChanged | ( | const QModelIndex & | topLeft, | |
const QModelIndex & | bottomRight | |||
) | [virtual, inherited] |
[reimplemented]
Definition at line 366 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::LeveyJenningsDiagram::setModel().
00368 { 00369 Q_UNUSED( topLeft ); 00370 Q_UNUSED( bottomRight ); 00371 // We are still too dumb to do intelligent updates... 00372 setDataBoundariesDirty(); 00373 scheduleDelayedItemsLayout(); 00374 }
void KDChart::AbstractDiagram::dataHidden | ( | ) | [signal, inherited] |
This signal is emitted, when the hidden status of at least one data cell was (un)set.
Referenced by KDChart::AbstractDiagram::setHidden().
QList< QBrush > AbstractDiagram::datasetBrushes | ( | ) | const [inherited] |
The set of dataset brushes currently used, for use in legends, etc.
Definition at line 1038 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AbstractDiagram::brush(), KDChart::AttributesModel::columnCount(), and KDChart::AbstractDiagram::datasetDimension().
Referenced by KDChart::Legend::datasetCount(), and KDChart::Legend::setBrushesFromDiagram().
01039 { 01040 QList<QBrush> ret; 01041 if( model() == 0 ) 01042 return ret; 01043 01044 const int datasetCount = attributesModel()->columnCount(attributesModelRootIndex()) / datasetDimension(); 01045 for ( int dataset = 0; dataset < datasetCount; dataset++ ) 01046 ret << brush( dataset ); 01047 01048 return ret; 01049 }
int AbstractDiagram::datasetDimension | ( | ) | const [inherited] |
The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to have.
For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic values will be used for the abscissa.
For example a diagram with the default dimension of 1, will have one column per datapoint (the y values) and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y values.
Definition at line 1089 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::compare(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::LineDiagram::getCellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::AbstractDiagram::isHidden(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractDiagram::pen(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::AbstractDiagram::setHidden(), KDChart::AbstractDiagram::setPen(), KDChart::Plotter::setType(), and KDChart::LineDiagram::setType().
01090 { 01091 return d->datasetDimension; 01092 }
QStringList AbstractDiagram::datasetLabels | ( | ) | const [inherited] |
The set of dataset labels currently displayed, for use in legends, etc.
Definition at line 1025 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AttributesModel::headerData().
Referenced by KDChart::Legend::datasetCount().
01026 { 01027 QStringList ret; 01028 if( model() == 0 ) 01029 return ret; 01030 01031 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex()); 01032 for( int i = 0; i < columnCount; i += datasetDimension() ) 01033 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString(); 01034 01035 return ret; 01036 }
QList< MarkerAttributes > AbstractDiagram::datasetMarkers | ( | ) | const [inherited] |
The set of dataset markers currently used, for use in legends, etc.
Definition at line 1064 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::dataValueAttributes(), and KDChart::DataValueAttributes::markerAttributes().
01065 { 01066 QList<MarkerAttributes> ret; 01067 if( model() == 0 ) 01068 return ret; 01069 01070 const int datasetCount = attributesModel()->columnCount(attributesModelRootIndex()) / datasetDimension(); 01071 for ( int dataset = 0; dataset < datasetCount; dataset++ ) 01072 ret << dataValueAttributes( dataset ).markerAttributes(); 01073 01074 return ret; 01075 }
QList< QPen > AbstractDiagram::datasetPens | ( | ) | const [inherited] |
The set of dataset pens currently used, for use in legends, etc.
Definition at line 1051 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::pen().
01052 { 01053 QList<QPen> ret; 01054 if( model() == 0 ) 01055 return ret; 01056 01057 const int datasetCount = attributesModel()->columnCount(attributesModelRootIndex()) / datasetDimension(); 01058 for ( int dataset = 0; dataset < datasetCount; dataset++ ) 01059 ret << pen( dataset ); 01060 01061 return ret; 01062 }
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | const QModelIndex & | index | ) | const [inherited] |
Retrieve the DataValueAttributes for the given index.
This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific settings.
index | The datapoint to retrieve the attributes for. With a dataset dimension of two, this is the index of the key of each key/value pair. |
Definition at line 491 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataValueLabelAttributesRole.
00492 { 00493 return qVariantValue<DataValueAttributes>( 00494 attributesModel()->data( 00495 conditionallyMapFromSource( index ), 00496 KDChart::DataValueLabelAttributesRole ) ); 00497 }
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | int | dataset | ) | const [inherited] |
Retrieve the DataValueAttributes for the given dataset.
This will fall back automatically to what was set at model level, if there are no dataset specific settings.
dataset | The dataset to retrieve the attributes for. |
Definition at line 465 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::dataValueAttributes(), and KDChart::DataValueLabelAttributesRole.
00466 { 00467 /* 00468 The following did not work! 00469 (khz, 2008-01-25) 00470 If there was some attrs specified for the 0-th cells of a dataset, 00471 then this logic would return the cell's settings instead of the header settings: 00472 00473 return qVariantValue<DataValueAttributes>( 00474 attributesModel()->data( attributesModel()->mapFromSource(columnToIndex( column )), 00475 KDChart::DataValueLabelAttributesRole ) ); 00476 */ 00477 00478 // To store the attributes for a dataset, we use the first column 00479 // that's associated with it. (i.e., with a dataset dimension 00480 // of two, the column of the keys) 00481 const int column = dataset * datasetDimension(); 00482 00483 const QVariant headerAttrs( 00484 attributesModel()->headerData( column, Qt::Vertical, 00485 KDChart::DataValueLabelAttributesRole ) ); 00486 if( headerAttrs.isValid() ) 00487 return qVariantValue< DataValueAttributes >( headerAttrs ); 00488 return dataValueAttributes(); 00489 }
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | ) | const [inherited] |
Retrieve the DataValueAttributes specified globally.
This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 459 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DataValueLabelAttributesRole, and KDChart::AttributesModel::modelData().
Referenced by KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::AbstractDiagram::paintMarker(), and KDChart::TernaryLineDiagram::TernaryLineDiagram().
00460 { 00461 return qVariantValue<DataValueAttributes>( 00462 attributesModel()->modelData( KDChart::DataValueLabelAttributesRole ) ); 00463 }
void AbstractDiagram::doItemsLayout | ( | ) | [virtual, inherited] |
[reimplemented]
Definition at line 357 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::update().
00358 { 00359 if ( d->plane ) { 00360 d->plane->layoutDiagrams(); 00361 update(); 00362 } 00363 QAbstractItemView::doItemsLayout(); 00364 }
bool RingDiagram::expandWhenExploded | ( | ) | const [virtual] |
Definition at line 108 of file KDChartRingDiagram.cpp.
References d.
Referenced by compare().
00109 { 00110 return d->expandWhenExploded; 00111 }
qreal AbstractPieDiagram::granularity | ( | ) | const [inherited] |
Definition at line 92 of file KDChartAbstractPieDiagram.cpp.
References d.
Referenced by KDChart::AbstractPieDiagram::compare(), paint(), and KDChart::PieDiagram::paintInternal().
00093 { 00094 return (d->granularity < 0.05 || d->granularity > 36.0) 00095 ? 1.0 00096 : d->granularity; 00097 }
int AbstractDiagram::horizontalOffset | ( | ) | const [virtual, inherited] |
QModelIndex AbstractDiagram::indexAt | ( | const QPoint & | point | ) | const [virtual, inherited] |
[reimplemented]
Definition at line 1123 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::Chart::event().
01124 { 01125 return d->indexAt( point ); 01126 }
QModelIndexList AbstractDiagram::indexesAt | ( | const QPoint & | point | ) | const [inherited] |
This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot.
Definition at line 1128 of file KDChartAbstractDiagram.cpp.
References d.
01129 { 01130 return d->indexesAt( point ); 01131 }
bool AbstractDiagram::isHidden | ( | const QModelIndex & | index | ) | const [inherited] |
Retrieve the hidden status for the given index.
This will fall back automatically to what was set at dataset or diagram level, if there are no datapoint specific settings.
index | The datapoint to retrieve the hidden status for. |
Definition at line 427 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataHiddenRole.
00428 { 00429 return qVariantValue<bool>( 00430 attributesModel()->data( 00431 conditionallyMapFromSource(index), 00432 DataHiddenRole ) ); 00433 }
bool AbstractDiagram::isHidden | ( | int | dataset | ) | const [inherited] |
Retrieve the hidden status for the given dataset.
This will fall back automatically to what was set at diagram level, if there are no dataset specific settings.
dataset | The dataset to retrieve the hidden status for. |
Definition at line 413 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DataHiddenRole, KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::isHidden().
00414 { 00415 // To store the flag for a dataset, we use the first column 00416 // that's associated with it. (i.e., with a dataset dimension 00417 // of two, the column of the keys) 00418 const int column = dataset * datasetDimension(); 00419 const QVariant boolFlag( 00420 attributesModel()->headerData( column, Qt::Vertical, 00421 DataHiddenRole ) ); 00422 if( boolFlag.isValid() ) 00423 return qVariantValue< bool >( boolFlag ); 00424 return isHidden(); 00425 }
bool AbstractDiagram::isHidden | ( | ) | const [inherited] |
Retrieve the hidden status specified globally.
This will fall back automatically to the default settings ( = not hidden), if there are no specific settings.
Definition at line 407 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DataHiddenRole, and KDChart::AttributesModel::modelData().
Referenced by KDChart::AbstractDiagram::isHidden(), and KDChart::LineDiagram::valueForCellTesting().
00408 { 00409 return qVariantValue<bool>( 00410 attributesModel()->modelData( DataHiddenRole ) ); 00411 }
bool AbstractDiagram::isIndexHidden | ( | const QModelIndex & | index | ) | const [virtual, inherited] |
QStringList AbstractDiagram::itemRowLabels | ( | ) | const [inherited] |
The set of item row labels currently displayed, for use in Abscissa axes, etc.
Definition at line 1009 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::headerData(), KDChart::AttributesModel::rowCount(), KDChart::AbstractDiagram::unitPrefix(), and KDChart::AbstractDiagram::unitSuffix().
01010 { 01011 QStringList ret; 01012 if( model() ){ 01013 //qDebug() << "AbstractDiagram::itemRowLabels(): " << attributesModel()->rowCount(attributesModelRootIndex()) << "entries"; 01014 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex()); 01015 for( int i = 0; i < rowCount; ++i ){ 01016 //qDebug() << "item row label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString(); 01017 ret << unitPrefix( i, Qt::Horizontal, true ) + 01018 attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString() + 01019 unitSuffix( i, Qt::Horizontal, true ); 01020 } 01021 } 01022 return ret; 01023 }
void KDChart::AbstractDiagram::layoutChanged | ( | AbstractDiagram * | ) | [signal, inherited] |
Diagrams are supposed to emit this signal, when the layout of one of their element changes.
Layouts can change, for example, when axes are added or removed, or when the configuration was changed in a way that the axes or the diagram itself are displayed in a different geometry. Changes in the diagrams coordinate system also result in the layoutChanged() signal being emitted.
Referenced by KDChart::AbstractDiagram::setDatasetDimensionInternal(), KDChart::LeveyJenningsDiagram::setModel(), KDChart::AbstractDiagram::setModel(), KDChart::BarDiagram::setOrientation(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().
void KDChart::AbstractDiagram::modelsChanged | ( | ) | [signal, inherited] |
This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::setSelectionModel().
QModelIndex AbstractDiagram::moveCursor | ( | CursorAction | cursorAction, | |
Qt::KeyboardModifiers | modifiers | |||
) | [virtual, inherited] |
double RingDiagram::numberOfDatasets | ( | ) | const [virtual] |
Reimplemented from KDChart::AbstractPolarDiagram.
Definition at line 516 of file KDChartRingDiagram.cpp.
double RingDiagram::numberOfGridRings | ( | ) | const [virtual] |
[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 522 of file KDChartRingDiagram.cpp.
double RingDiagram::numberOfValuesPerDataset | ( | ) | const [virtual] |
[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 511 of file KDChartRingDiagram.cpp.
void RingDiagram::paint | ( | PaintContext * | paintContext | ) | [protected, virtual] |
[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 178 of file KDChartRingDiagram.cpp.
References buildReferenceRect(), KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractPolarDiagram::columnCount(), d, KDChart::PieAttributes::explode(), KDChart::PieAttributes::explodeFactor(), KDChart::PieAttributes::gapFactor(), KDChart::AbstractPieDiagram::granularity(), KDChart::PaintContext::painter(), KDChart::AbstractPieDiagram::pieAttributes(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), KDChart::PaintContext::rectangle(), KDChart::AbstractPolarDiagram::rowCount(), KDChart::PolarCoordinatePlane::startPosition(), and valueTotals().
Referenced by paintEvent().
00179 { 00180 // note: Not having any data model assigned is no bug 00181 // but we can not draw a diagram then either. 00182 if ( !checkInvariants(true) ) 00183 return; 00184 00185 const PieAttributes attrs( pieAttributes() ); 00186 00187 const int rCount = rowCount(); 00188 const int colCount = columnCount(); 00189 00190 QRectF contentsRect( buildReferenceRect( polarCoordinatePlane() ) ); 00191 contentsRect = ctx->rectangle(); 00192 if( contentsRect.isEmpty() ) 00193 return; 00194 00195 DataValueTextInfoList list; 00196 00197 d->startAngles = QVector< QVector<qreal> >( rCount, QVector<qreal>( colCount ) ); 00198 d->angleLens = QVector< QVector<qreal> >( rCount, QVector<qreal>( colCount ) ); 00199 00200 // compute position 00201 d->size = qMin( contentsRect.width(), contentsRect.height() ); // initial size 00202 00203 // if the pies explode, we need to give them additional space => 00204 // make the basic size smaller 00205 qreal totalOffset = 0.0; 00206 for( int i = 0; i < rCount; ++i ){ 00207 qreal maxOffsetInThisRow = 0.0; 00208 for( int j = 0; j < colCount; ++j ){ 00209 const PieAttributes cellAttrs( pieAttributes( model()->index( i, j, rootIndex() ) ) ); 00210 //qDebug() << cellAttrs.explodeFactor(); 00211 const qreal explode = cellAttrs.explode() ? cellAttrs.explodeFactor() : 0.0; 00212 maxOffsetInThisRow = qMax( maxOffsetInThisRow, cellAttrs.gapFactor( false ) + explode ); 00213 } 00214 if ( !d->expandWhenExploded ) 00215 maxOffsetInThisRow -= (qreal)i; 00216 if ( maxOffsetInThisRow > 0.0 ) 00217 totalOffset += maxOffsetInThisRow; 00218 00219 // FIXME: What if explode factor of inner ring is > 1.0 ? 00220 //if ( !d->expandWhenExploded ) 00221 // break; 00222 } 00223 00224 // explode factor is relative to width (outer r - inner r) of one ring 00225 if ( rCount > 0 ) 00226 totalOffset /= ( rCount + 1 ); 00227 d->size /= ( 1.0 + totalOffset ); 00228 00229 00230 qreal x = ( contentsRect.width() == d->size ) ? 0.0 : ( ( contentsRect.width() - d->size ) / 2.0 ); 00231 qreal y = ( contentsRect.height() == d->size ) ? 0.0 : ( ( contentsRect.height() - d->size ) / 2.0 ); 00232 d->position = QRectF( x, y, d->size, d->size ); 00233 d->position.translate( contentsRect.left(), contentsRect.top() ); 00234 00235 const PolarCoordinatePlane * plane = polarCoordinatePlane(); 00236 00237 bool atLeastOneValue = false; // guard against completely empty tables 00238 QVariant vValY; 00239 00240 d->clearListOfAlreadyDrawnDataValueTexts(); 00241 for ( int iRow = 0; iRow < rCount; ++iRow ) { 00242 const qreal sum = valueTotals( iRow ); 00243 if( sum == 0.0 ) //nothing to draw 00244 continue; 00245 qreal currentValue = plane ? plane->startPosition() : 0.0; 00246 const qreal sectorsPerValue = 360.0 / sum; 00247 00248 for ( int iColumn = colCount - 1; iColumn >= 0; --iColumn ) { 00249 // is there anything at all at this column? 00250 bool bOK; 00251 const double cellValue = qAbs( model()->data( model()->index( iRow, iColumn, rootIndex() ) ) 00252 .toDouble( &bOK ) ); 00253 00254 if( bOK ){ 00255 d->startAngles[ iRow ][ iColumn ] = currentValue; 00256 d->angleLens[ iRow ][ iColumn ] = cellValue * sectorsPerValue; 00257 atLeastOneValue = true; 00258 } else { // mark as non-existent 00259 d->angleLens[ iRow ][ iColumn ] = 0.0; 00260 if ( iColumn > 0.0 ) 00261 d->startAngles[ iRow ][ iColumn ] = d->startAngles[ iRow ][ iColumn - 1 ]; 00262 else 00263 d->startAngles[ iRow ][ iColumn ] = currentValue; 00264 } 00265 //qDebug() << "d->startAngles["<<iColumn<<"] == " << d->startAngles[ iColumn ] 00266 // << " + d->angleLens["<<iColumn<<"]" << d->angleLens[ iColumn ] 00267 // << " = " << d->startAngles[ iColumn ]+d->angleLens[ iColumn ]; 00268 00269 currentValue = d->startAngles[ iRow ][ iColumn ] + d->angleLens[ iRow ][ iColumn ]; 00270 00271 drawOnePie( ctx->painter(), iRow, iColumn, granularity() ); 00272 } 00273 } 00274 }
void AbstractDiagram::paintDataValueText | ( | QPainter * | painter, | |
const QModelIndex & | index, | |||
const QPointF & | pos, | |||
double | value | |||
) | [inherited] |
Definition at line 539 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::paintDataValueTexts().
00543 { 00544 d->paintDataValueText( this, painter, index, pos, value ); 00545 }
void AbstractDiagram::paintDataValueTexts | ( | QPainter * | painter | ) | [protected, virtual, inherited] |
This method is obsolete and provided for backward-compatibility only.
Your own diagram classes should call d->paintDataValueTextsAndMarkers() instead which also is taking care for showing your cell-specific comments, if any,
Definition at line 555 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), d, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractCoordinatePlane::translate().
00556 { 00557 if ( !checkInvariants() ) return; 00558 const int rowCount = model()->rowCount(rootIndex()); 00559 const int columnCount = model()->columnCount(rootIndex()); 00560 d->clearListOfAlreadyDrawnDataValueTexts(); 00561 for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) { 00562 for ( int j=0; j< rowCount; ++j ) { 00563 const QModelIndex index = model()->index( j, i, rootIndex() ); 00564 double value = model()->data( index ).toDouble(); 00565 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) ); 00566 paintDataValueText( painter, index, pos, value ); 00567 } 00568 } 00569 }
void RingDiagram::paintEvent | ( | QPaintEvent * | ) | [protected] |
Definition at line 149 of file KDChartRingDiagram.cpp.
References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().
00150 { 00151 QPainter painter ( viewport() ); 00152 PaintContext ctx; 00153 ctx.setPainter ( &painter ); 00154 ctx.setRectangle( QRectF ( 0, 0, width(), height() ) ); 00155 paint ( &ctx ); 00156 }
void AbstractDiagram::paintMarker | ( | QPainter * | painter, | |
const QModelIndex & | index, | |||
const QPointF & | pos | |||
) | [inherited] |
Definition at line 600 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::dataValueAttributes(), and KDChart::AbstractDiagram::paintMarker().
00603 { 00604 if ( !checkInvariants() ) return; 00605 paintMarker( painter, dataValueAttributes( index ), index, pos ); 00606 }
void AbstractDiagram::paintMarker | ( | QPainter * | painter, | |
const DataValueAttributes & | a, | |||
const QModelIndex & | index, | |||
const QPointF & | pos | |||
) | [inherited] |
Definition at line 572 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(), d, KDChart::MarkerAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(), KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(), KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().
00576 { 00577 if ( !checkInvariants() || !a.isVisible() ) return; 00578 const MarkerAttributes ma = a.markerAttributes(); 00579 if ( !ma.isVisible() ) return; 00580 00581 const PainterSaver painterSaver( painter ); 00582 // the size of the marker - unscaled 00583 const QSizeF maSize( ma.markerSize().width() / painter->matrix().m11(), 00584 ma.markerSize().height() / painter->matrix().m22() ); 00585 QBrush indexBrush( brush( index ) ); 00586 QPen indexPen( ma.pen() ); 00587 if ( ma.markerColor().isValid() ) 00588 indexBrush.setColor( ma.markerColor() ); 00589 00590 paintMarker( painter, ma, indexBrush, indexPen, pos, maSize ); 00591 00592 // workaround: BC cannot be changed, otherwise we would pass the 00593 // index down to next-lower paintMarker function. So far, we 00594 // basically save a circle of radius maSize at pos in the 00595 // reverseMapper. This means that ^^^ this version of paintMarker 00596 // needs to be called to reverse-map the marker. 00597 d->reverseMapper.addCircle( index.row(), index.column(), pos, 2 * maSize ); 00598 }
void AbstractDiagram::paintMarker | ( | QPainter * | painter, | |
const MarkerAttributes & | markerAttributes, | |||
const QBrush & | brush, | |||
const QPen & | pen, | |||
const QPointF & | point, | |||
const QSizeF & | size | |||
) | [virtual, inherited] |
Definition at line 608 of file KDChartAbstractDiagram.cpp.
References KDChart::MarkerAttributes::Marker1Pixel, KDChart::MarkerAttributes::Marker4Pixels, KDChart::MarkerAttributes::MarkerCircle, KDChart::MarkerAttributes::MarkerCross, KDChart::MarkerAttributes::MarkerDiamond, KDChart::MarkerAttributes::MarkerFastCross, KDChart::MarkerAttributes::MarkerRing, KDChart::MarkerAttributes::MarkerSquare, KDChart::MarkerAttributes::markerStyle(), p, and KDChart::PrintingParameters::scalePen().
Referenced by KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::MarkerLayoutItem::paintIntoRect(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().
00614 { 00615 const QPen oldPen( painter->pen() ); 00616 // Pen is used to paint 4Pixels - 1 Pixel - Ring and FastCross types. 00617 // make sure to use the brush color - see above in those cases. 00618 const bool isFourPixels = (markerAttributes.markerStyle() == MarkerAttributes::Marker4Pixels); 00619 if( isFourPixels || (markerAttributes.markerStyle() == MarkerAttributes::Marker1Pixel) ){ 00620 // for high-performance point charts with tiny point markers: 00621 painter->setPen( PrintingParameters::scalePen( QPen( brush.color().light() ) ) ); 00622 if( isFourPixels ){ 00623 const qreal x = pos.x(); 00624 const qreal y = pos.y(); 00625 painter->drawLine( QPointF(x-1.0,y-1.0), 00626 QPointF(x+1.0,y-1.0) ); 00627 painter->drawLine( QPointF(x-1.0,y), 00628 QPointF(x+1.0,y) ); 00629 painter->drawLine( QPointF(x-1.0,y+1.0), 00630 QPointF(x+1.0,y+1.0) ); 00631 } 00632 painter->drawPoint( pos ); 00633 }else{ 00634 const PainterSaver painterSaver( painter ); 00635 // we only a solid line surrounding the markers 00636 QPen painterPen( pen ); 00637 painterPen.setStyle( Qt::SolidLine ); 00638 painter->setPen( PrintingParameters::scalePen( painterPen ) ); 00639 painter->setBrush( brush ); 00640 painter->setRenderHint ( QPainter::Antialiasing ); 00641 painter->translate( pos ); 00642 switch ( markerAttributes.markerStyle() ) { 00643 case MarkerAttributes::MarkerCircle: 00644 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2, 00645 maSize.height(), maSize.width()) ); 00646 break; 00647 case MarkerAttributes::MarkerSquare: 00648 { 00649 QRectF rect( 0 - maSize.width()/2, 0 - maSize.height()/2, 00650 maSize.width(), maSize.height() ); 00651 painter->drawRect( rect ); 00652 break; 00653 } 00654 case MarkerAttributes::MarkerDiamond: 00655 { 00656 QVector <QPointF > diamondPoints; 00657 QPointF top, left, bottom, right; 00658 top = QPointF( 0, 0 - maSize.height()/2 ); 00659 left = QPointF( 0 - maSize.width()/2, 0 ); 00660 bottom = QPointF( 0, maSize.height()/2 ); 00661 right = QPointF( maSize.width()/2, 0 ); 00662 diamondPoints << top << left << bottom << right; 00663 painter->drawPolygon( diamondPoints ); 00664 break; 00665 } 00666 // both handled on top of the method: 00667 case MarkerAttributes::Marker1Pixel: 00668 case MarkerAttributes::Marker4Pixels: 00669 break; 00670 case MarkerAttributes::MarkerRing: 00671 { 00672 painter->setPen( PrintingParameters::scalePen( QPen( brush.color() ) ) ); 00673 painter->setBrush( Qt::NoBrush ); 00674 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2, 00675 maSize.height(), maSize.width()) ); 00676 break; 00677 } 00678 case MarkerAttributes::MarkerCross: 00679 { 00680 // Note: Markers can have outline, 00681 // so just drawing two rects is NOT the solution here! 00682 const qreal w02 = maSize.width() * 0.2; 00683 const qreal w05 = maSize.width() * 0.5; 00684 const qreal h02 = maSize.height()* 0.2; 00685 const qreal h05 = maSize.height()* 0.5; 00686 QVector <QPointF > crossPoints; 00687 QPointF p[12]; 00688 p[ 0] = QPointF( -w02, -h05 ); 00689 p[ 1] = QPointF( w02, -h05 ); 00690 p[ 2] = QPointF( w02, -h02 ); 00691 p[ 3] = QPointF( w05, -h02 ); 00692 p[ 4] = QPointF( w05, h02 ); 00693 p[ 5] = QPointF( w02, h02 ); 00694 p[ 6] = QPointF( w02, h05 ); 00695 p[ 7] = QPointF( -w02, h05 ); 00696 p[ 8] = QPointF( -w02, h02 ); 00697 p[ 9] = QPointF( -w05, h02 ); 00698 p[10] = QPointF( -w05, -h02 ); 00699 p[11] = QPointF( -w02, -h02 ); 00700 for( int i=0; i<12; ++i ) 00701 crossPoints << p[i]; 00702 crossPoints << p[0]; 00703 painter->drawPolygon( crossPoints ); 00704 break; 00705 } 00706 case MarkerAttributes::MarkerFastCross: 00707 { 00708 QPointF left, right, top, bottom; 00709 left = QPointF( -maSize.width()/2, 0 ); 00710 right = QPointF( maSize.width()/2, 0 ); 00711 top = QPointF( 0, -maSize.height()/2 ); 00712 bottom= QPointF( 0, maSize.height()/2 ); 00713 painter->setPen( PrintingParameters::scalePen( QPen( brush.color() ) ) ); 00714 painter->drawLine( left, right ); 00715 painter->drawLine( top, bottom ); 00716 break; 00717 } 00718 default: 00719 Q_ASSERT_X ( false, "paintMarkers()", 00720 "Type item does not match a defined Marker Type." ); 00721 } 00722 } 00723 painter->setPen( oldPen ); 00724 }
void AbstractDiagram::paintMarkers | ( | QPainter * | painter | ) | [protected, virtual, inherited] |
This method is obsolete and provided for backward-compatibility only.
Your own diagram classes should call d->paintDataValueTextsAndMarkers() instead which also is taking care for showing your cell-specific comments, if any,
Definition at line 726 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractCoordinatePlane::translate().
00727 { 00728 if ( !checkInvariants() ) return; 00729 const int rowCount = model()->rowCount(rootIndex()); 00730 const int columnCount = model()->columnCount(rootIndex()); 00731 for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) { 00732 for ( int j=0; j< rowCount; ++j ) { 00733 const QModelIndex index = model()->index( j, i, rootIndex() ); 00734 double value = model()->data( index ).toDouble(); 00735 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) ); 00736 paintMarker( painter, index, pos ); 00737 } 00738 } 00739 }
QPen AbstractDiagram::pen | ( | const QModelIndex & | index | ) | const [inherited] |
Retrieve the pen to be used, for painting the datapoint at the given index in the model.
index | The index of the datapoint in the model. With a dataset dimension of two, this is the index of the key of each key/value pair. |
Definition at line 792 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetPenRole.
00793 { 00794 return qVariantValue<QPen>( 00795 attributesModel()->data( 00796 conditionallyMapFromSource( index ), 00797 DatasetPenRole ) ); 00798 }
QPen AbstractDiagram::pen | ( | int | dataset | ) | const [inherited] |
Retrieve the pen to be used for the given dataset.
This will fall back automatically to what was set at model level, if there are no dataset specific settings.
dataset | The dataset to retrieve the pen for. |
Definition at line 777 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, and KDChart::AbstractDiagram::pen().
00778 { 00779 // To store the pen for a dataset, we use the first column 00780 // that's associated with it. (i.e., with a dataset dimension 00781 // of two, the column of the keys) 00782 const int column = dataset * datasetDimension(); 00783 00784 const QVariant penSettings( 00785 attributesModel()->headerData( column, Qt::Vertical, 00786 DatasetPenRole ) ); 00787 if( penSettings.isValid() ) 00788 return qVariantValue< QPen >( penSettings ); 00789 return pen(); 00790 }
QPen AbstractDiagram::pen | ( | ) | const [inherited] |
Retrieve the pen to be used for painting datapoints globally.
This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 771 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetPenRole.
Referenced by KDChart::AbstractDiagram::datasetPens(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::LeveyJenningsDiagram::paint(), and KDChart::AbstractDiagram::pen().
00772 { 00773 return qVariantValue<QPen>( 00774 attributesModel()->data( DatasetPenRole ) ); 00775 }
bool AbstractDiagram::percentMode | ( | ) | const [inherited] |
Definition at line 533 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::compare().
00534 { 00535 return d->percent; 00536 }
PieAttributes AbstractPieDiagram::pieAttributes | ( | const QModelIndex & | index | ) | const [inherited] |
Definition at line 153 of file KDChartAbstractPieDiagram.cpp.
References d, and KDChart::PieAttributesRole.
00154 { 00155 return qVariantValue<PieAttributes>( 00156 d->attributesModel->data( 00157 d->attributesModel->mapFromSource( index ), 00158 PieAttributesRole ) ); 00159 }
PieAttributes AbstractPieDiagram::pieAttributes | ( | int | column | ) | const [inherited] |
Definition at line 143 of file KDChartAbstractPieDiagram.cpp.
References d, KDChart::AbstractPieDiagram::pieAttributes(), and KDChart::PieAttributesRole.
00144 { 00145 const QVariant attrs( 00146 d->attributesModel->headerData( column, Qt::Vertical, 00147 PieAttributesRole ) ); 00148 if( attrs.isValid() ) 00149 return qVariantValue< PieAttributes >( attrs ); 00150 return pieAttributes(); 00151 }
PieAttributes AbstractPieDiagram::pieAttributes | ( | ) | const [inherited] |
Definition at line 134 of file KDChartAbstractPieDiagram.cpp.
References d, and KDChart::PieAttributesRole.
Referenced by calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), paint(), KDChart::PieDiagram::paintInternal(), and KDChart::AbstractPieDiagram::pieAttributes().
00135 { 00136 return qVariantValue<PieAttributes>( 00137 d->attributesModel->data( PieAttributesRole ) ); 00138 }
const PolarCoordinatePlane * AbstractPolarDiagram::polarCoordinatePlane | ( | ) | const [inherited] |
Definition at line 55 of file KDChartAbstractPolarDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane().
Referenced by paint(), and KDChart::PieDiagram::paintInternal().
00056 { 00057 return dynamic_cast<const PolarCoordinatePlane*>( coordinatePlane() ); 00058 }
void KDChart::AbstractDiagram::propertiesChanged | ( | ) | [signal, inherited] |
Emitted upon change of a property of the Diagram.
Referenced by KDChart::Plotter::resetLineAttributes(), KDChart::LineDiagram::resetLineAttributes(), KDChart::AbstractDiagram::setAllowOverlappingDataValueTexts(), KDChart::AbstractDiagram::setAntiAliasing(), KDChart::BarDiagram::setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::LineDiagram::setCenterDataPoints(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::Plotter::setLineAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::BarDiagram::setOrientation(), KDChart::AbstractDiagram::setPen(), KDChart::AbstractDiagram::setPercentMode(), StockDiagram::setStockBarAttributes(), StockDiagram::setThreeDBarAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), StockDiagram::setType(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), KDChart::BarDiagram::setType(), KDChart::Plotter::setValueTrackerAttributes(), and KDChart::LineDiagram::setValueTrackerAttributes().
bool RingDiagram::relativeThickness | ( | ) | const |
Definition at line 98 of file KDChartRingDiagram.cpp.
References d.
Referenced by compare().
00099 { 00100 return d->relativeThickness; 00101 }
void RingDiagram::resize | ( | const QSizeF & | area | ) | [virtual] |
[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 301 of file KDChartRingDiagram.cpp.
void RingDiagram::resizeEvent | ( | QResizeEvent * | ) | [protected] |
int AbstractPolarDiagram::rowCount | ( | ) | const [inherited] |
Definition at line 65 of file KDChartAbstractPolarDiagram.cpp.
References KDChart::AbstractPolarDiagram::numberOfDatasets().
Referenced by calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), paint(), KDChart::PolarDiagram::paint(), and valueTotals().
00066 { 00067 return static_cast<int>( numberOfDatasets() ); 00068 }
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 505 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::propertiesChanged().
00506 { 00507 d->allowOverlappingDataValueTexts = allow; 00508 emit propertiesChanged(); 00509 }
void AbstractDiagram::setAntiAliasing | ( | bool | enabled | ) | [inherited] |
Set whether anti-aliasing is to be used while rendering this diagram.
enabled | True means that AA is enabled. |
Definition at line 516 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::propertiesChanged().
00517 { 00518 d->antiAliasing = enabled; 00519 emit propertiesChanged(); 00520 }
void AbstractDiagram::setAttributesModel | ( | AttributesModel * | amodel | ) | [virtual, inherited] |
Associate an AttributesModel with this diagram.
Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used with AttributesModels that have been explicitly created by the user, and are owned by her. Setting an AttributesModel that is internal to another diagram is an error.
Correct:
AttributesModel *am = new AttributesModel( model, 0 );
diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );
Wrong:
diagram1->setAttributesModel( diagram2->attributesModel() );
model | The AttributesModel to use for this diagram. |
Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 290 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::modelsChanged(), and KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::AbstractCartesianDiagram::setAttributesModel().
00291 { 00292 if( amodel->sourceModel() != model() ) { 00293 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: " 00294 "Trying to set an attributesmodel which works on a different " 00295 "model than the diagram."); 00296 return; 00297 } 00298 if( qobject_cast<PrivateAttributesModel*>(amodel) ) { 00299 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: " 00300 "Trying to set an attributesmodel that is private to another diagram."); 00301 return; 00302 } 00303 d->setAttributesModel(amodel); 00304 scheduleDelayedItemsLayout(); 00305 setDataBoundariesDirty(); 00306 emit modelsChanged(); 00307 }
void AbstractDiagram::setAttributesModelRootIndex | ( | const QModelIndex & | idx | ) | [protected, inherited] |
Definition at line 336 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::AbstractDiagram::setRootIndex().
00337 { 00338 d->attributesModelRootIndex=idx; 00339 setDataBoundariesDirty(); 00340 scheduleDelayedItemsLayout(); 00341 }
void AbstractDiagram::setBrush | ( | const QBrush & | brush | ) | [inherited] |
Set the brush to be used, for painting all datasets in the model.
brush | The brush to use. |
Definition at line 808 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().
00809 { 00810 attributesModel()->setModelData( 00811 qVariantFromValue( brush ), DatasetBrushRole ); 00812 emit propertiesChanged(); 00813 }
void AbstractDiagram::setBrush | ( | int | dataset, | |
const QBrush & | brush | |||
) | [inherited] |
Set the brush to be used, for painting the given dataset.
dataset | The dataset to set the brush for. | |
brush | The brush to use. |
Definition at line 815 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().
00816 { 00817 // To store the brush for a dataset, we use the first column 00818 // that's associated with it. (i.e., with a dataset dimension 00819 // of two, the column of the keys) 00820 const int column = dataset * datasetDimension(); 00821 00822 attributesModel()->setHeaderData( 00823 column, Qt::Vertical, 00824 qVariantFromValue( brush ), 00825 DatasetBrushRole ); 00826 emit propertiesChanged(); 00827 }
void AbstractDiagram::setBrush | ( | const QModelIndex & | index, | |
const QBrush & | brush | |||
) | [inherited] |
Set the brush to be used, for painting the datapoint at the given index.
index | The datapoint's index in the model. With a dataset dimension of two, this is the index of the key of each key/value pair. | |
brush | The brush to use. |
Definition at line 800 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().
00801 { 00802 attributesModel()->setData( 00803 conditionallyMapFromSource( index ), 00804 qVariantFromValue( brush ), DatasetBrushRole ); 00805 emit propertiesChanged(); 00806 }
void AbstractDiagram::setCoordinatePlane | ( | AbstractCoordinatePlane * | plane | ) | [virtual, inherited] |
Set the coordinate plane associated with the diagram.
This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.
Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 352 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesianDiagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().
00353 { 00354 d->plane = parent; 00355 }
void AbstractDiagram::setDataBoundariesDirty | ( | ) | const [protected, slot, inherited] |
Definition at line 236 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::dataChanged(), StockDiagram::resize(), KDChart::Plotter::resize(), KDChart::LineDiagram::resize(), KDChart::BarDiagram::resize(), KDChart::AbstractDiagram::setAttributesModel(), KDChart::AbstractDiagram::setAttributesModelRootIndex(), KDChart::AbstractDiagram::setDatasetDimensionInternal(), KDChart::AbstractDiagram::setModel(), KDChart::BarDiagram::setOrientation(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().
00237 { 00238 d->databoundariesDirty = true; 00239 }
void AbstractDiagram::setDatasetDimension | ( | int | dimension | ) | [inherited] |
Sets the dataset dimension of the diagram. Using this method is obsolete. Use the specific diagram types instead.
Definition at line 1094 of file KDChartAbstractDiagram.cpp.
01095 { 01096 Q_UNUSED( dimension ); 01097 qDebug() << "Setting the dataset dimension using AbstractDiagram::setDatasetDimension is obsolete. Use the specific diagram types instead."; 01098 }
void AbstractDiagram::setDatasetDimensionInternal | ( | int | dimension | ) | [protected, inherited] |
Definition at line 1100 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram(), and KDChart::TernaryPointDiagram::TernaryPointDiagram().
01101 { 01102 Q_ASSERT( dimension != 0 ); 01103 01104 if ( d->datasetDimension == dimension ) return; 01105 d->datasetDimension = dimension; 01106 setDataBoundariesDirty(); 01107 emit layoutChanged( this ); 01108 }
void AbstractDiagram::setDataValueAttributes | ( | const DataValueAttributes & | a | ) | [inherited] |
Set the DataValueAttributes for all datapoints in the model.
a | The attributes to set. |
Definition at line 499 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00500 { 00501 d->attributesModel->setModelData( qVariantFromValue( a ), DataValueLabelAttributesRole ); 00502 emit propertiesChanged(); 00503 }
void AbstractDiagram::setDataValueAttributes | ( | int | dataset, | |
const DataValueAttributes & | a | |||
) | [inherited] |
Set the DataValueAttributes for the given dataset.
dataset | The dataset to set the attributes for. | |
a | The attributes to set. |
Definition at line 447 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::datasetDimension(), KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00448 { 00449 // To store the attributes for a dataset, we use the first column 00450 // that's associated with it. (i.e., with a dataset dimension 00451 // of two, the column of the keys) 00452 const int column = dataset * datasetDimension(); 00453 d->attributesModel->setHeaderData( 00454 column, Qt::Vertical, 00455 qVariantFromValue( a ), DataValueLabelAttributesRole ); 00456 emit propertiesChanged(); 00457 }
void AbstractDiagram::setDataValueAttributes | ( | const QModelIndex & | index, | |
const DataValueAttributes & | a | |||
) | [inherited] |
Set the DataValueAttributes for the given index.
index | The datapoint to set the attributes for. With a dataset dimension of two, this is the index of the key of each key/value pair. | |
a | The attributes to set. |
Definition at line 436 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00438 { 00439 d->attributesModel->setData( 00440 conditionallyMapFromSource( index ), 00441 qVariantFromValue( a ), 00442 DataValueLabelAttributesRole ); 00443 emit propertiesChanged(); 00444 }
void RingDiagram::setExpandWhenExploded | ( | bool | expand | ) | [virtual] |
Definition at line 103 of file KDChartRingDiagram.cpp.
References d.
00104 { 00105 d->expandWhenExploded = expand; 00106 }
void AbstractPieDiagram::setGranularity | ( | qreal | value | ) | [inherited] |
Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead of rounded segments.
value | the granularity value between 0.05 (one twentieth of a degree) and 36.0 (one tenth of a full circle), other values will be interpreted as 1.0. |
Definition at line 87 of file KDChartAbstractPieDiagram.cpp.
References d.
00088 { 00089 d->granularity = value; 00090 }
void AbstractDiagram::setHidden | ( | bool | hidden | ) | [inherited] |
Hide (or unhide, resp.
) all datapoints in the model.
hidden | The hidden status to set. |
Definition at line 399 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.
00400 { 00401 d->attributesModel->setModelData( 00402 qVariantFromValue( hidden ), 00403 DataHiddenRole ); 00404 emit dataHidden(); 00405 }
void AbstractDiagram::setHidden | ( | int | dataset, | |
bool | hidden | |||
) | [inherited] |
Hide (or unhide, resp.
) a dataset.
dataset | The dataset to set the hidden status for. | |
hidden | The hidden status to set. |
Definition at line 386 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::dataHidden(), KDChart::DataHiddenRole, and KDChart::AbstractDiagram::datasetDimension().
00387 { 00388 // To store the flag for a dataset, we use the first column 00389 // that's associated with it. (i.e., with a dataset dimension 00390 // of two, the column of the keys) 00391 const int column = dataset * datasetDimension(); 00392 d->attributesModel->setHeaderData( 00393 column, Qt::Vertical, 00394 qVariantFromValue( hidden ), 00395 DataHiddenRole ); 00396 emit dataHidden(); 00397 }
void AbstractDiagram::setHidden | ( | const QModelIndex & | index, | |
bool | hidden | |||
) | [inherited] |
Hide (or unhide, resp.
) a data cell.
index | The datapoint to set the hidden status for. With a dataset dimension of two, this is the index of the key of each key/value pair. | |
hidden | The hidden status to set. |
Definition at line 377 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.
00378 { 00379 d->attributesModel->setData( 00380 conditionallyMapFromSource( index ), 00381 qVariantFromValue( hidden ), 00382 DataHiddenRole ); 00383 emit dataHidden(); 00384 }
void AbstractDiagram::setModel | ( | QAbstractItemModel * | model | ) | [virtual, inherited] |
Associate a model with the diagram.
Reimplemented in KDChart::AbstractCartesianDiagram, and KDChart::LeveyJenningsDiagram.
Definition at line 241 of file KDChartAbstractDiagram.cpp.
References d, KDChart::AttributesModel::initFrom(), KDChart::AbstractDiagram::layoutChanged(), and KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::AbstractCartesianDiagram::setModel(), and KDChart::Widget::setType().
00242 { 00243 if( model() ) 00244 { 00245 disconnect( model(), SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00246 disconnect( model(), SIGNAL( columnsInserted( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00247 disconnect( model(), SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00248 disconnect( model(), SIGNAL( columnsRemoved( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00249 disconnect( model(), SIGNAL( modelReset() ), this, SLOT( setDataBoundariesDirty() ) ); 00250 disconnect( model(), SIGNAL( layoutChanged() ), this, SLOT( setDataBoundariesDirty() ) ); 00251 } 00252 QAbstractItemView::setModel( newModel ); 00253 AttributesModel* amodel = new PrivateAttributesModel( newModel, this ); 00254 amodel->initFrom( d->attributesModel ); 00255 d->setAttributesModel(amodel); 00256 scheduleDelayedItemsLayout(); 00257 setDataBoundariesDirty(); 00258 if( model() ) 00259 { 00260 connect( model(), SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00261 connect( model(), SIGNAL( columnsInserted( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00262 connect( model(), SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00263 connect( model(), SIGNAL( columnsRemoved( QModelIndex, int, int ) ), this, SLOT( setDataBoundariesDirty() ) ); 00264 connect( model(), SIGNAL( modelReset() ), this, SLOT( setDataBoundariesDirty() ) ); 00265 connect( model(), SIGNAL( layoutChanged() ), this, SLOT( setDataBoundariesDirty() ) ); 00266 } 00267 }
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 750 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().
00751 { 00752 attributesModel()->setModelData( 00753 qVariantFromValue( pen ), DatasetPenRole ); 00754 emit propertiesChanged(); 00755 }
void AbstractDiagram::setPen | ( | int | dataset, | |
const QPen & | pen | |||
) | [inherited] |
Set the pen to be used, for painting the given dataset.
dataset | The dataset to set the pen for. | |
pen | The pen to use. |
Definition at line 757 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().
00758 { 00759 // To store the pen for a dataset, we use the first column 00760 // that's associated with it. (i.e., with a dataset dimension 00761 // of two, the column of the keys) 00762 const int column = dataset * datasetDimension(); 00763 00764 attributesModel()->setHeaderData( 00765 column, Qt::Vertical, 00766 qVariantFromValue( pen ), 00767 DatasetPenRole ); 00768 emit propertiesChanged(); 00769 }
void AbstractDiagram::setPen | ( | const QModelIndex & | index, | |
const QPen & | pen | |||
) | [inherited] |
Set the pen to be used, for painting the datapoint at the given index.
index | The datapoint's index in the model. With a dataset dimension of two, this is the index of the key of each key/value pair. | |
pen | The pen to use. |
Definition at line 742 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().
Referenced by StockDiagram::init().
00743 { 00744 attributesModel()->setData( 00745 conditionallyMapFromSource( index ), 00746 qVariantFromValue( pen ), DatasetPenRole ); 00747 emit propertiesChanged(); 00748 }
void AbstractDiagram::setPercentMode | ( | bool | percent | ) | [inherited] |
Definition at line 527 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::propertiesChanged().
Referenced by KDChart::BarDiagram::setOrientation(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().
00528 { 00529 d->percent = percent; 00530 emit propertiesChanged(); 00531 }
void AbstractPieDiagram::setPieAttributes | ( | const QModelIndex & | index, | |
const PieAttributes & | a | |||
) | [inherited] |
Definition at line 125 of file KDChartAbstractPieDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::PieAttributesRole.
00126 { 00127 d->attributesModel->setData( index, qVariantFromValue( attrs), PieAttributesRole ); 00128 emit layoutChanged( this ); 00129 }
void AbstractPieDiagram::setPieAttributes | ( | int | column, | |
const PieAttributes & | a | |||
) | [inherited] |
Definition at line 118 of file KDChartAbstractPieDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::PieAttributesRole.
00119 { 00120 d->attributesModel->setHeaderData( 00121 column, Qt::Vertical, qVariantFromValue( attrs ), PieAttributesRole ); 00122 emit layoutChanged( this ); 00123 }
void AbstractPieDiagram::setPieAttributes | ( | const PieAttributes & | a | ) | [inherited] |
Definition at line 112 of file KDChartAbstractPieDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::PieAttributesRole.
00113 { 00114 d->attributesModel->setModelData( qVariantFromValue( attrs ), PieAttributesRole ); 00115 emit layoutChanged( this ); 00116 }
void RingDiagram::setRelativeThickness | ( | bool | relativeThickness | ) |
Definition at line 93 of file KDChartRingDiagram.cpp.
References d.
00094 { 00095 d->relativeThickness = relativeThickness; 00096 }
void AbstractDiagram::setRootIndex | ( | const QModelIndex & | idx | ) | [virtual, inherited] |
Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 329 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::setAttributesModelRootIndex().
Referenced by KDChart::AbstractCartesianDiagram::setRootIndex().
00330 { 00331 QAbstractItemView::setRootIndex(idx); 00332 setAttributesModelRootIndex( d->attributesModel->mapFromSource(idx) ); 00333 }
void AbstractDiagram::setSelection | ( | const QRect & | rect, | |
QItemSelectionModel::SelectionFlags | command | |||
) | [virtual, inherited] |
[reimplemented]
Definition at line 967 of file KDChartAbstractDiagram.cpp.
References d.
00968 { 00969 const QModelIndexList indexes = d->indexesIn( rect ); 00970 QItemSelection selection; 00971 KDAB_FOREACH( const QModelIndex& index, indexes ) 00972 { 00973 selection.append( QItemSelectionRange( index ) ); 00974 } 00975 selectionModel()->select( selection, command ); 00976 }
void AbstractDiagram::setSelectionModel | ( | QItemSelectionModel * | selectionModel | ) | [virtual, inherited] |
Associate a seleection model with the diagrom.
Definition at line 269 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::modelsChanged().
00270 { 00271 if( selectionModel() ) 00272 { 00273 disconnect( selectionModel(), SIGNAL( currentChanged( QModelIndex, QModelIndex ) ), this, SIGNAL( modelsChanged() ) ); 00274 disconnect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SIGNAL( modelsChanged() ) ); 00275 } 00276 QAbstractItemView::setSelectionModel( newSelectionModel ); 00277 if( selectionModel() ) 00278 { 00279 connect( selectionModel(), SIGNAL( currentChanged( QModelIndex, QModelIndex ) ), this, SIGNAL( modelsChanged() ) ); 00280 connect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SIGNAL( modelsChanged() ) ); 00281 } 00282 emit modelsChanged(); 00283 }
void AbstractPieDiagram::setStartPosition | ( | int | degrees | ) | [inherited] |
Definition at line 100 of file KDChartAbstractPieDiagram.cpp.
00101 { 00102 Q_UNUSED( degrees ); 00103 qWarning() << "Deprecated AbstractPieDiagram::setStartPosition() called, setting ignored."; 00104 }
void AbstractPieDiagram::setThreeDPieAttributes | ( | const QModelIndex & | index, | |
const ThreeDPieAttributes & | a | |||
) | [inherited] |
Definition at line 175 of file KDChartAbstractPieDiagram.cpp.
References KDChart::AbstractDiagram::layoutChanged(), and KDChart::ThreeDPieAttributesRole.
00176 { 00177 model()->setData( index, qVariantFromValue( tda ), ThreeDPieAttributesRole ); 00178 emit layoutChanged( this ); 00179 }
void AbstractPieDiagram::setThreeDPieAttributes | ( | int | column, | |
const ThreeDPieAttributes & | a | |||
) | [inherited] |
Definition at line 168 of file KDChartAbstractPieDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::ThreeDPieAttributesRole.
00169 { 00170 d->attributesModel->setHeaderData( 00171 column, Qt::Vertical, qVariantFromValue( tda ), ThreeDPieAttributesRole ); 00172 emit layoutChanged( this ); 00173 }
void AbstractPieDiagram::setThreeDPieAttributes | ( | const ThreeDPieAttributes & | a | ) | [inherited] |
Definition at line 162 of file KDChartAbstractPieDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::ThreeDPieAttributesRole.
00163 { 00164 d->attributesModel->setModelData( qVariantFromValue( tda ), ThreeDPieAttributesRole ); 00165 emit layoutChanged( this ); 00166 }
void AbstractDiagram::setUnitPrefix | ( | const QString & | prefix, | |
Qt::Orientation | orientation | |||
) | [inherited] |
Set the unit prefix to be used on axes for all columns.
Sets the unit prefix for all values.
prefix | The prefix to be used. | |
orientation | The orientation of the axis to use. | |
prefix | the prefix to be set | |
orientation | the orientantion of the axis to set |
Definition at line 872 of file KDChartAbstractDiagram.cpp.
References d.
00873 { 00874 d->unitPrefix[ orientation ] = prefix; 00875 }
void AbstractDiagram::setUnitPrefix | ( | const QString & | prefix, | |
int | column, | |||
Qt::Orientation | orientation | |||
) | [inherited] |
Set the unit prefix to be used on axes for one specific column.
Sets the unit prefix for one value.
prefix | The prefix to be used. | |
column | The column which should be set. | |
orientation | The orientation of the axis to use. | |
prefix | the prefix to be set | |
column | the value using that prefix | |
orientation | the orientantion of the axis to set |
Definition at line 862 of file KDChartAbstractDiagram.cpp.
References d.
00863 { 00864 d->unitPrefixMap[ column ][ orientation ]= prefix; 00865 }
void AbstractDiagram::setUnitSuffix | ( | const QString & | suffix, | |
Qt::Orientation | orientation | |||
) | [inherited] |
Set the unit prefix to be used on axes for all columns.
Sets the unit suffix for all values.
suffix | The suffix to be used. | |
orientation | The orientation of the axis to use. | |
suffix | the suffix to be set | |
orientation | the orientantion of the axis to set |
Definition at line 893 of file KDChartAbstractDiagram.cpp.
References d.
00894 { 00895 d->unitSuffix[ orientation ] = suffix; 00896 }
void AbstractDiagram::setUnitSuffix | ( | const QString & | suffix, | |
int | column, | |||
Qt::Orientation | orientation | |||
) | [inherited] |
Set the unit prefix to be used on axes for one specific column.
Sets the unit suffix for one value.
suffix | The suffix to be used. | |
column | The column which should be set. | |
orientation | The orientation of the axis to use. | |
suffix | the suffix to be set | |
column | the value using that suffix | |
orientation | the orientantion of the axis to set |
Definition at line 883 of file KDChartAbstractDiagram.cpp.
References d.
00884 { 00885 d->unitSuffixMap[ column ][ orientation ]= suffix; 00886 }
int AbstractPieDiagram::startPosition | ( | ) | const [inherited] |
Definition at line 106 of file KDChartAbstractPieDiagram.cpp.
Referenced by KDChart::AbstractPieDiagram::compare().
00107 { 00108 qWarning() << "Deprecated AbstractPieDiagram::startPosition() called."; 00109 return 0; 00110 }
ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes | ( | const QModelIndex & | index | ) | const [inherited] |
Definition at line 203 of file KDChartAbstractPieDiagram.cpp.
References d, and KDChart::ThreeDPieAttributesRole.
00204 { 00205 return qVariantValue<ThreeDPieAttributes>( 00206 d->attributesModel->data( 00207 d->attributesModel->mapFromSource( index ), 00208 ThreeDPieAttributesRole ) ); 00209 }
ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes | ( | int | column | ) | const [inherited] |
Definition at line 193 of file KDChartAbstractPieDiagram.cpp.
References d, KDChart::AbstractPieDiagram::threeDPieAttributes(), and KDChart::ThreeDPieAttributesRole.
00194 { 00195 const QVariant attrs( 00196 d->attributesModel->headerData( column, Qt::Vertical, 00197 ThreeDPieAttributesRole ) ); 00198 if( attrs.isValid() ) 00199 return qVariantValue< ThreeDPieAttributes >( attrs ); 00200 return threeDPieAttributes(); 00201 }
ThreeDPieAttributes AbstractPieDiagram::threeDPieAttributes | ( | ) | const [inherited] |
Definition at line 184 of file KDChartAbstractPieDiagram.cpp.
References d, and KDChart::ThreeDPieAttributesRole.
Referenced by KDChart::PieDiagram::paintInternal(), and KDChart::AbstractPieDiagram::threeDPieAttributes().
00185 { 00186 return qVariantValue<ThreeDPieAttributes>( 00187 d->attributesModel->data( ThreeDPieAttributesRole ) ); 00188 }
QString AbstractDiagram::unitPrefix | ( | Qt::Orientation | orientation | ) | const [inherited] |
Retrieves the axis unit prefix.
Returns the global unit prefix.
orientation | The orientation of the axis. |
orientation | the orientation of the axis |
Definition at line 916 of file KDChartAbstractDiagram.cpp.
References d.
00917 { 00918 return d->unitPrefix[ orientation ]; 00919 }
QString AbstractDiagram::unitPrefix | ( | int | column, | |
Qt::Orientation | orientation, | |||
bool | fallback = false | |||
) | const [inherited] |
Retrieves the axis unit prefix for a specific column.
Returns the unit prefix for a special value.
column | The column whose prefix should be retrieved. | |
orientation | The orientation of the axis. | |
fallback | If true, the prefix for all columns is returned, when none is set for the selected column. |
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 905 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().
00906 { 00907 if( !fallback || d->unitPrefixMap[ column ].contains( orientation ) ) 00908 return d->unitPrefixMap[ column ][ orientation ]; 00909 return d->unitPrefix[ orientation ]; 00910 }
QString AbstractDiagram::unitSuffix | ( | Qt::Orientation | orientation | ) | const [inherited] |
Retrieves the axis unit suffix.
Returns the global unit suffix.
orientation | The orientation of the axis. |
orientation | the orientation of the axis |
Definition at line 939 of file KDChartAbstractDiagram.cpp.
References d.
00940 { 00941 return d->unitSuffix[ orientation ]; 00942 }
QString AbstractDiagram::unitSuffix | ( | int | column, | |
Qt::Orientation | orientation, | |||
bool | fallback = false | |||
) | const [inherited] |
Retrieves the axis unit suffix for a specific column.
Returns the unit suffix for a special value.
column | The column whose prefix should be retrieved. | |
orientation | The orientation of the axis. | |
fallback | If true, the suffix for all columns is returned, when none is set for the selected column. |
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 928 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().
00929 { 00930 if( !fallback || d->unitSuffixMap[ column ].contains( orientation ) ) 00931 return d->unitSuffixMap[ column ][ orientation ]; 00932 return d->unitSuffix[ orientation ]; 00933 }
void AbstractDiagram::update | ( | ) | const [inherited] |
Definition at line 1116 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::doItemsLayout(), KDChart::LeveyJenningsDiagram::setExpectedMeanValue(), KDChart::LeveyJenningsDiagram::setExpectedStandardDeviation(), KDChart::LeveyJenningsDiagram::setFluidicsPackChangedSymbolPosition(), KDChart::LeveyJenningsDiagram::setFluidicsPackChanges(), KDChart::LeveyJenningsDiagram::setLotChangedSymbolPosition(), KDChart::LeveyJenningsDiagram::setScanLinePen(), KDChart::LeveyJenningsDiagram::setSensorChangedSymbolPosition(), KDChart::LeveyJenningsDiagram::setSensorChanges(), KDChart::LeveyJenningsDiagram::setSymbol(), and KDChart::LeveyJenningsDiagram::setTimeRange().
01117 { 01118 //qDebug("KDChart::AbstractDiagram::update() called"); 01119 if( d->plane ) 01120 d->plane->update(); 01121 }
void KDChart::AbstractDiagram::useDefaultColors | ( | ) | [inherited] |
Set the palette to be used, for painting datasets to the default palette.
Definition at line 994 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeDefault.
00995 { 00996 d->attributesModel->setPaletteType( AttributesModel::PaletteTypeDefault ); 00997 }
void KDChart::AbstractDiagram::useRainbowColors | ( | ) | [inherited] |
Set the palette to be used, for painting datasets to the rainbow palette.
Definition at line 1004 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeRainbow.
01005 { 01006 d->attributesModel->setPaletteType( AttributesModel::PaletteTypeRainbow ); 01007 }
bool AbstractDiagram::usesExternalAttributesModel | ( | ) | const [virtual, inherited] |
Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel.
Definition at line 309 of file KDChartAbstractDiagram.cpp.
References d.
00310 { 00311 return d->usesExternalAttributesModel(); 00312 }
void KDChart::AbstractDiagram::useSubduedColors | ( | ) | [inherited] |
Set the palette to be used, for painting datasets to the subdued palette.
Definition at line 999 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeSubdued.
01000 { 01001 d->attributesModel->setPaletteType( AttributesModel::PaletteTypeSubdued ); 01002 }
double AbstractDiagram::valueForCell | ( | int | row, | |
int | column | |||
) | const [protected, inherited] |
Helper method, retrieving the data value (DisplayRole) for a given row and column.
row | The row to query. | |
column | The column to query. |
Definition at line 1110 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
01111 { 01112 return d->attributesModel->data( 01113 d->attributesModel->index( row, column, attributesModelRootIndex() ) ).toDouble(); 01114 }
double RingDiagram::valueTotals | ( | int | dataset | ) | const |
Definition at line 499 of file KDChartRingDiagram.cpp.
References KDChart::AbstractPolarDiagram::columnCount().
00500 { 00501 const int colCount = columnCount(); 00502 double total = 0.0; 00503 for ( int j = 0; j < colCount; ++j ) { 00504 total += qAbs(model()->data( model()->index( dataset, j, rootIndex() ) ).toDouble()); 00505 //qDebug() << model()->data( model()->index( 0, j, rootIndex() ) ).toDouble(); 00506 } 00507 return total; 00508 }
double RingDiagram::valueTotals | ( | ) | const [virtual] |
[reimplemented]
Implements KDChart::AbstractPolarDiagram.
Definition at line 485 of file KDChartRingDiagram.cpp.
References KDChart::AbstractPolarDiagram::columnCount(), and KDChart::AbstractPolarDiagram::rowCount().
Referenced by paint().
00486 { 00487 const int rCount = rowCount(); 00488 const int colCount = columnCount(); 00489 double total = 0.0; 00490 for ( int i = 0; i < rCount; ++i ) { 00491 for ( int j = 0; j < colCount; ++j ) { 00492 total += qAbs(model()->data( model()->index( 0, j, rootIndex() ) ).toDouble()); 00493 //qDebug() << model()->data( model()->index( 0, j, rootIndex() ) ).toDouble(); 00494 } 00495 } 00496 return total; 00497 }
int AbstractDiagram::verticalOffset | ( | ) | const [virtual, inherited] |
QRect AbstractDiagram::visualRect | ( | const QModelIndex & | index | ) | const [virtual, inherited] |
[reimplemented]
Definition at line 945 of file KDChartAbstractDiagram.cpp.
References d.
00946 { 00947 return d->reverseMapper.boundingRect( index.row(), index.column() ).toRect(); 00948 }
QRegion AbstractDiagram::visualRegion | ( | const QModelIndex & | index | ) | const [virtual, inherited] |
Definition at line 988 of file KDChartAbstractDiagram.cpp.
References d.
00989 { 00990 QPolygonF polygon = d->reverseMapper.polygon(index.row(), index.column()); 00991 return polygon.isEmpty() ? QRegion() : QRegion( polygon.toPolygon() ); 00992 }
QRegion AbstractDiagram::visualRegionForSelection | ( | const QItemSelection & | selection | ) | const [virtual, inherited] |
[reimplemented]
Definition at line 978 of file KDChartAbstractDiagram.cpp.
References d.
00979 { 00980 QPolygonF polygon; 00981 KDAB_FOREACH( const QModelIndex& index, selection.indexes() ) 00982 { 00983 polygon << d->reverseMapper.polygon(index.row(), index.column()); 00984 } 00985 return polygon.isEmpty() ? QRegion() : QRegion( polygon.toPolygon() ); 00986 }