KReport

KReportDesignerItemLine.h
1 /* This file is part of the KDE project
2  * Copyright (C) 2001-2007 by OpenMFG, LLC ([email protected])
3  * Copyright (C) 2007-2008 by Adam Pigg ([email protected])
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef KREPORTDESIGNERITEMLINE_H
20 #define KREPORTDESIGNERITEMLINE_H
21 
22 #include "KReportDesignerItemBase.h"
23 #include "KReportItemLine.h"
24 
25 #include <QGraphicsLineItem>
26 
27 class KReportDesigner;
28 class KPropertySet;
29 
30 class KReportDesignerItemLine : public KReportItemLine, public QGraphicsLineItem, public KReportDesignerItemBase
31 {
32  Q_OBJECT
33 public:
34  KReportDesignerItemLine(KReportDesigner *d, QGraphicsScene *scene, const QPointF &pos);
35  KReportDesignerItemLine(KReportDesigner *d, QGraphicsScene *scene, const QPointF &startPos,
36  const QPointF &endPos);
37  KReportDesignerItemLine(const QDomNode &element, KReportDesigner *d, QGraphicsScene *scene);
38  ~KReportDesignerItemLine() override;
39 
40  void buildXML(QDomDocument *doc, QDomElement *parent) override;
41  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
42  QWidget *widget = nullptr) override;
43  KReportDesignerItemLine *clone() override;
44 
45  void setLineScene(const QLineF &line);
46 
47  void move(const QPointF &m) override;
48 
49 private:
50  KReportDesigner* m_rd;
51  void init(QGraphicsScene *s, KReportDesigner *r);
52  int grabHandle(const QPointF &pos);
53 
54  int m_grabAction;
55 
56 protected:
57  void hoverMoveEvent(QGraphicsSceneHoverEvent * event) override;
58  void mouseMoveEvent(QGraphicsSceneMouseEvent * event) override;
59  void mousePressEvent(QGraphicsSceneMouseEvent * event) override;
60  void mouseReleaseEvent(QGraphicsSceneMouseEvent * event) override;
61  QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
62  void propertyChanged(KPropertySet &s, KProperty &p) override;
63 };
64 
65 #endif
Q_OBJECTQ_OBJECT
virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
QCA_EXPORT void init()
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event)
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
KIOCORE_EXPORT CopyJob * move(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
The ReportDesigner is the main widget for designing a report.
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Base class for report items used within the designer GUI.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:17:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.