KReport

KReportDesignerItemLabel.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 KREPORTDESIGNERITEMLABEL_H
20 #define KREPORTDESIGNERITEMLABEL_H
21 
22 #include "KReportItemLabel.h"
23 #include "KReportDesignerItemRectBase.h"
24 #include "KReportBoundedTextItem.h"
25 
26 #include <QGraphicsRectItem>
27 #include <QGraphicsItem>
28 #include <QGraphicsItemGroup>
29 #include <KPropertySet>
30 
31 class KReportDesignerItemLabel : public KReportItemLabel, public KReportDesignerItemRectBase
32 {
33  Q_OBJECT
34 public:
35  KReportDesignerItemLabel(KReportDesigner *designer, QGraphicsScene *scene, const QPointF &pos);
36  KReportDesignerItemLabel(const QDomNode &element, KReportDesigner *designer,
37  QGraphicsScene *scene);
38  ~KReportDesignerItemLabel() override;
39 
40  void buildXML(QDomDocument *doc, QDomElement *parent) override;
41  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
42  KReportDesignerItemLabel* clone() override;
43 
44 public Q_SLOTS:
45  void enterInlineEditingMode() override;
46  void exitInlineEditingMode() override;
47 
48 protected:
49  void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * event ) override;
50  void keyReleaseEvent ( QKeyEvent * event ) override;
51 
52 private:
53  void init(QGraphicsScene *scene);
54  QRectF getTextRect() const;
55  BoundedTextItem *m_inlineEdit;
56 
57 private Q_SLOTS:
58  void slotPropertyChanged(KPropertySet &, KProperty &);
59 
60 };
61 
62 #endif
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QCA_EXPORT void init()
Subclass of QGraphicsTextItem which simply forces its boundingRect to be the same as its parent.
virtual void keyReleaseEvent(QKeyEvent *event)
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Base class for rectangular report items used within the designer GUI.
The ReportDesigner is the main widget for designing a report.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
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.