Changeset View
Changeset View
Standalone View
Standalone View
src/KChart/Polar/KChartPieDiagram.h
Show All 38 Lines | |||||
39 | public: | 39 | public: | ||
40 | explicit PieDiagram( | 40 | explicit PieDiagram( | ||
41 | QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr ); | 41 | QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr ); | ||
42 | virtual ~PieDiagram(); | 42 | virtual ~PieDiagram(); | ||
43 | 43 | | |||
44 | protected: | 44 | protected: | ||
45 | // Implement AbstractDiagram | 45 | // Implement AbstractDiagram | ||
46 | /** \reimpl */ | 46 | /** \reimpl */ | ||
47 | void paint( PaintContext* paintContext ) Q_DECL_OVERRIDE; | 47 | void paint( PaintContext* paintContext ) override; | ||
48 | 48 | | |||
49 | public: | 49 | public: | ||
50 | /** | 50 | /** | ||
51 | * Describes which decorations are painted around data labels. | 51 | * Describes which decorations are painted around data labels. | ||
52 | */ | 52 | */ | ||
53 | enum LabelDecoration { | 53 | enum LabelDecoration { | ||
54 | NoDecoration = 0, ///< No decoration | 54 | NoDecoration = 0, ///< No decoration | ||
55 | FrameDecoration = 1, ///< A rectangular frame is painted around the label text | 55 | FrameDecoration = 1, ///< A rectangular frame is painted around the label text | ||
Show All 9 Lines | |||||
65 | /// \note Collision avoidance may allow labels to be closer than AbstractDiagram with | 65 | /// \note Collision avoidance may allow labels to be closer than AbstractDiagram with | ||
66 | /// allowOverlappingDataValueTexts() == false, so you should usually also call | 66 | /// allowOverlappingDataValueTexts() == false, so you should usually also call | ||
67 | /// setAllowOverlappingDataValueTexts( true ) if you enable this feature. | 67 | /// setAllowOverlappingDataValueTexts( true ) if you enable this feature. | ||
68 | void setLabelCollisionAvoidanceEnabled( bool enabled ); | 68 | void setLabelCollisionAvoidanceEnabled( bool enabled ); | ||
69 | /// Return whether overlapping labels will be moved to until they don't overlap anymore. | 69 | /// Return whether overlapping labels will be moved to until they don't overlap anymore. | ||
70 | bool isLabelCollisionAvoidanceEnabled() const; | 70 | bool isLabelCollisionAvoidanceEnabled() const; | ||
71 | 71 | | |||
72 | /** \reimpl */ | 72 | /** \reimpl */ | ||
73 | void resize ( const QSizeF& area ) Q_DECL_OVERRIDE; | 73 | void resize ( const QSizeF& area ) override; | ||
74 | 74 | | |||
75 | // Implement AbstractPolarDiagram | 75 | // Implement AbstractPolarDiagram | ||
76 | /** \reimpl */ | 76 | /** \reimpl */ | ||
77 | qreal valueTotals () const Q_DECL_OVERRIDE; | 77 | qreal valueTotals () const override; | ||
78 | /** \reimpl */ | 78 | /** \reimpl */ | ||
79 | qreal numberOfValuesPerDataset() const Q_DECL_OVERRIDE; | 79 | qreal numberOfValuesPerDataset() const override; | ||
80 | /** \reimpl */ | 80 | /** \reimpl */ | ||
81 | qreal numberOfGridRings() const Q_DECL_OVERRIDE; | 81 | qreal numberOfGridRings() const override; | ||
82 | 82 | | |||
83 | virtual PieDiagram * clone() const; | 83 | virtual PieDiagram * clone() const; | ||
84 | 84 | | |||
85 | protected: | 85 | protected: | ||
86 | /** \reimpl */ | 86 | /** \reimpl */ | ||
87 | const QPair<QPointF, QPointF> calculateDataBoundaries() const Q_DECL_OVERRIDE; | 87 | const QPair<QPointF, QPointF> calculateDataBoundaries() const override; | ||
88 | void paintEvent( QPaintEvent* ) Q_DECL_OVERRIDE; | 88 | void paintEvent( QPaintEvent* ) override; | ||
89 | void resizeEvent( QResizeEvent* ) Q_DECL_OVERRIDE; | 89 | void resizeEvent( QResizeEvent* ) override; | ||
90 | 90 | | |||
91 | private: | 91 | private: | ||
92 | // ### move to private class? | 92 | // ### move to private class? | ||
93 | void placeLabels( PaintContext* paintContext ); | 93 | void placeLabels( PaintContext* paintContext ); | ||
94 | // Solve problems with label overlap by changing label positions inside d->labelPaintCache. | 94 | // Solve problems with label overlap by changing label positions inside d->labelPaintCache. | ||
95 | void shuffleLabels( QRectF* textBoundingRect ); | 95 | void shuffleLabels( QRectF* textBoundingRect ); | ||
96 | void paintInternal( PaintContext* paintContext ); | 96 | void paintInternal( PaintContext* paintContext ); | ||
97 | void drawSlice( QPainter* painter, const QRectF& drawPosition, uint slice ); | 97 | void drawSlice( QPainter* painter, const QRectF& drawPosition, uint slice ); | ||
Show All 26 Lines |