Fixed wring merge (Commit:338c6390b2edf72fd38ac6098ee9217aa95bb953).

Implemented duplication and copying of strokes - Sankore-857.
preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent ed9c64afba
commit c40965f191
  1. 3
      src/domain/UBGraphicsItemDelegate.cpp
  2. 11
      src/domain/UBGraphicsStrokesGroup.cpp

@ -419,9 +419,6 @@ bool UBGraphicsItemDelegate::isLocked()
void UBGraphicsItemDelegate::duplicate()
{
// 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()));
}

@ -1,5 +1,7 @@
#include "UBGraphicsStrokesGroup.h"
#include "domain/UBGraphicsPolygonItem.h"
#include "core/memcheck.h"
UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent):QGraphicsItemGroup(parent)
@ -63,6 +65,15 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
{
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);
return copy;

Loading…
Cancel
Save