From 67522011547617a272cf2cdb3d23ff92ea5d750c Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Wed, 9 Dec 2015 13:02:14 +0100 Subject: [PATCH] Fixed saving of all graphicsItems' zValues Simply added copying of zValue to the deep copy functions. As tested on OSX, this does pose any problems when duplicating an item on-page (i.e generating a new item with a zValue equal to its original). --- src/domain/UBGraphicsMediaItem.cpp | 2 ++ src/domain/UBGraphicsPDFItem.cpp | 1 + src/domain/UBGraphicsPixmapItem.cpp | 2 ++ src/domain/UBGraphicsSvgItem.cpp | 1 + src/domain/UBGraphicsTextItem.cpp | 1 + src/domain/UBGraphicsWidgetItem.cpp | 1 + 6 files changed, 8 insertions(+) diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index ec3bcd57..ad9dcfeb 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -275,6 +275,8 @@ void UBGraphicsMediaItem::copyItemParameters(UBItem *copy) const cp->setSourceUrl(this->sourceUrl()); cp->resize(this->size()); + cp->setZValue(this->zValue()); + connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), cp, SLOT(activeSceneChanged())); // TODO UB 4.7 complete all members } diff --git a/src/domain/UBGraphicsPDFItem.cpp b/src/domain/UBGraphicsPDFItem.cpp index 03bb763c..09e68b9a 100644 --- a/src/domain/UBGraphicsPDFItem.cpp +++ b/src/domain/UBGraphicsPDFItem.cpp @@ -122,6 +122,7 @@ void UBGraphicsPDFItem::copyItemParameters(UBItem *copy) const cp->setFlag(QGraphicsItem::ItemIsSelectable, true); cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType)); cp->setSourceUrl(this->sourceUrl()); + cp->setZValue(this->zValue()); } } diff --git a/src/domain/UBGraphicsPixmapItem.cpp b/src/domain/UBGraphicsPixmapItem.cpp index be1a3551..44a532d5 100644 --- a/src/domain/UBGraphicsPixmapItem.cpp +++ b/src/domain/UBGraphicsPixmapItem.cpp @@ -156,6 +156,8 @@ void UBGraphicsPixmapItem::copyItemParameters(UBItem *copy) const cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType)); cp->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked)); cp->setSourceUrl(this->sourceUrl()); + + cp->setZValue(this->zValue()); } } diff --git a/src/domain/UBGraphicsSvgItem.cpp b/src/domain/UBGraphicsSvgItem.cpp index 8b8e6b82..172fd0c3 100644 --- a/src/domain/UBGraphicsSvgItem.cpp +++ b/src/domain/UBGraphicsSvgItem.cpp @@ -180,6 +180,7 @@ void UBGraphicsSvgItem::copyItemParameters(UBItem *copy) const cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType)); cp->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked)); cp->setSourceUrl(this->sourceUrl()); + cp->setZValue(this->zValue()); } } diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index a9f949b2..aa389856 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -280,6 +280,7 @@ void UBGraphicsTextItem::copyItemParameters(UBItem *copy) const cp->setTextHeight(this->textHeight()); cp->setSourceUrl(this->sourceUrl()); + cp->setZValue(this->zValue()); } } diff --git a/src/domain/UBGraphicsWidgetItem.cpp b/src/domain/UBGraphicsWidgetItem.cpp index 9ec12d59..757f0c63 100644 --- a/src/domain/UBGraphicsWidgetItem.cpp +++ b/src/domain/UBGraphicsWidgetItem.cpp @@ -744,6 +744,7 @@ void UBGraphicsAppleWidgetItem::copyItemParameters(UBItem *copy) const } cp->setSourceUrl(this->sourceUrl()); + cp->setZValue(this->zValue()); } }