Changeset View
Changeset View
Standalone View
Standalone View
src/items/label/KReportDesignerItemLabel.cpp
Show All 24 Lines | |||||
25 | #include <QKeyEvent> | 25 | #include <QKeyEvent> | ||
26 | #include <QDomDocument> | 26 | #include <QDomDocument> | ||
27 | #include <QPainter> | 27 | #include <QPainter> | ||
28 | #include <QGraphicsScene> | 28 | #include <QGraphicsScene> | ||
29 | #include <QGraphicsSceneMouseEvent> | 29 | #include <QGraphicsSceneMouseEvent> | ||
30 | #include <QTextCursor> | 30 | #include <QTextCursor> | ||
31 | #include <QTextDocument> | 31 | #include <QTextDocument> | ||
32 | 32 | | |||
33 | void KReportDesignerItemLabel::init(QGraphicsScene *scene, KReportDesigner *d) | 33 | void KReportDesignerItemLabel::init(QGraphicsScene *scene) | ||
34 | { | 34 | { | ||
35 | if (scene) | 35 | if (scene) | ||
36 | scene->addItem(this); | 36 | scene->addItem(this); | ||
37 | 37 | | |||
38 | connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)), | 38 | connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)), | ||
39 | this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); | 39 | this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); | ||
40 | 40 | | |||
41 | setZValue(z()); | 41 | setZValue(z()); | ||
Show All 11 Lines | |||||
53 | connect(m_inlineEdit, SIGNAL(exitEditMode()), this, SLOT(exitInlineEditingMode())); | 53 | connect(m_inlineEdit, SIGNAL(exitEditMode()), this, SLOT(exitInlineEditingMode())); | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | // methods (constructors) | 56 | // methods (constructors) | ||
57 | KReportDesignerItemLabel::KReportDesignerItemLabel(KReportDesigner* d, QGraphicsScene * scene, const QPointF &pos) | 57 | KReportDesignerItemLabel::KReportDesignerItemLabel(KReportDesigner* d, QGraphicsScene * scene, const QPointF &pos) | ||
58 | : KReportDesignerItemRectBase(d, this) | 58 | : KReportDesignerItemRectBase(d, this) | ||
59 | { | 59 | { | ||
60 | Q_UNUSED(pos); | 60 | Q_UNUSED(pos); | ||
61 | init(scene, d); | 61 | init(scene); | ||
62 | setSceneRect(properRect(*d, getTextRect().width(), getTextRect().height())); | 62 | setSceneRect(properRect(*d, getTextRect().width(), getTextRect().height())); | ||
63 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | 63 | nameProperty()->setValue(designer()->suggestEntityName(typeName())); | ||
64 | 64 | | |||
65 | enterInlineEditingMode(); | 65 | enterInlineEditingMode(); | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | KReportDesignerItemLabel::KReportDesignerItemLabel(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s) | 68 | KReportDesignerItemLabel::KReportDesignerItemLabel(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s) | ||
69 | : KReportItemLabel(element), KReportDesignerItemRectBase(d, this), m_inlineEdit(0) | 69 | : KReportItemLabel(element), KReportDesignerItemRectBase(d, this), m_inlineEdit(0) | ||
70 | { | 70 | { | ||
71 | init(s, d); | 71 | init(s); | ||
72 | setSceneRect(KReportItemBase::scenePosition(item()->position()), KReportItemBase::sceneSize(item()->size())); | 72 | setSceneRect(KReportItemBase::scenePosition(item()->position()), KReportItemBase::sceneSize(item()->size())); | ||
73 | } | 73 | } | ||
74 | 74 | | |||
75 | KReportDesignerItemLabel* KReportDesignerItemLabel::clone() | 75 | KReportDesignerItemLabel* KReportDesignerItemLabel::clone() | ||
76 | { | 76 | { | ||
77 | QDomDocument d; | 77 | QDomDocument d; | ||
78 | QDomElement e = d.createElement(QLatin1String("clone")); | 78 | QDomElement e = d.createElement(QLatin1String("clone")); | ||
79 | QDomNode n; | 79 | QDomNode n; | ||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |