KReport

KReportDesignerSectionScene.h
1/* This file is part of the KDE project
2 * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
3 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
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//
20// Class ReportCanvas
21//
22// Overrides the drawForeground() method to do the grid.
23//
24
25#ifndef KREPORTDESIGNERSECTIONSCENE_H
26#define KREPORTDESIGNERSECTIONSCENE_H
27
28#include <QGraphicsScene>
29
30#include "KReportUnit.h"
31
33class KReportDesigner;
37
38class KReportDesignerSectionScene : public QGraphicsScene
39{
41public:
42 KReportDesignerSectionScene(qreal w, qreal h, KReportDesigner* rd);
43 ~KReportDesignerSectionScene() override;
44 KReportDesigner* document() const {
45 return m_rd;
46 }
47 QPointF gridPoint(const QPointF&);
48 void raiseSelected();
49 void lowerSelected();
50 QGraphicsItemList itemsOrdered() const;
51 qreal gridSize() const {
52 return m_pixelIncrementX;
53 }
54
55protected:
56 void drawBackground(QPainter *painter, const QRectF &clip) override;
57 void mousePressEvent(QGraphicsSceneMouseEvent *e) override;
58 void focusOutEvent(QFocusEvent *focusEvent) override;
59 void contextMenuEvent(QGraphicsSceneContextMenuEvent *contextMenuEvent) override;
60
62 void clicked();
63 void lostFocus();
64
65private:
66 qreal lowestZValue();
67 qreal highestZValue();
68 void exitInlineEditingModeInItems(KReportDesignerItemRectBase *rectUnderCursor);
69
70 KReportDesigner * m_rd;
71
72 KReportUnit m_unit;
73 qreal m_majorX = 0.0;
74 qreal m_majorY = 0.0;
75 qreal m_pixelIncrementX = 0.0;
76 qreal m_pixelIncrementY = 0.0;
77 int m_dpiX;
78 int m_dpiY;
79};
80
81#endif
Base class for rectangular report items used within the designer GUI.
The ReportDesigner is the main widget for designing a report.
Converts between different units.
Definition KReportUnit.h:71
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.