Changeset View
Changeset View
Standalone View
Standalone View
src/items/text/KReportDesignerItemText.cpp
Show All 27 Lines | |||||
28 | #include <QGraphicsSceneMouseEvent> | 28 | #include <QGraphicsSceneMouseEvent> | ||
29 | #include "kreportplugin_debug.h" | 29 | #include "kreportplugin_debug.h" | ||
30 | 30 | | |||
31 | // | 31 | // | ||
32 | // class ReportEntityText | 32 | // class ReportEntityText | ||
33 | // | 33 | // | ||
34 | // methods (constructors) | 34 | // methods (constructors) | ||
35 | 35 | | |||
36 | void KReportDesignerItemText::init(QGraphicsScene *scene, KReportDesigner *d) | 36 | void KReportDesignerItemText::init(QGraphicsScene *scene) | ||
37 | { | 37 | { | ||
38 | //setFlags(ItemIsSelectable | ItemIsMovable); | 38 | //setFlags(ItemIsSelectable | ItemIsMovable); | ||
39 | if (scene) | 39 | if (scene) | ||
40 | scene->addItem(this); | 40 | scene->addItem(this); | ||
41 | 41 | | |||
42 | connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)), | 42 | connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)), | ||
43 | this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); | 43 | this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); | ||
44 | 44 | | |||
45 | m_controlSource->setListData(designer()->fieldKeys(), designer()->fieldNames()); | 45 | m_controlSource->setListData(designer()->fieldKeys(), designer()->fieldNames()); | ||
46 | setZValue(z()); | 46 | setZValue(z()); | ||
47 | 47 | | |||
48 | updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(), | 48 | updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(), | ||
49 | QLatin1String("textarea")); | 49 | QLatin1String("textarea")); | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | KReportDesignerItemText::KReportDesignerItemText(KReportDesigner * rw, QGraphicsScene * scene, const QPointF &pos) | 52 | KReportDesignerItemText::KReportDesignerItemText(KReportDesigner * rw, QGraphicsScene * scene, const QPointF &pos) | ||
53 | : KReportDesignerItemRectBase(rw, this) | 53 | : KReportDesignerItemRectBase(rw, this) | ||
54 | { | 54 | { | ||
55 | Q_UNUSED(pos); | 55 | Q_UNUSED(pos); | ||
56 | init(scene, rw); | 56 | init(scene); | ||
57 | setSceneRect(properRect(*rw, getTextRect().width(), getTextRect().height())); | 57 | setSceneRect(properRect(*rw, getTextRect().width(), getTextRect().height())); | ||
58 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | 58 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | KReportDesignerItemText::KReportDesignerItemText(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s) | 61 | KReportDesignerItemText::KReportDesignerItemText(const QDomNode & element, KReportDesigner *d, QGraphicsScene *scene) | ||
62 | : KReportItemText(element), KReportDesignerItemRectBase(d, this) | 62 | : KReportItemText(element), KReportDesignerItemRectBase(d, this) | ||
63 | { | 63 | { | ||
64 | init(s, d); | 64 | init(scene); | ||
65 | setSceneRect(KReportItemBase::scenePosition(item()->position()), KReportItemBase::sceneSize(item()->size())); | 65 | setSceneRect(KReportItemBase::scenePosition(item()->position()), KReportItemBase::sceneSize(item()->size())); | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | KReportDesignerItemText* KReportDesignerItemText::clone() | 68 | KReportDesignerItemText* KReportDesignerItemText::clone() | ||
69 | { | 69 | { | ||
70 | QDomDocument d; | 70 | QDomDocument d; | ||
71 | QDomElement e = d.createElement(QLatin1String("clone")); | 71 | QDomElement e = d.createElement(QLatin1String("clone")); | ||
72 | QDomNode n; | 72 | QDomNode n; | ||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |