#include <KDChartBarDiagram.h>
It provides different subtypes which are set using setType.
Definition at line 48 of file KDChartBarDiagram.h.
Public Types | |
enum | BarType { Normal, Stacked, Percent, Rows } |
Signals | |
void | dataHidden () |
This signal is emitted, when the hidden status of at least one data cell was (un)set. | |
void | layoutChanged (AbstractDiagram *) |
Diagrams are supposed to emit this signal, when the layout of one of their element changes. | |
void | modelsChanged () |
This signal is emitted, when either the model or the AttributesModel is replaced. | |
void | propertiesChanged () |
Emitted upon change of a property of the Diagram. | |
Public Member Functions | |
virtual void | addAxis (CartesianAxis *axis) |
Add the axis to the diagram. | |
bool | allowOverlappingDataValueTexts () const |
| |
bool | antiAliasing () const |
| |
virtual AttributesModel * | attributesModel () const |
Returns the AttributesModel, that is used by this diagram. | |
virtual KDChart::CartesianAxisList | axes () const |
| |
BarAttributes | barAttributes (const QModelIndex &index) const |
| |
BarAttributes | barAttributes (int column) const |
| |
BarAttributes | barAttributes () const |
| |
BarDiagram (QWidget *parent=0, CartesianCoordinatePlane *plane=0) | |
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 BarDiagram * | clone () const |
Creates an exact copy of this diagram. | |
bool | compare (const AbstractDiagram *other) const |
Returns true if both diagrams have the same settings. | |
bool | compare (const AbstractCartesianDiagram *other) const |
Returns true if both diagrams have the same settings. | |
bool | compare (const BarDiagram *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 int | horizontalOffset () const |
[reimplemented] | |
virtual QModelIndex | indexAt (const QPoint &point) const |
[reimplemented] | |
QModelIndexList | indexesAt (const QPoint &point) const |
This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot. | |
bool | isHidden (const QModelIndex &index) const |
Retrieve the hidden status for the given index. | |
bool | isHidden (int dataset) const |
Retrieve the hidden status for the given dataset. | |
bool | isHidden () const |
Retrieve the hidden status specified globally. | |
virtual bool | isIndexHidden (const QModelIndex &index) const |
[reimplemented] | |
QStringList | itemRowLabels () const |
The set of item row labels currently displayed, for use in Abscissa axes, etc. | |
virtual void | layoutPlanes () |
Triggers layouting of all coordinate planes on the current chart. | |
virtual QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) |
[reimplemented] | |
const int | numberOfAbscissaSegments () const |
[reimplemented] | |
const int | numberOfOrdinateSegments () const |
[reimplemented] | |
Qt::Orientation | orientation () const |
| |
void | paintDataValueText (QPainter *painter, const QModelIndex &index, const QPointF &pos, double value) |
void | paintMarker (QPainter *painter, const QModelIndex &index, const QPointF &pos) |
void | paintMarker (QPainter *painter, const DataValueAttributes &a, const QModelIndex &index, const QPointF &pos) |
virtual void | paintMarker (QPainter *painter, const MarkerAttributes &markerAttributes, const QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size) |
QPen | pen (const QModelIndex &index) const |
Retrieve the pen to be used, for painting the datapoint at the given index in the model. | |
QPen | pen (int dataset) const |
Retrieve the pen to be used for the given dataset. | |
QPen | pen () const |
Retrieve the pen to be used for painting datapoints globally. | |
bool | percentMode () const |
virtual AbstractCartesianDiagram * | referenceDiagram () const |
| |
virtual QPointF | referenceDiagramOffset () const |
| |
void | resize (const QSizeF &area) |
Called by the widget's sizeEvent. | |
virtual void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) |
[reimplemented] | |
void | setAllowOverlappingDataValueTexts (bool allow) |
Set whether data value labels are allowed to overlap. | |
void | setAntiAliasing (bool enabled) |
Set whether anti-aliasing is to be used while rendering this diagram. | |
void | setAttributesModel (AttributesModel *model) |
Associate an AttributesModel with this diagram. | |
void | setBarAttributes (const QModelIndex &index, const BarAttributes &a) |
Sets the line attributes for the model index index to ba. | |
void | setBarAttributes (int column, const BarAttributes &a) |
Sets the bar attributes of data set column to ba. | |
void | setBarAttributes (const BarAttributes &a) |
Sets the global bar attributes to ba. | |
void | setBrush (const QBrush &brush) |
Set the brush to be used, for painting all datasets in the model. | |
void | setBrush (int dataset, const QBrush &brush) |
Set the brush to be used, for painting the given dataset. | |
void | setBrush (const QModelIndex &index, const QBrush &brush) |
Set the brush to be used, for painting the datapoint at the given index. | |
virtual void | setCoordinatePlane (AbstractCoordinatePlane *plane) |
[reimplemented] | |
void | setDatasetDimension (int dimension) |
| |
void | setDataValueAttributes (const DataValueAttributes &a) |
Set the DataValueAttributes for all datapoints in the model. | |
void | setDataValueAttributes (int dataset, const DataValueAttributes &a) |
Set the DataValueAttributes for the given dataset. | |
void | setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a) |
Set the DataValueAttributes for the given index. | |
void | setHidden (bool hidden) |
Hide (or unhide, resp. | |
void | setHidden (int dataset, bool hidden) |
Hide (or unhide, resp. | |
void | setHidden (const QModelIndex &index, bool hidden) |
Hide (or unhide, resp. | |
void | setModel (QAbstractItemModel *model) |
Associate a model with the diagram. | |
void | setOrientation (Qt::Orientation orientation) |
Sets the orientation of the bar diagram. | |
void | setPen (const QPen &pen) |
Set the pen to be used, for painting all datasets in the model. | |
void | setPen (int dataset, const QPen &pen) |
Set the pen to be used, for painting the given dataset. | |
void | setPen (const QModelIndex &index, const QPen &pen) |
Set the pen to be used, for painting the datapoint at the given index. | |
void | setPercentMode (bool percent) |
virtual void | setReferenceDiagram (AbstractCartesianDiagram *diagram, const QPointF &offset=QPointF()) |
Makes this diagram use another diagram diagram as reference diagram with relative offset offset. | |
void | setRootIndex (const QModelIndex &index) |
Set the root index in the model, where the diagram starts referencing data for display. | |
virtual void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command) |
[reimplemented] | |
virtual void | setSelectionModel (QItemSelectionModel *selectionModel) |
Associate a seleection model with the diagrom. | |
void | setThreeDBarAttributes (const QModelIndex &index, const ThreeDBarAttributes &a) |
Sets the 3D line attributes of model index index to threeDAttrs. | |
void | setThreeDBarAttributes (int column, const ThreeDBarAttributes &a) |
Sets the 3D bar attributes of dataset column to threeDAttrs. | |
void | setThreeDBarAttributes (const ThreeDBarAttributes &a) |
Sets the global 3D bar attributes to threeDAttrs. | |
void | setType (const BarType type) |
Sets the bar diagram's type to type. | |
void | setUnitPrefix (const QString &prefix, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for all columns. | |
void | setUnitPrefix (const QString &prefix, int column, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for one specific column. | |
void | setUnitSuffix (const QString &suffix, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for all columns. | |
void | setUnitSuffix (const QString &suffix, int column, Qt::Orientation orientation) |
Set the unit prefix to be used on axes for one specific column. | |
virtual void | takeAxis (CartesianAxis *axis) |
Removes the axis from the diagram, without deleting it. | |
ThreeDBarAttributes | threeDBarAttributes (const QModelIndex &index) const |
| |
ThreeDBarAttributes | threeDBarAttributes (int column) const |
| |
ThreeDBarAttributes | threeDBarAttributes () const |
| |
BarType | type () 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. | |
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 | ~BarDiagram () |
Protected Slots | |
void | setDataBoundariesDirty () const |
Protected Member Functions | |
QModelIndex | attributesModelRootIndex () const |
const QPair< QPointF, QPointF > | calculateDataBoundaries () const |
[reimplemented] | |
virtual bool | checkInvariants (bool justReturnTheStatus=false) const |
void | paint (PaintContext *paintContext) |
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context. | |
virtual void | paintDataValueTexts (QPainter *painter) |
This method is obsolete and provided for backward-compatibility only. | |
void | paintEvent (QPaintEvent *) |
virtual void | paintMarkers (QPainter *painter) |
This method is obsolete and provided for backward-compatibility only. | |
void | resizeEvent (QResizeEvent *) |
void | setAttributesModelRootIndex (const QModelIndex &) |
void | setDatasetDimensionInternal (int dimension) |
virtual double | threeDItemDepth (int column) const |
| |
virtual double | threeDItemDepth (const QModelIndex &index) const |
| |
double | valueForCell (int row, int column) const |
Helper method, retrieving the data value (DisplayRole) for a given row and column. |
Normal | |
Stacked | |
Percent | |
Rows |
|
Definition at line 70 of file KDChartBarDiagram.h.
BarDiagram::BarDiagram | ( | QWidget * | parent = 0 , |
|
CartesianCoordinatePlane * | plane = 0 | |||
) | [explicit] |
Definition at line 59 of file KDChartBarDiagram.cpp.
References StockDiagram::init().
Referenced by clone().
00059 : 00060 AbstractCartesianDiagram( new Private(), parent, plane ) 00061 { 00062 init(); 00063 }
BarDiagram::~BarDiagram | ( | ) | [virtual] |
void AbstractCartesianDiagram::addAxis | ( | CartesianAxis * | axis | ) | [virtual, inherited] |
Add the axis to the diagram.
The diagram takes ownership of the axis and will delete it.
To gain back ownership (e.g. for assigning the axis to another diagram) use the takeAxis method, before calling addAxis on the other diagram.
Definition at line 92 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractAxis::createObserver(), d, and KDChart::AbstractCartesianDiagram::layoutPlanes().
00093 { 00094 if ( !d->axesList.contains( axis ) ) { 00095 d->axesList.append( axis ); 00096 axis->createObserver( this ); 00097 layoutPlanes(); 00098 } 00099 }
bool AbstractDiagram::allowOverlappingDataValueTexts | ( | ) | const [inherited] |
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(), 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(), numberOfAbscissaSegments(), KDChart::Plotter::numberOfOrdinateSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(), numberOfOrdinateSegments(), StockDiagram::paint(), KDChart::AbstractDiagram::valueForCell(), and KDChart::LineDiagram::valueForCellTesting().
00346 { 00347 if ( !d->attributesModelRootIndex.isValid() ) 00348 d->attributesModelRootIndex = d->attributesModel->mapFromSource( rootIndex() ); 00349 return d->attributesModelRootIndex; 00350 }
KDChart::CartesianAxisList AbstractCartesianDiagram::axes | ( | ) | const [virtual, inherited] |
Definition at line 111 of file KDChartAbstractCartesianDiagram.cpp.
References d.
Referenced by KDChart::Widget::setType(), and KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().
00112 { 00113 return d->axesList; 00114 }
BarAttributes BarDiagram::barAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 275 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, and d.
00276 { 00277 return qVariantValue<BarAttributes>( 00278 d->attributesModel->data( 00279 d->attributesModel->mapFromSource( index ), 00280 KDChart::BarAttributesRole ) ); 00281 }
BarAttributes BarDiagram::barAttributes | ( | int | column | ) | const |
Definition at line 262 of file KDChartBarDiagram.cpp.
References barAttributes(), KDChart::BarAttributesRole, and d.
00263 { 00264 const QVariant attrs( 00265 d->attributesModel->headerData( column, Qt::Vertical, 00266 KDChart::BarAttributesRole ) ); 00267 if( attrs.isValid() ) 00268 return qVariantValue< BarAttributes >( attrs ); 00269 return barAttributes(); 00270 }
BarAttributes BarDiagram::barAttributes | ( | ) | const |
Definition at line 253 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, and d.
Referenced by barAttributes().
00254 { 00255 return qVariantValue<BarAttributes>( 00256 d->attributesModel->data( KDChart::BarAttributesRole ) ); 00257 }
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 > BarDiagram::calculateDataBoundaries | ( | ) | const [protected, virtual] |
[reimplemented]
Implements KDChart::AbstractDiagram.
Definition at line 375 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), and d.
00376 { 00377 if ( !checkInvariants(true) ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) ); 00378 00379 // note: calculateDataBoundaries() is ignoring the hidden flags. 00380 // That's not a bug but a feature: Hiding data does not mean removing them. 00381 // For totally removing data from KD Chart's view people can use e.g. a proxy model 00382 // calculate boundaries for different line types Normal - Stacked - Percent - Default Normal 00383 return d->implementor->calculateDataBoundaries(); 00384 }
bool AbstractDiagram::checkInvariants | ( | bool | justReturnTheStatus = false |
) | const [protected, virtual, inherited] |
Definition at line 1077 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane().
Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), KDChart::Plotter::calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(), calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Plotter::paint(), KDChart::LineDiagram::paint(), KDChart::LeveyJenningsDiagram::paint(), 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 }
BarDiagram * BarDiagram::clone | ( | ) | const [virtual] |
Creates an exact copy of this diagram.
Definition at line 85 of file KDChartBarDiagram.cpp.
References BarDiagram(), d, StockDiagram::Private::Private(), setType(), and type().
00086 { 00087 00088 BarDiagram* newDiagram = new BarDiagram( new Private( *d ) ); 00089 newDiagram->setType( type() ); 00090 return newDiagram; 00091 }
bool AbstractDiagram::compare | ( | const AbstractDiagram * | other | ) | const [inherited] |
Returns true if both diagrams have the same settings.
Definition at line 131 of file KDChartAbstractDiagram.cpp.
References KDChart::AbstractDiagram::allowOverlappingDataValueTexts(), KDChart::AbstractDiagram::antiAliasing(), KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::compare(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::percentMode().
00132 { 00133 if( other == this ) return true; 00134 if( ! other ){ 00135 //qDebug() << "AbstractDiagram::compare() cannot compare to Null pointer"; 00136 return false; 00137 } 00138 /* 00139 qDebug() << "\n AbstractDiagram::compare() QAbstractScrollArea:"; 00140 // compare QAbstractScrollArea properties 00141 qDebug() << 00142 ((horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00143 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy())); 00144 qDebug() << "AbstractDiagram::compare() QFrame:"; 00145 // compare QFrame properties 00146 qDebug() << 00147 ((frameShadow() == other->frameShadow()) && 00148 (frameShape() == other->frameShape()) && 00149 (frameWidth() == other->frameWidth()) && 00150 (lineWidth() == other->lineWidth()) && 00151 (midLineWidth() == other->midLineWidth())); 00152 qDebug() << "AbstractDiagram::compare() QAbstractItemView:"; 00153 // compare QAbstractItemView properties 00154 qDebug() << 00155 ((alternatingRowColors() == other->alternatingRowColors()) && 00156 (hasAutoScroll() == other->hasAutoScroll()) && 00157 #if QT_VERSION > 0x040199 00158 (dragDropMode() == other->dragDropMode()) && 00159 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00160 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00161 (verticalScrollMode() == other->verticalScrollMode()) && 00162 #endif 00163 (dragEnabled() == other->dragEnabled()) && 00164 (editTriggers() == other->editTriggers()) && 00165 (iconSize() == other->iconSize()) && 00166 (selectionBehavior() == other->selectionBehavior()) && 00167 (selectionMode() == other->selectionMode()) && 00168 (showDropIndicator() == other->showDropIndicator()) && 00169 (tabKeyNavigation() == other->tabKeyNavigation()) && 00170 (textElideMode() == other->textElideMode())); 00171 qDebug() << "AbstractDiagram::compare() AttributesModel: "; 00172 // compare all of the properties stored in the attributes model 00173 qDebug() << attributesModel()->compare( other->attributesModel() ); 00174 qDebug() << "AbstractDiagram::compare() own:"; 00175 // compare own properties 00176 qDebug() << 00177 ((rootIndex().column() == other->rootIndex().column()) && 00178 (rootIndex().row() == other->rootIndex().row()) && 00179 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00180 (antiAliasing() == other->antiAliasing()) && 00181 (percentMode() == other->percentMode()) && 00182 (datasetDimension() == other->datasetDimension())); 00183 */ 00184 return // compare QAbstractScrollArea properties 00185 (horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00186 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy()) && 00187 // compare QFrame properties 00188 (frameShadow() == other->frameShadow()) && 00189 (frameShape() == other->frameShape()) && 00190 // frameWidth is a read-only property defined by the style, it should not be in here: 00191 // (frameWidth() == other->frameWidth()) && 00192 (lineWidth() == other->lineWidth()) && 00193 (midLineWidth() == other->midLineWidth()) && 00194 // compare QAbstractItemView properties 00195 (alternatingRowColors() == other->alternatingRowColors()) && 00196 (hasAutoScroll() == other->hasAutoScroll()) && 00197 #if QT_VERSION > 0x040199 00198 (dragDropMode() == other->dragDropMode()) && 00199 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00200 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00201 (verticalScrollMode() == other->verticalScrollMode()) && 00202 #endif 00203 (dragEnabled() == other->dragEnabled()) && 00204 (editTriggers() == other->editTriggers()) && 00205 (iconSize() == other->iconSize()) && 00206 (selectionBehavior() == other->selectionBehavior()) && 00207 (selectionMode() == other->selectionMode()) && 00208 (showDropIndicator() == other->showDropIndicator()) && 00209 (tabKeyNavigation() == other->tabKeyNavigation()) && 00210 (textElideMode() == other->textElideMode()) && 00211 // compare all of the properties stored in the attributes model 00212 attributesModel()->compare( other->attributesModel() ) && 00213 // compare own properties 00214 (rootIndex().column() == other->rootIndex().column()) && 00215 (rootIndex().row() == other->rootIndex().row()) && 00216 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00217 (antiAliasing() == other->antiAliasing()) && 00218 (percentMode() == other->percentMode()) && 00219 (datasetDimension() == other->datasetDimension()); 00220 }
bool AbstractCartesianDiagram::compare | ( | const AbstractCartesianDiagram * | other | ) | const [inherited] |
Returns true if both diagrams have the same settings.
Definition at line 47 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractCartesianDiagram::referenceDiagram(), and KDChart::AbstractCartesianDiagram::referenceDiagramOffset().
00048 { 00049 if( other == this ) return true; 00050 if( ! other ){ 00051 //qDebug() << "AbstractCartesianDiagram::compare() cannot compare to Null pointer"; 00052 return false; 00053 } 00054 /* 00055 qDebug() << "\n AbstractCartesianDiagram::compare():"; 00056 // compare own properties 00057 qDebug() << 00058 ((referenceDiagram() == other->referenceDiagram()) && 00059 ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset()))); 00060 */ 00061 return // compare the base class 00062 ( static_cast<const AbstractDiagram*>(this)->compare( other ) ) && 00063 // compare own properties 00064 (referenceDiagram() == other->referenceDiagram()) && 00065 ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset())); 00066 }
bool BarDiagram::compare | ( | const BarDiagram * | other | ) | const |
Returns true if both diagrams have the same settings.
Definition at line 93 of file KDChartBarDiagram.cpp.
References type().
00094 { 00095 if( other == this ) return true; 00096 if( ! other ){ 00097 return false; 00098 } 00099 00100 return // compare the base class 00101 ( static_cast<const AbstractCartesianDiagram*>(this)->compare( other ) ) && 00102 // compare own properties 00103 (type() == other->type()); 00104 }
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(), 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 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 }
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(), setOrientation(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and setType().
void KDChart::AbstractCartesianDiagram::layoutPlanes | ( | ) | [virtual, inherited] |
Triggers layouting of all coordinate planes on the current chart.
Normally you don't need to call this method. It's handled automatically for you.
Definition at line 116 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractCoordinatePlane::layoutPlanes().
Referenced by KDChart::AbstractCartesianDiagram::addAxis(), and KDChart::AbstractCartesianDiagram::takeAxis().
00117 { 00118 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes()"; 00119 AbstractCoordinatePlane* plane = coordinatePlane(); 00120 if( plane ){ 00121 plane->layoutPlanes(); 00122 //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes() OK"; 00123 } 00124 }
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] |
const int BarDiagram::numberOfAbscissaSegments | ( | ) | const [virtual] |
[reimplemented]
Implements KDChart::AbstractCartesianDiagram.
Definition at line 427 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
00428 { 00429 return d->attributesModel->rowCount(attributesModelRootIndex()); 00430 }
const int BarDiagram::numberOfOrdinateSegments | ( | ) | const [virtual] |
[reimplemented]
Implements KDChart::AbstractCartesianDiagram.
Definition at line 435 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
00436 { 00437 return d->attributesModel->columnCount(attributesModelRootIndex()); 00438 }
Qt::Orientation BarDiagram::orientation | ( | ) | const |
Definition at line 212 of file KDChartBarDiagram.cpp.
References d.
Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList(), and KDChart::CartesianAxis::paintCtx().
00213 { 00214 return d->orientation; 00215 }
void BarDiagram::paint | ( | PaintContext * | paintContext | ) | [protected, virtual] |
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.
paintContext | All information needed for painting. |
Implements KDChart::AbstractDiagram.
Definition at line 395 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::PaintContext::coordinatePlane(), d, KDChart::AbstractDiagram::dataBoundaries(), p, KDChart::PaintContext::painter(), KDChart::PaintContext::rectangle(), KDChart::PaintContext::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::sharedAxisMasterPlane().
Referenced by paintEvent().
00396 { 00397 if ( !checkInvariants( true ) ) return; 00398 if ( !AbstractGrid::isBoundariesValid(dataBoundaries()) ) return; 00399 const PainterSaver p( ctx->painter() ); 00400 if( model()->rowCount( rootIndex() ) == 0 || model()->columnCount( rootIndex() ) == 0 ) 00401 return; // nothing to paint for us 00402 00403 AbstractCoordinatePlane* const plane = ctx->coordinatePlane(); 00404 ctx->setCoordinatePlane( plane->sharedAxisMasterPlane( ctx->painter() ) ); 00405 00406 // Only paint elements that are in the paint context's rectangle 00407 // (in this case boundaries of the diagram, see paintEvent()) 00408 ctx->painter()->setClipping( true ); 00409 ctx->painter()->setClipRect( ctx->rectangle() ); 00410 00411 // paint different bar types Normal - Stacked - Percent - Default Normal 00412 d->implementor->paint( ctx ); 00413 00414 ctx->setCoordinatePlane( plane ); 00415 }
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 BarDiagram::paintEvent | ( | QPaintEvent * | ) | [protected] |
Definition at line 386 of file KDChartBarDiagram.cpp.
References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().
00387 { 00388 QPainter painter ( viewport() ); 00389 PaintContext ctx; 00390 ctx.setPainter ( &painter ); 00391 ctx.setRectangle( QRectF ( 0, 0, width(), height() ) ); 00392 paint ( &ctx ); 00393 }
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 }
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(), setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::LineDiagram::setCenterDataPoints(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::Plotter::setLineAttributes(), KDChart::LineDiagram::setLineAttributes(), setOrientation(), KDChart::AbstractDiagram::setPen(), KDChart::AbstractDiagram::setPercentMode(), StockDiagram::setStockBarAttributes(), StockDiagram::setThreeDBarAttributes(), setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), StockDiagram::setType(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), setType(), KDChart::Plotter::setValueTrackerAttributes(), and KDChart::LineDiagram::setValueTrackerAttributes().
AbstractCartesianDiagram * AbstractCartesianDiagram::referenceDiagram | ( | ) | const [virtual, inherited] |
Definition at line 170 of file KDChartAbstractCartesianDiagram.cpp.
References d.
Referenced by KDChart::AbstractCartesianDiagram::compare(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::CartesianAxis::paintCtx(), referenceDiagramIsBarDiagram(), and referenceDiagramNeedsCenteredAbscissaTicks().
00171 { 00172 return d->referenceDiagram; 00173 }
QPointF AbstractCartesianDiagram::referenceDiagramOffset | ( | ) | const [virtual, inherited] |
Definition at line 175 of file KDChartAbstractCartesianDiagram.cpp.
References d.
Referenced by KDChart::AbstractCartesianDiagram::compare().
00176 { 00177 return d->referenceDiagramOffset; 00178 }
void BarDiagram::resize | ( | const QSizeF & | area | ) | [virtual] |
Called by the widget's sizeEvent.
Adjust all internal structures, that are calculated, dependending on the size of the widget.
area |
Implements KDChart::AbstractDiagram.
Definition at line 417 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), d, KDChart::AbstractDiagram::setDataBoundariesDirty(), KDChart::AbstractCoordinatePlane::zoomFactorX(), and KDChart::AbstractCoordinatePlane::zoomFactorY().
00418 { 00419 d->compressor.setResolution( static_cast< int >( size.width() * coordinatePlane()->zoomFactorX() ), 00420 static_cast< int >( size.height() * coordinatePlane()->zoomFactorY() ) ); 00421 setDataBoundariesDirty(); 00422 }
void BarDiagram::resizeEvent | ( | QResizeEvent * | ) | [protected] |
void AbstractDiagram::scrollTo | ( | const QModelIndex & | index, | |
ScrollHint | hint = EnsureVisible | |||
) | [virtual, inherited] |
void AbstractDiagram::setAllowOverlappingDataValueTexts | ( | bool | allow | ) | [inherited] |
Set whether data value labels are allowed to overlap.
allow | True means that overlapping labels are allowed. |
Definition at line 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 AbstractCartesianDiagram::setAttributesModel | ( | AttributesModel * | amodel | ) | [virtual, inherited] |
Associate an AttributesModel with this diagram.
Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used with AttributesModels that have been explicitly created by the user, and are owned by her. Setting an AttributesModel that is internal to another diagram is an error.
Correct:
AttributesModel *am = new AttributesModel( model, 0 );
diagram1->setAttributesModel( am );
diagram2->setAttributesModel( am );
Wrong:
diagram1->setAttributesModel( diagram2->attributesModel() );
model | The AttributesModel to use for this diagram. |
Reimplemented from KDChart::AbstractDiagram.
Definition at line 192 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setAttributesModel().
00193 { 00194 AbstractDiagram::setAttributesModel( model ); 00195 d->compressor.setModel( attributesModel() ); 00196 }
void AbstractDiagram::setAttributesModelRootIndex | ( | const QModelIndex & | idx | ) | [protected, inherited] |
Definition at line 336 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AbstractDiagram::setDataBoundariesDirty().
Referenced by KDChart::AbstractDiagram::setRootIndex().
00337 { 00338 d->attributesModelRootIndex=idx; 00339 setDataBoundariesDirty(); 00340 scheduleDelayedItemsLayout(); 00341 }
void BarDiagram::setBarAttributes | ( | const QModelIndex & | index, | |
const BarAttributes & | a | |||
) |
Sets the line attributes for the model index index to ba.
Definition at line 241 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::BarAttributesRole, d, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().
00242 { 00243 attributesModel()->setData( 00244 d->attributesModel->mapFromSource( index ), 00245 qVariantFromValue( ba ), 00246 BarAttributesRole ); 00247 emit propertiesChanged(); 00248 }
void BarDiagram::setBarAttributes | ( | int | column, | |
const BarAttributes & | a | |||
) |
Sets the bar attributes of data set column to ba.
Definition at line 229 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, d, and KDChart::AbstractDiagram::propertiesChanged().
00230 { 00231 d->attributesModel->setHeaderData( 00232 column, Qt::Vertical, 00233 qVariantFromValue( ba ), 00234 BarAttributesRole ); 00235 emit propertiesChanged(); 00236 }
void BarDiagram::setBarAttributes | ( | const BarAttributes & | a | ) |
Sets the global bar attributes to ba.
Definition at line 220 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, d, and KDChart::AbstractDiagram::propertiesChanged().
00221 { 00222 d->attributesModel->setModelData( qVariantFromValue( ba ), BarAttributesRole ); 00223 emit propertiesChanged(); 00224 }
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 KDChart::AbstractCartesianDiagram::setCoordinatePlane | ( | AbstractCoordinatePlane * | plane | ) | [virtual, inherited] |
[reimplemented]
Reimplemented from KDChart::AbstractDiagram.
Definition at line 126 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractDiagram::setCoordinatePlane().
00127 { 00128 if( coordinatePlane() ) { 00129 disconnect( attributesModel(), SIGNAL( rowsRemoved( const QModelIndex&, int, int ) ), 00130 coordinatePlane(), SLOT( relayout() ) ); 00131 disconnect( attributesModel(), SIGNAL( rowsInserted( const QModelIndex&, int, int ) ), 00132 coordinatePlane(), SLOT( relayout() ) ); 00133 disconnect( attributesModel(), SIGNAL( columnsRemoved( const QModelIndex&, int, int ) ), 00134 coordinatePlane(), SLOT( relayout() ) ); 00135 disconnect( attributesModel(), SIGNAL( columnsInserted( const QModelIndex&, int, int ) ), 00136 coordinatePlane(), SLOT( relayout() ) ); 00137 disconnect( coordinatePlane() ); 00138 } 00139 00140 AbstractDiagram::setCoordinatePlane(plane); 00141 if ( plane ) { 00142 // Readjust the layout when the dataset count changes 00143 connect( attributesModel(), SIGNAL( rowsRemoved( const QModelIndex&, int, int ) ), 00144 plane, SLOT( relayout() ), Qt::QueuedConnection ); 00145 connect( attributesModel(), SIGNAL( rowsInserted( const QModelIndex&, int, int ) ), 00146 plane, SLOT( relayout() ), Qt::QueuedConnection ); 00147 connect( attributesModel(), SIGNAL( columnsRemoved( const QModelIndex&, int, int ) ), 00148 plane, SLOT( relayout() ), Qt::QueuedConnection ); 00149 connect( attributesModel(), SIGNAL( columnsInserted( const QModelIndex&, int, int ) ), 00150 plane, SLOT( relayout() ), Qt::QueuedConnection ); 00151 } 00152 // show the axes, after all have been layoutPlanes 00153 // (because they might depend on each other) 00154 /* 00155 if( plane ) 00156 Q_FOREACH( CartesianAxis* axis, d->axesList ) 00157 axis->show(); 00158 else 00159 Q_FOREACH( CartesianAxis* axis, d->axesList ) 00160 axis->hide(); 00161 */ 00162 }
void AbstractDiagram::setDataBoundariesDirty | ( | ) | const [protected, slot, inherited] |
Definition at line 236 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::AbstractDiagram::dataChanged(), StockDiagram::resize(), KDChart::Plotter::resize(), KDChart::LineDiagram::resize(), resize(), KDChart::AbstractDiagram::setAttributesModel(), KDChart::AbstractDiagram::setAttributesModelRootIndex(), KDChart::AbstractDiagram::setDatasetDimensionInternal(), KDChart::AbstractDiagram::setModel(), setOrientation(), setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and 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 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 AbstractCartesianDiagram::setModel | ( | QAbstractItemModel * | model | ) | [virtual, inherited] |
Associate a model with the diagram.
Reimplemented from KDChart::AbstractDiagram.
Reimplemented in KDChart::LeveyJenningsDiagram.
Definition at line 186 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setModel().
Referenced by KDChart::LeveyJenningsDiagram::setModel().
00187 { 00188 AbstractDiagram::setModel( model ); 00189 d->compressor.setModel( attributesModel() ); 00190 }
void BarDiagram::setOrientation | ( | Qt::Orientation | orientation | ) |
Sets the orientation of the bar diagram.
Definition at line 166 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), Normal, Percent, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), KDChart::AbstractDiagram::setPercentMode(), Stacked, and type().
00167 { 00168 if ( d->orientation == orientation ) 00169 return; 00170 d->orientation = orientation; 00171 00172 if ( d->orientation == Qt::Vertical ) { 00173 switch( type() ) { 00174 case Normal: 00175 d->implementor = d->normalDiagram; 00176 break; 00177 case Stacked: 00178 d->implementor = d->stackedDiagram; 00179 break; 00180 case Percent: 00181 d->implementor = d->percentDiagram; 00182 break; 00183 default: 00184 Q_ASSERT_X( false, "BarDiagram::setType", "unknown diagram subtype" ); 00185 } 00186 } else { 00187 switch( type() ) { 00188 case Normal: 00189 d->implementor = d->normalLyingDiagram; 00190 break; 00191 case Stacked: 00192 d->implementor = d->stackedLyingDiagram; 00193 break; 00194 case Percent: 00195 d->implementor = d->percentLyingDiagram; 00196 break; 00197 default: 00198 Q_ASSERT_X( false, "BarDiagram::setType", "unknown diagram subtype" ); 00199 } 00200 } 00201 00202 // AbstractAxis settings - see AbstractDiagram and CartesianAxis 00203 setPercentMode( type() == BarDiagram::Percent ); 00204 setDataBoundariesDirty(); 00205 emit layoutChanged( this ); 00206 emit propertiesChanged(); 00207 }
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 setOrientation(), KDChart::LineDiagram::setType(), and setType().
00528 { 00529 d->percent = percent; 00530 emit propertiesChanged(); 00531 }
void AbstractCartesianDiagram::setReferenceDiagram | ( | AbstractCartesianDiagram * | diagram, | |
const QPointF & | offset = QPointF() | |||
) | [virtual, inherited] |
Makes this diagram use another diagram diagram as reference diagram with relative offset offset.
To share cartesian axes between different diagrams there might be cases when you need that. Normally you don't.
Definition at line 164 of file KDChartAbstractCartesianDiagram.cpp.
References d.
void AbstractCartesianDiagram::setRootIndex | ( | const QModelIndex & | idx | ) | [virtual, inherited] |
Set the root index in the model, where the diagram starts referencing data for display.
[reimplemented]
Reimplemented from KDChart::AbstractDiagram.
Definition at line 180 of file KDChartAbstractCartesianDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setRootIndex().
00181 { 00182 AbstractDiagram::setRootIndex( index ); 00183 d->compressor.setRootIndex( attributesModel()->mapFromSource( index ) ); 00184 }
void 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 BarDiagram::setThreeDBarAttributes | ( | const QModelIndex & | index, | |
const ThreeDBarAttributes & | a | |||
) |
Sets the 3D line attributes of model index index to threeDAttrs.
Definition at line 312 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.
00313 { 00314 setDataBoundariesDirty(); 00315 d->attributesModel->setData( 00316 d->attributesModel->mapFromSource(index), 00317 qVariantFromValue( threeDAttrs ), 00318 ThreeDBarAttributesRole ); 00319 //emit layoutChanged( this ); 00320 emit propertiesChanged(); 00321 }
void BarDiagram::setThreeDBarAttributes | ( | int | column, | |
const ThreeDBarAttributes & | a | |||
) |
Sets the 3D bar attributes of dataset column to threeDAttrs.
Definition at line 297 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.
00298 { 00299 setDataBoundariesDirty(); 00300 d->attributesModel->setHeaderData( 00301 column, Qt::Vertical, 00302 qVariantFromValue( threeDAttrs ), 00303 ThreeDBarAttributesRole ); 00304 //emit layoutChanged( this ); 00305 emit propertiesChanged(); 00306 00307 }
void BarDiagram::setThreeDBarAttributes | ( | const ThreeDBarAttributes & | a | ) |
Sets the global 3D bar attributes to threeDAttrs.
Definition at line 286 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.
00287 { 00288 setDataBoundariesDirty(); 00289 d->attributesModel->setModelData( qVariantFromValue( threeDAttrs ), ThreeDBarAttributesRole ); 00290 //emit layoutChanged( this ); 00291 emit propertiesChanged(); 00292 }
void BarDiagram::setType | ( | const BarType | type | ) |
Sets the bar diagram's type to type.
Definition at line 110 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), Normal, Percent, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), KDChart::AbstractDiagram::setPercentMode(), and Stacked.
Referenced by clone().
00111 { 00112 //if ( type == d->barType ) return; 00113 if ( d->implementor->type() == type ) return; 00114 00115 if ( d->orientation == Qt::Vertical ) { 00116 switch( type ) { 00117 case Normal: 00118 d->implementor = d->normalDiagram; 00119 break; 00120 case Stacked: 00121 d->implementor = d->stackedDiagram; 00122 break; 00123 case Percent: 00124 d->implementor = d->percentDiagram; 00125 break; 00126 default: 00127 Q_ASSERT_X( false, "BarDiagram::setType", "unknown diagram subtype" ); 00128 } 00129 } else { 00130 switch( type ) { 00131 case Normal: 00132 d->implementor = d->normalLyingDiagram; 00133 break; 00134 case Stacked: 00135 d->implementor = d->stackedLyingDiagram; 00136 break; 00137 case Percent: 00138 d->implementor = d->percentLyingDiagram; 00139 break; 00140 default: 00141 Q_ASSERT_X( false, "BarDiagram::setType", "unknown diagram subtype" ); 00142 } 00143 } 00144 00145 Q_ASSERT( d->implementor->type() == type ); 00146 00147 //d->barType = type; 00148 // AbstractAxis settings - see AbstractDiagram and CartesianAxis 00149 setPercentMode( type == BarDiagram::Percent ); 00150 setDataBoundariesDirty(); 00151 emit layoutChanged( this ); 00152 emit propertiesChanged(); 00153 }
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 }
void AbstractCartesianDiagram::takeAxis | ( | CartesianAxis * | axis | ) | [virtual, inherited] |
Removes the axis from the diagram, without deleting it.
The diagram no longer owns the axis, so it is the caller's responsibility to delete the axis.
Definition at line 101 of file KDChartAbstractCartesianDiagram.cpp.
References d, KDChart::AbstractAxis::deleteObserver(), KDChart::AbstractCartesianDiagram::layoutPlanes(), and KDChart::AbstractLayoutItem::setParentWidget().
Referenced by KDChart::Widget::setType(), KDChart::CartesianAxis::~CartesianAxis(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().
00102 { 00103 const int idx = d->axesList.indexOf( axis ); 00104 if( idx != -1 ) 00105 d->axesList.takeAt( idx ); 00106 axis->deleteObserver( this ); 00107 axis->setParentWidget( 0 ); 00108 layoutPlanes(); 00109 }
ThreeDBarAttributes BarDiagram::threeDBarAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 348 of file KDChartBarDiagram.cpp.
References d, and KDChart::ThreeDBarAttributesRole.
00349 { 00350 return qVariantValue<ThreeDBarAttributes>( 00351 d->attributesModel->data( 00352 d->attributesModel->mapFromSource(index), 00353 KDChart::ThreeDBarAttributesRole ) ); 00354 }
ThreeDBarAttributes BarDiagram::threeDBarAttributes | ( | int | column | ) | const |
Definition at line 335 of file KDChartBarDiagram.cpp.
References d, threeDBarAttributes(), and KDChart::ThreeDBarAttributesRole.
00336 { 00337 const QVariant attrs( 00338 d->attributesModel->headerData( column, Qt::Vertical, 00339 KDChart::ThreeDBarAttributesRole ) ); 00340 if( attrs.isValid() ) 00341 return qVariantValue< ThreeDBarAttributes >( attrs ); 00342 return threeDBarAttributes(); 00343 }
ThreeDBarAttributes BarDiagram::threeDBarAttributes | ( | ) | const |
Definition at line 326 of file KDChartBarDiagram.cpp.
References d, and KDChart::ThreeDBarAttributesRole.
Referenced by threeDBarAttributes(), and threeDItemDepth().
00327 { 00328 return qVariantValue<ThreeDBarAttributes>( 00329 d->attributesModel->data( KDChart::ThreeDBarAttributesRole ) ); 00330 }
double BarDiagram::threeDItemDepth | ( | int | column | ) | const [protected, virtual] |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 361 of file KDChartBarDiagram.cpp.
References d, and KDChart::ThreeDBarAttributesRole.
00362 { 00363 return qVariantValue<ThreeDBarAttributes>( 00364 d->attributesModel->headerData ( 00365 column, 00366 Qt::Vertical, 00367 KDChart::ThreeDBarAttributesRole ) ).validDepth(); 00368 }
double BarDiagram::threeDItemDepth | ( | const QModelIndex & | index | ) | const [protected, virtual] |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 356 of file KDChartBarDiagram.cpp.
References threeDBarAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().
00357 { 00358 return threeDBarAttributes( index ).validDepth(); 00359 }
BarDiagram::BarType BarDiagram::type | ( | ) | const |
Definition at line 158 of file KDChartBarDiagram.cpp.
References d.
Referenced by clone(), compare(), and setOrientation().
00159 { 00160 return d->implementor->type(); 00161 }
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 }
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 }