Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportDesigner.cpp
Show First 20 Lines • Show All 1015 Lines • ▼ Show 20 Line(s) | 1015 | else { | |||
---|---|---|---|---|---|
1016 | kreportWarning() << "attempted to insert an unknown item"; | 1016 | kreportWarning() << "attempted to insert an unknown item"; | ||
1017 | } | 1017 | } | ||
1018 | } | 1018 | } | ||
1019 | if (item) { | 1019 | if (item) { | ||
1020 | item->setVisible(true); | 1020 | item->setVisible(true); | ||
1021 | item->setSelected(true); | 1021 | item->setSelected(true); | ||
1022 | KReportItemBase* baseReportItem = dynamic_cast<KReportItemBase*>(item); | 1022 | KReportItemBase* baseReportItem = dynamic_cast<KReportItemBase*>(item); | ||
1023 | if (baseReportItem) { | 1023 | if (baseReportItem) { | ||
1024 | baseReportItem->setUnit(pageUnit()); | ||||
1024 | KPropertySet *set = baseReportItem->propertySet(); | 1025 | KPropertySet *set = baseReportItem->propertySet(); | ||
1025 | KReportDesigner::addMetaProperties(set, classString, iconName); | 1026 | KReportDesigner::addMetaProperties(set, classString, iconName); | ||
1026 | changeSet(set); | 1027 | changeSet(set); | ||
1027 | if (v && v->designer()) { | 1028 | if (v && v->designer()) { | ||
1028 | v->designer()->setModified(true); | 1029 | v->designer()->setModified(true); | ||
1029 | } | 1030 | } | ||
1030 | emit itemInserted(d->sectionData->insertItem); | 1031 | emit itemInserted(d->sectionData->insertItem); | ||
1031 | } | 1032 | } | ||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 1157 | if (!d->sectionData->copy_list.isEmpty()) { | |||
1168 | foreach(KReportDesignerItemBase *item, d->sectionData->copy_list) { | 1169 | foreach(KReportDesignerItemBase *item, d->sectionData->copy_list) { | ||
1169 | KReportItemBase *obj = dynamic_cast<KReportItemBase*>(item); | 1170 | KReportItemBase *obj = dynamic_cast<KReportItemBase*>(item); | ||
1170 | const QString type = obj ? obj->typeName() : QLatin1String("object"); | 1171 | const QString type = obj ? obj->typeName() : QLatin1String("object"); | ||
1171 | //kreportDebug() << type; | 1172 | //kreportDebug() << type; | ||
1172 | KReportDesignerItemBase *ent = item->clone(); | 1173 | KReportDesignerItemBase *ent = item->clone(); | ||
1173 | KReportItemBase *new_obj = dynamic_cast<KReportItemBase*>(ent); | 1174 | KReportItemBase *new_obj = dynamic_cast<KReportItemBase*>(ent); | ||
1174 | new_obj->setEntityName(suggestEntityName(type)); | 1175 | new_obj->setEntityName(suggestEntityName(type)); | ||
1175 | if (activeItem) { | 1176 | if (activeItem) { | ||
1176 | new_obj->position().setScenePos(QPointF(activeItem->x() + 10, activeItem->y() + 10)); | 1177 | new_obj->setPosition(KReportItemBase::positionFromScene(QPointF(activeItem->x() + 10, activeItem->y() + 10))); | ||
1177 | } else { | 1178 | } else { | ||
1178 | new_obj->position().setScenePos(QPointF(0, 0)); | 1179 | new_obj->setPosition(KReportItemBase::positionFromScene(QPointF(0, 0))); | ||
1179 | } | 1180 | } | ||
1180 | changeSet(new_obj->propertySet()); | 1181 | changeSet(new_obj->propertySet()); | ||
1181 | QGraphicsItem *pasted_ent = dynamic_cast<QGraphicsItem*>(ent); | 1182 | QGraphicsItem *pasted_ent = dynamic_cast<QGraphicsItem*>(ent); | ||
1182 | if (pasted_ent) { | 1183 | if (pasted_ent) { | ||
1183 | pasted_ent->setSelected(true); | 1184 | pasted_ent->setSelected(true); | ||
1184 | canvas->addItem(pasted_ent); | 1185 | canvas->addItem(pasted_ent); | ||
1185 | pasted_ent->show(); | 1186 | pasted_ent->show(); | ||
1186 | d->sectionData->mouseAction = ReportWriterSectionData::MA_Grab; | 1187 | d->sectionData->mouseAction = ReportWriterSectionData::MA_Grab; | ||
▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines |