labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

DatapickerPoint.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : DatapickerPoint.h
3  Project : LabPlot
4  Description : Graphic Item for coordinate points of Datapicker
5  --------------------------------------------------------------------
6  Copyright : (C) 2015 by Ankit Wagadre (wagadre.ankit@gmail.com)
7  Copyright : (C) 2015-2019 Alexander Semke (alexander.semke@web.de)
8  ***************************************************************************/
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  * This program is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19  * GNU General Public License for more details. *
20  * *
21  * You should have received a copy of the GNU General Public License *
22  * along with this program; if not, write to the Free Software *
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
24  * Boston, MA 02110-1301 USA *
25  * *
26  ***************************************************************************/
27 
28 #ifndef DATAPICKERPOINT_H
29 #define DATAPICKERPOINT_H
30 
32 #include "backend/lib/macros.h"
33 
34 #include <QGraphicsItem>
35 
36 //TODO: own file
37 class ErrorBarItem : public QObject, public QGraphicsRectItem {
38  Q_OBJECT
39 
40 public:
42 
44  void setRectSize(const qreal);
45 
46 public slots:
47  void setPosition(QPointF);
48 
49 private:
50  void initRect();
51  void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
52  void hoverEnterEvent(QGraphicsSceneHoverEvent*) override;
53  QVariant itemChange(GraphicsItemChange, const QVariant &value) override;
54 
55  QGraphicsLineItem* barLineItem;
56  QRectF m_rect;
59 };
60 
63  Q_OBJECT
64 
65 public:
66  explicit DatapickerPoint(const QString& name);
67  ~DatapickerPoint() override;
68 
69  QIcon icon() const override;
70  QMenu* createContextMenu() override;
71  QGraphicsItem* graphicsItem() const;
72  void setParentGraphicsItem(QGraphicsItem*);
73  void setPrinting(bool);
75 
76  void save(QXmlStreamWriter*) const override;
77  bool load(XmlStreamReader*, bool preview) override;
78 
79  BASIC_D_ACCESSOR_DECL(QPointF, position, Position)
80  BASIC_D_ACCESSOR_DECL(QPointF, plusDeltaXPos, PlusDeltaXPos)
81  BASIC_D_ACCESSOR_DECL(QPointF, minusDeltaXPos, MinusDeltaXPos)
82  BASIC_D_ACCESSOR_DECL(QPointF, plusDeltaYPos, PlusDeltaYPos)
83  BASIC_D_ACCESSOR_DECL(QPointF, minusDeltaYPos, MinusDeltaYPos)
84 
86 
87 public slots:
88  void retransform();
89 
90 protected:
92  DatapickerPoint(const QString &name, DatapickerPointPrivate *dd);
93  static QPen selectedPen;
94  static float selectedOpacity;
95 
96 private:
97  Q_DECLARE_PRIVATE(DatapickerPoint)
98  void init();
99 
101 
102 signals:
103  void positionChanged(QPointF);
104  void plusDeltaXPosChanged(QPointF);
105  void minusDeltaXPosChanged(QPointF);
106  void plusDeltaYPosChanged(QPointF);
107  void minusDeltaYPosChanged(QPointF);
108 };
109 
110 #endif
Base class of all persistent objects in a Project.
QString name() const
~DatapickerPoint() override
void minusDeltaXPosChanged(QPointF)
void initErrorBar(DatapickerCurve::Errors)
void positionChanged(QPointF)
void setPrinting(bool)
DatapickerPointPrivate *const d_ptr
QList< ErrorBarItem * > m_errorBarItemList
static float selectedOpacity
QIcon icon() const override
void minusDeltaYPosChanged(QPointF)
void plusDeltaXPosChanged(QPointF)
void save(QXmlStreamWriter *) const override
Save as XML.
bool load(XmlStreamReader *, bool preview) override
Load from XML.
void plusDeltaYPosChanged(QPointF)
QMenu * createContextMenu() override
Return a new context menu.
QGraphicsItem * graphicsItem() const
DatapickerPoint(const QString &name)
static QPen selectedPen
void setParentGraphicsItem(QGraphicsItem *)
A customizable error-bar for DatapickerPoint.
ErrorBarType m_type
QVariant itemChange(GraphicsItemChange, const QVariant &value) override
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
QGraphicsLineItem * barLineItem
void setPosition(QPointF)
DatapickerPoint * m_parentItem
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override
ErrorBarItem(DatapickerPoint *parent=nullptr, ErrorBarType type=ErrorBarType::PlusDeltaX)
void setRectSize(const qreal)
XML stream parser that supports errors as well as warnings. This class also adds line and column numb...
#define BASIC_D_ACCESSOR_DECL(type, method, Method)
Definition: macros.h:107