KD Chart 2  [rev.2.7]
KDChartTernaryAxis.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHARTTERNARYAXIS_H
24 #define KDCHARTTERNARYAXIS_H
25 
26 
27 #include <KDChartAbstractAxis.h>
28 #include <KDChartPosition.h>
29 #include <KDChartTextAttributes.h>
30 
31 class PrerenderedLabel;
32 
33 namespace KDChart {
34 
35  class AbstractTernaryDiagram;
36 
40  class KDCHART_EXPORT TernaryAxis : public AbstractAxis
41  {
42  Q_OBJECT
43 
44  Q_DISABLE_COPY( TernaryAxis )
46 
47  public:
48  explicit TernaryAxis ( AbstractTernaryDiagram* diagram = 0 );
49  ~TernaryAxis() override;
50 
51  void paintAll( QPainter &) override;
52  void paint (QPainter *) override;
53  void paintCtx (PaintContext *) override;
54 
55  QRect geometry () const override;
56  void setGeometry (const QRect &rect) override;
57 
58  bool isEmpty () const override;
59  QSize minimumSize () const override;
60  QSize maximumSize () const override;
61  QSize sizeHint () const override;
62  Qt::Orientations expandingDirections () const override ;
63 
64  virtual const Position position () const;
65  virtual void setPosition (Position p);
66 
67  void setTitleText( const QString& text );
68  QString titleText() const;
69  void setTitleTextAttributes( const TextAttributes &a );
70  TextAttributes titleTextAttributes() const;
71  void resetTitleTextAttributes();
72  bool hasDefaultTitleTextAttributes() const;
73 
74  QPair<QSizeF, QSizeF> requiredMargins() const;
75 
76  private:
77  void updatePrerenderedLabels();
78  // TODO, move class variables to private class
79  QRect m_geometry;
80  Position m_position;
81 
82  QString m_title;
83  TextAttributes m_titleAttributes;
84 
85  // FIXME (Mirko): Move axis labels from grid to here, do not
86  // expose them, just paint them. Use title text for text. Make
87  // a function to allow the coordinate plane to calculate the
88  // necessary margins, like this:
89  PrerenderedLabel* m_label;
90  PrerenderedLabel* m_fifty;
91  };
92 
94 }
95 
96 #endif
The base class for axes.
QList< TernaryAxis * > TernaryAxisList
AbstractDiagram defines the interface for diagram classes.
The class for ternary axes.
PrerenderedLabel is an internal KDChart class that simplifies creation and caching of cached text lab...
Stores information about painting diagrams.
Base class for diagrams based on a ternary coordinate plane.
Defines a position, using compass terminology.
A set of text attributes.
#define KDCHART_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType)
Definition: KDChartGlobal.h:58

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-chart/