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