• 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
kplotpoint.cpp
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 #include "kplotpoint.h"
22 
23 #include <QtAlgorithms>
24 #include <QPainter>
25 
26 #include <kdebug.h>
27 
28 class KPlotPoint::Private
29 {
30  public:
31  Private( KPlotPoint * qq, const QPointF &p, const QString &l, double bw )
32  : q( qq ), point( p ), label( l ), barWidth( bw )
33  {
34  }
35 
36  KPlotPoint *q;
37 
38  QPointF point;
39  QString label;
40  double barWidth;
41 };
42 
43 KPlotPoint::KPlotPoint()
44  : d( new Private( this, QPointF(), QString(), 0.0 ) )
45 {
46 }
47 
48 KPlotPoint::KPlotPoint( double x, double y, const QString &label, double barWidth )
49  : d( new Private( this, QPointF( x, y ), label, barWidth ) )
50 {
51 }
52 
53 KPlotPoint::KPlotPoint( const QPointF &p, const QString &label, double barWidth )
54  : d( new Private( this, p, label, barWidth ) )
55 {
56 }
57 
58 KPlotPoint::~KPlotPoint()
59 {
60  delete d;
61 }
62 
63 QPointF KPlotPoint::position() const
64 {
65  return d->point;
66 }
67 
68 void KPlotPoint::setPosition( const QPointF &pos )
69 {
70  d->point = pos;
71 }
72 
73 double KPlotPoint::x() const
74 {
75  return d->point.x();
76 }
77 
78 void KPlotPoint::setX( double x )
79 {
80  d->point.setX( x );
81 }
82 
83 double KPlotPoint::y() const
84 {
85  return d->point.y();
86 }
87 
88 void KPlotPoint::setY( double y )
89 {
90  d->point.setY( y );
91 }
92 
93 QString KPlotPoint::label() const
94 {
95  return d->label;
96 }
97 
98 void KPlotPoint::setLabel( const QString &label )
99 {
100  d->label = label;
101 }
102 
103 double KPlotPoint::barWidth() const
104 {
105  return d->barWidth;
106 }
107 
108 void KPlotPoint::setBarWidth( double w )
109 {
110  d->barWidth = w;
111 }
KPlotPoint
Encapsulates a point in the plot.
Definition: kplotpoint.h:40
KPlotPoint::setLabel
void setLabel(const QString &label)
Set the label for the point.
Definition: kplotpoint.cpp:98
kdebug.h
KStandardShortcut::label
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
QString
KPlotPoint::label
QString label() const
Definition: kplotpoint.cpp:93
kplotpoint.h
KPlotPoint::x
double x() const
Definition: kplotpoint.cpp:73
KPlotPoint::~KPlotPoint
~KPlotPoint()
Destructor.
Definition: kplotpoint.cpp:58
KPlotPoint::barWidth
double barWidth() const
Definition: kplotpoint.cpp:103
KPlotPoint::setX
void setX(double x)
Set the X-position of the point, in Data units.
Definition: kplotpoint.cpp:78
KPlotPoint::y
double y() const
Definition: kplotpoint.cpp:83
KPlotPoint::setPosition
void setPosition(const QPointF &pos)
Set the position of the point, in data units.
Definition: kplotpoint.cpp:68
KPlotPoint::KPlotPoint
KPlotPoint()
Default constructor.
Definition: kplotpoint.cpp:43
KPlotPoint::setBarWidth
void setBarWidth(double w)
Set the bar-width for the point.
Definition: kplotpoint.cpp:108
KPlotPoint::position
QPointF position() const
Definition: kplotpoint.cpp:63
KPlotPoint::setY
void setY(double y)
Set the Y-position of the point, in Data units.
Definition: kplotpoint.cpp:88
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