Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/web/KReportDesignerItemWeb.cpp
Show All 25 Lines | |||||
26 | #include <KPropertySet> | 26 | #include <KPropertySet> | ||
27 | 27 | | |||
28 | #include <QGraphicsScene> | 28 | #include <QGraphicsScene> | ||
29 | #include <QGraphicsSceneMouseEvent> | 29 | #include <QGraphicsSceneMouseEvent> | ||
30 | #include <QDomDocument> | 30 | #include <QDomDocument> | ||
31 | #include <QPainter> | 31 | #include <QPainter> | ||
32 | #include "kreportplugin_debug.h" | 32 | #include "kreportplugin_debug.h" | ||
33 | 33 | | |||
34 | void KReportDesignerItemWeb::init(QGraphicsScene *scene, KReportDesigner *d) | 34 | void KReportDesignerItemWeb::init(QGraphicsScene *scene) | ||
35 | { | 35 | { | ||
36 | if (scene) | 36 | if (scene) | ||
37 | scene->addItem(this); | 37 | scene->addItem(this); | ||
38 | 38 | | |||
39 | connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)), this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); | 39 | connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)), this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); | ||
40 | 40 | | |||
41 | setZValue(z()); | 41 | setZValue(z()); | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | KReportDesignerItemWeb::KReportDesignerItemWeb(KReportDesigner *rw, QGraphicsScene *scene, | 44 | KReportDesignerItemWeb::KReportDesignerItemWeb(KReportDesigner *rw, QGraphicsScene *scene, | ||
45 | const QPointF &pos) : KReportDesignerItemRectBase(rw, this) | 45 | const QPointF &pos) : KReportDesignerItemRectBase(rw, this) | ||
46 | { | 46 | { | ||
47 | Q_UNUSED(pos); | 47 | Q_UNUSED(pos); | ||
48 | init(scene, rw); | 48 | init(scene); | ||
49 | setSceneRect(properRect(*rw, KREPORT_ITEM_RECT_DEFAULT_WIDTH, KREPORT_ITEM_RECT_DEFAULT_WIDTH)); | 49 | setSceneRect(properRect(*rw, KREPORT_ITEM_RECT_DEFAULT_WIDTH, KREPORT_ITEM_RECT_DEFAULT_WIDTH)); | ||
50 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | 50 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | KReportDesignerItemWeb::KReportDesignerItemWeb(const QDomNode &element, KReportDesigner *rw, | 53 | KReportDesignerItemWeb::KReportDesignerItemWeb(const QDomNode &element, KReportDesigner *rw, | ||
54 | QGraphicsScene *scene) | 54 | QGraphicsScene *scene) | ||
55 | : KReportItemWeb(element), KReportDesignerItemRectBase(rw, this) | 55 | : KReportItemWeb(element), KReportDesignerItemRectBase(rw, this) | ||
56 | { | 56 | { | ||
57 | init(scene, rw); | 57 | init(scene); | ||
58 | setSceneRect(KReportItemBase::scenePosition(item()->position()), KReportItemBase::sceneSize(item()->size())); | 58 | setSceneRect(KReportItemBase::scenePosition(item()->position()), KReportItemBase::sceneSize(item()->size())); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | KReportDesignerItemWeb *KReportDesignerItemWeb::clone() | 61 | KReportDesignerItemWeb *KReportDesignerItemWeb::clone() | ||
62 | { | 62 | { | ||
63 | QDomDocument d; | 63 | QDomDocument d; | ||
64 | QDomElement e = d.createElement(QLatin1String("clone")); | 64 | QDomElement e = d.createElement(QLatin1String("clone")); | ||
65 | QDomNode n; | 65 | QDomNode n; | ||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |