KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
KDChartTernaryAxis.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of the KD Chart library.
4**
5** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6**
7** SPDX-License-Identifier: MIT
8**
9****************************************************************************/
10
11#ifndef KDCHARTTERNARYAXIS_H
12#define KDCHARTTERNARYAXIS_H
13
14#include <KDChartAbstractAxis.h>
15#include <KDChartPosition.h>
17
19
20namespace KDChart {
21
22class AbstractTernaryDiagram;
23
27class KDCHART_EXPORT TernaryAxis : public AbstractAxis
28{
29 Q_OBJECT
30
31 Q_DISABLE_COPY(TernaryAxis)
33
34public:
35 explicit TernaryAxis(AbstractTernaryDiagram *diagram = nullptr);
36 ~TernaryAxis() override;
37
38 void paintAll(QPainter &) override;
39 void paint(QPainter *) override;
40 void paintCtx(PaintContext *) override;
41
42 QRect geometry() const override;
43 void setGeometry(const QRect &rect) override;
44
45 bool isEmpty() const override;
46 QSize minimumSize() const override;
47 QSize maximumSize() const override;
48 QSize sizeHint() const override;
49 Qt::Orientations expandingDirections() const override;
50
51 virtual const Position position() const;
52 virtual void setPosition(Position p);
53
54 void setTitleText(const QString &text);
55 QString titleText() const;
56 void setTitleTextAttributes(const TextAttributes &a);
57 TextAttributes titleTextAttributes() const;
58 void resetTitleTextAttributes();
59 bool hasDefaultTitleTextAttributes() const;
60
61 QPair<QSizeF, QSizeF> requiredMargins() const;
62
63private:
64 void updatePrerenderedLabels();
65 // TODO, move class variables to private class
66 QRect m_geometry;
67 Position m_position;
68
69 QString m_title;
70 TextAttributes m_titleAttributes;
71
72 // FIXME (Mirko): Move axis labels from grid to here, do not
73 // expose them, just paint them. Use title text for text. Make
74 // a function to allow the coordinate plane to calculate the
75 // necessary margins, like this:
76 PrerenderedLabel *m_label;
77 PrerenderedLabel *m_fifty;
78};
79
81}
82
83#endif
#define KDCHART_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType)
AbstractDiagram defines the interface for diagram classes.
Base class for diagrams based on a ternary coordinate plane.
Stores information about painting diagrams.
Defines a position, using compass terminology.
A set of text attributes.
PrerenderedLabel is an internal KDChart class that simplifies creation and caching of cached text lab...
QList< TernaryAxis * > TernaryAxisList
typedef Orientations

© 2001 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/
Generated on Wed May 1 2024 00:01:10 for KD Chart API Documentation by doxygen 1.9.8