• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • plotting
kplotobject.h
Go to the documentation of this file.
1/* -*- C++ -*-
2 This file is part of the KDE libraries
3 Copyright (C) 2003 Jason Harris <kstars@30doradus.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KPLOTOBJECT_H
22#define KPLOTOBJECT_H
23
24#include <kdeui_export.h>
25
26#include <QtCore/QString>
27#include <QtGui/QColor>
28
29class QBrush;
30class QPainter;
31class QPen;
32class QPointF;
33class KPlotWidget;
34class KPlotPoint;
35
53class KDEUI_EXPORT KPlotObject{
54public:
64 enum PlotType
65 {
66 UnknownType = 0,
67 Points = 1,
68 Lines = 2,
69 Bars = 4
70 };
71 Q_DECLARE_FLAGS( PlotTypes, PlotType )
72
73
76 enum PointStyle
77 {
78 NoPoints = 0,
79 Circle = 1,
80 Letter = 2,
81 Triangle = 3,
82 Square = 4,
83 Pentagon = 5,
84 Hexagon = 6,
85 Asterisk = 7,
86 Star = 8,
87 UnknwonPoint
88 };
89
99 explicit KPlotObject( const QColor &color = Qt::white, PlotType otype = Points, double size = 2, PointStyle ps = Circle );
100
104 ~KPlotObject();
105
109 PlotTypes plotTypes() const;
110
115 void setShowPoints( bool b );
116
121 void setShowLines( bool b );
122
127 void setShowBars( bool b );
128
132 double size() const;
133
138 void setSize( double s );
139
143 PointStyle pointStyle() const;
144
149 void setPointStyle( PointStyle p );
150
156 const QPen& pen() const;
157
162 void setPen( const QPen &p );
163
167 const QPen& linePen() const;
168
173 void setLinePen( const QPen &p );
174
178 const QPen& barPen() const;
179
184 void setBarPen( const QPen &p );
185
189 const QPen& labelPen() const;
190
195 void setLabelPen( const QPen &p );
196
200 const QBrush brush() const;
201
206 void setBrush( const QBrush &b );
207
211 const QBrush barBrush() const;
212
217 void setBarBrush( const QBrush &b );
218
222 QList< KPlotPoint* > points() const;
223
232 void addPoint( const QPointF &p, const QString &label = QString(), double barWidth = 0.0 );
233
239 void addPoint( KPlotPoint *p );
240
251 void addPoint( double x, double y, const QString &label = QString(), double barWidth = 0.0 );
252
257 void removePoint( int index );
258
262 void clearPoints();
263
270 void draw( QPainter *p, KPlotWidget *pw );
271
272private:
273 class Private;
274 Private * const d;
275
276 Q_DISABLE_COPY( KPlotObject )
277};
278Q_DECLARE_OPERATORS_FOR_FLAGS( KPlotObject::PlotTypes )
279
280#endif
KPlotObject
Encapsulates a data set to be plotted in a KPlotWidget.
Definition: kplotobject.h:53
KPlotObject::PointStyle
PointStyle
The available shape styles for plotted points.
Definition: kplotobject.h:77
KPlotObject::PlotType
PlotType
The type classification of the KPlotObject.
Definition: kplotobject.h:65
KPlotPoint
Encapsulates a point in the plot.
Definition: kplotpoint.h:40
KPlotWidget
Generic data plotting widget.
Definition: kplotwidget.h:80
QList
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal