Changeset View
Changeset View
Standalone View
Standalone View
src/items/field/KReportDesignerItemField.cpp
Show All 25 Lines | |||||
26 | #include <QPainter> | 26 | #include <QPainter> | ||
27 | #include <QGraphicsScene> | 27 | #include <QGraphicsScene> | ||
28 | #include <QGraphicsSceneMouseEvent> | 28 | #include <QGraphicsSceneMouseEvent> | ||
29 | 29 | | |||
30 | // | 30 | // | ||
31 | // class ReportEntityField | 31 | // class ReportEntityField | ||
32 | // | 32 | // | ||
33 | 33 | | |||
34 | void KReportDesignerItemField::init(QGraphicsScene * scene, KReportDesigner * d) | 34 | void KReportDesignerItemField::init(QGraphicsScene *scene) | ||
35 | { | 35 | { | ||
36 | if (scene) | 36 | if (scene) | ||
37 | scene->addItem(this); | 37 | scene->addItem(this); | ||
38 | 38 | | |||
39 | setZValue(z()); | 39 | setZValue(z()); | ||
40 | 40 | | |||
41 | updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(), QLatin1String("field")); | 41 | updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(), QLatin1String("field")); | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | // methods (constructors) | 44 | // methods (constructors) | ||
45 | KReportDesignerItemField::KReportDesignerItemField(KReportDesigner * rw, QGraphicsScene * scene, const QPointF &pos) | 45 | KReportDesignerItemField::KReportDesignerItemField(KReportDesigner *rw, QGraphicsScene *scene, const QPointF &pos) | ||
46 | : KReportDesignerItemRectBase(rw, this) | 46 | : KReportDesignerItemRectBase(rw, this) | ||
47 | { | 47 | { | ||
48 | Q_UNUSED(pos); | 48 | Q_UNUSED(pos); | ||
49 | init(scene, rw); | 49 | init(scene); | ||
50 | setSceneRect(properRect(*rw, getTextRect().width(), getTextRect().height())); | 50 | setSceneRect(properRect(*rw, getTextRect().width(), getTextRect().height())); | ||
51 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | 51 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | KReportDesignerItemField::KReportDesignerItemField(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s) | 54 | KReportDesignerItemField::KReportDesignerItemField(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s) | ||
55 | : KReportItemField(element), KReportDesignerItemRectBase(d, this) | 55 | : KReportItemField(element), KReportDesignerItemRectBase(d, this) | ||
56 | { | 56 | { | ||
57 | init(s, d); | 57 | init(s); | ||
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 | KReportDesignerItemField* KReportDesignerItemField::clone() | 61 | KReportDesignerItemField* KReportDesignerItemField::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 121 Lines • Show Last 20 Lines |