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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • 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 
29 class QBrush;
30 class QPainter;
31 class QPen;
32 class QPointF;
33 class KPlotWidget;
34 class KPlotPoint;
35 
53 class KDEUI_EXPORT KPlotObject{
54 public:
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 
272 private:
273  class Private;
274  Private * const d;
275 
276  Q_DISABLE_COPY( KPlotObject )
277 };
278 Q_DECLARE_OPERATORS_FOR_FLAGS( KPlotObject::PlotTypes )
279 
280 #endif
QColor
KPlotPoint
Encapsulates a point in the plot.
Definition: kplotpoint.h:40
KStandardShortcut::label
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
QString
KPlotObject
Encapsulates a data set to be plotted in a KPlotWidget.
Definition: kplotobject.h:53
KPlotObject::PlotType
PlotType
The type classification of the KPlotObject.
Definition: kplotobject.h:64
KPlotWidget
Generic data plotting widget.
Definition: kplotwidget.h:80
kdeui_export.h
KPlotObject::PointStyle
PointStyle
The available shape styles for plotted points.
Definition: kplotobject.h:76
QList< KPlotPoint * >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:15 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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