Commit c40965f1 authored by Aleksei Kanash's avatar Aleksei Kanash

Fixed wring merge (Commit:338c6390).

Implemented duplication and copying of strokes - Sankore-857.
parent ed9c64af
...@@ -419,9 +419,6 @@ bool UBGraphicsItemDelegate::isLocked() ...@@ -419,9 +419,6 @@ bool UBGraphicsItemDelegate::isLocked()
void UBGraphicsItemDelegate::duplicate() void UBGraphicsItemDelegate::duplicate()
{ {
// TODO UB 4.x .. rewrite .. .this is absurde ... we know what we are duplicating // TODO UB 4.x .. rewrite .. .this is absurde ... we know what we are duplicating
UBApplication::boardController->copy();
UBApplication::boardController->paste();
UBApplication::boardController->duplicateItem(dynamic_cast<UBItem*>(delegated())); UBApplication::boardController->duplicateItem(dynamic_cast<UBItem*>(delegated()));
} }
......
#include "UBGraphicsStrokesGroup.h" #include "UBGraphicsStrokesGroup.h"
#include "domain/UBGraphicsPolygonItem.h"
#include "core/memcheck.h" #include "core/memcheck.h"
UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent):QGraphicsItemGroup(parent) UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent):QGraphicsItemGroup(parent)
...@@ -63,6 +65,15 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const ...@@ -63,6 +65,15 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
{ {
UBGraphicsStrokesGroup* copy = new UBGraphicsStrokesGroup(); UBGraphicsStrokesGroup* copy = new UBGraphicsStrokesGroup();
QList<QGraphicsItem*> chl = childItems();
foreach(QGraphicsItem *child, chl)
{
UBGraphicsPolygonItem *polygon = dynamic_cast<UBGraphicsPolygonItem*>(child);
if (polygon)
copy->addToGroup(dynamic_cast<QGraphicsItem*>(polygon->deepCopy()));
}
copyItemParameters(copy); copyItemParameters(copy);
return copy; return copy;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment