KPlotting 5.109.0
kplotpoint.h
1/* -*- C++ -*-
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2003 Jason Harris <kstars@30doradus.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KPLOTPOINT_H
9#define KPLOTPOINT_H
10
11#include <kplotting_export.h>
12
13#include <QString>
14
15class QPointF;
16
27class KPLOTTING_EXPORT KPlotPoint
28{
29public:
33 explicit KPlotPoint();
34
44 KPlotPoint(double x, double y, const QString &label = QString(), double width = 0.0);
45
54 explicit KPlotPoint(const QPointF &p, const QString &label = QString(), double width = 0.0);
55
60
64 QPointF position() const;
65
70 void setPosition(const QPointF &pos);
71
75 double x() const;
76
80 void setX(double x);
81
85 double y() const;
86
90 void setY(double y);
91
95 QString label() const;
96
100 void setLabel(const QString &label);
101
105 double barWidth() const;
106
110 void setBarWidth(double w);
111
112private:
113 class Private;
114 Private *const d;
115
116 Q_DISABLE_COPY(KPlotPoint)
117};
118
119#endif
Encapsulates a point in the plot.
Definition kplotpoint.h:28
QPointF position() const
QString label() const
void setBarWidth(double w)
Set the bar-width for the point.
double x() const
void setX(double x)
Set the X-position of the point, in Data units.
double barWidth() const
double y() const
~KPlotPoint()
Destructor.
void setPosition(const QPointF &pos)
Set the position of the point, in data units.
void setY(double y)
Set the Y-position of the point, in Data units.
KPlotPoint()
Default constructor.
KPlotPoint(double x, double y, const QString &label=QString(), double width=0.0)
Constructor.
KPlotPoint(const QPointF &p, const QString &label=QString(), double width=0.0)
Constructor.
void setLabel(const QString &label)
Set the label for the point.