23 #ifndef KDCHARTABSTRACTDIAGRAM_H
24 #define KDCHARTABSTRACTDIAGRAM_H
28 #include <QAbstractItemView>
36 class AbstractCoordinatePlane;
37 class AttributesModel;
38 class DataValueAttributes;
89 const
QPair<QPointF, QPointF> dataBoundaries() const;
106 virtual
void resize ( const QSizeF& area ) = 0;
109 void setModel ( QAbstractItemModel * model ) override;
112 void setSelectionModel( QItemSelectionModel* selectionModel ) override;
150 virtual
bool usesExternalAttributesModel() const;
166 void setRootIndex ( const QModelIndex& idx ) override;
169 QRect visualRect(const QModelIndex &index) const override;
171 void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
173 QModelIndex indexAt(const QPoint &point) const override;
175 QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
177 int horizontalOffset() const override;
179 int verticalOffset() const override;
181 bool isIndexHidden(const QModelIndex &index) const override;
183 void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override;
185 QRegion visualRegionForSelection(const QItemSelection &selection) const override;
186 virtual QRegion visualRegion(const QModelIndex &index) const;
188 void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const
QVector<
int> &roles =
QVector<
int>()) override;
190 void doItemsLayout() override;
222 void setHidden( const QModelIndex & index,
bool hidden );
236 void setHidden(
int dataset,
bool hidden );
249 void setHidden(
bool hidden );
257 bool isHidden() const;
266 bool isHidden(
int dataset ) const;
275 bool isHidden( const QModelIndex & index ) const;
284 void setDataValueAttributes( const QModelIndex & index,
333 void setPen( const QModelIndex& index, const QPen& pen );
340 void setPen(
int dataset, const QPen& pen );
346 void setPen( const QPen& pen );
362 QPen pen(
int dataset ) const;
370 QPen pen( const QModelIndex& index ) const;
378 void setBrush( const QModelIndex& index, const QBrush& brush);
385 void setBrush(
int dataset, const QBrush& brush );
391 void setBrush( const QBrush& brush);
399 QBrush brush() const;
407 QBrush brush(
int dataset ) const;
415 QBrush brush( const QModelIndex& index ) const;
423 void setUnitPrefix( const QString& prefix,
int column, Qt::Orientation orientation );
429 void setUnitPrefix( const QString& prefix, Qt::Orientation orientation );
437 void setUnitSuffix( const QString& suffix,
int column, Qt::Orientation orientation );
443 void setUnitSuffix( const QString& suffix, Qt::Orientation orientation );
453 QString unitPrefix(
int column, Qt::Orientation orientation,
bool fallback = false ) const;
459 QString unitPrefix( Qt::Orientation orientation ) const;
469 QString unitSuffix(
int column, Qt::Orientation orientation,
bool fallback = false ) const;
475 QString unitSuffix( Qt::Orientation orientation ) const;
481 void setAllowOverlappingDataValueTexts(
bool allow );
486 bool allowOverlappingDataValueTexts() const;
493 void setAntiAliasing(
bool enabled );
499 bool antiAliasing() const;
507 void useDefaultColors();
514 void useRainbowColors();
521 void useSubduedColors();
527 QStringList itemRowLabels() const;
533 QStringList datasetLabels() const;
544 QList<QBrush> datasetBrushes() const;
555 QList<QPen> datasetPens() const;
579 void setPercentMode(
bool percent );
593 bool percentMode() const;
595 virtual
void paintMarker( QPainter* painter,
597 const QBrush& brush, const QPen&,
598 const QPointF& point, const QSizeF& size );
614 int datasetDimension() const;
622 void setDatasetDimension(
int dimension );
625 void setDatasetDimensionInternal(
int dimension );
631 const QModelIndex& index,
632 const QPointF& pos );
633 void paintMarker( QPainter* painter,
634 const QModelIndex& index,
635 const QPointF& pos );
636 void paintDataValueText( QPainter* painter, const QModelIndex& index,
637 const QPointF& pos, qreal value );
643 QModelIndexList indexesAt( const QPoint& point ) const;
644 QModelIndexList indexesIn( const QRect& rect ) const;
647 virtual
bool checkInvariants(
bool justReturnTheStatus=false ) const;
648 virtual const
QPair<QPointF, QPointF> calculateDataBoundaries() const = 0;
651 void setDataBoundariesDirty() const;
661 virtual
void paintDataValueTexts( QPainter* painter );
669 virtual
void paintMarkers( QPainter* painter );
670 void setAttributesModelRootIndex( const QModelIndex& );
671 QModelIndex attributesModelRootIndex() const;
680 qreal valueForCell(
int row,
int column ) const;
697 void aboutToBeDestroyed();
700 void modelsChanged();
707 void modelDataChanged();
713 void propertiesChanged();
716 void boundariesChanged();
718 void viewportCoordinateSystemChanged();
721 QModelIndex conditionallyMapFromSource( const QModelIndex & sourceIndex ) const;