Commit 31ca9eca authored by Ivan Ilin's avatar Ivan Ilin

not stable changes

parent c9d41663
......@@ -93,8 +93,8 @@ void UBGraphicsItemDelegate::init()
foreach(DelegateButton* button, mButtons)
{
button->hide();
// button->setZValue(UBGraphicsScene::toolLayerStart + 2);
UBGraphicsItem::assignZValue(button, UBGraphicsScene::toolLayerStart + 2);
button->setZValue(UBGraphicsScene::toolLayerStart + 2);
// UBGraphicsItem::assignZValue(button, UBGraphicsScene::toolLayerStart + 2);
button->setFlag(QGraphicsItem::ItemIsSelectable, true);
}
}
......
......@@ -50,7 +50,7 @@ void UBGraphicsItemTransformUndoCommand::undo()
mItem->setPos(mPreviousPosition);
mItem->setTransform(mPreviousTransform);
// mItem->setZValue(mPreviousZValue);
UBGraphicsItem::assignZValue(mItem, mPreviousZValue);
// UBGraphicsItem::assignZValue(mItem, mPreviousZValue);
UBResizableGraphicsItem* resizableItem = dynamic_cast<UBResizableGraphicsItem*>(mItem);
......@@ -63,7 +63,8 @@ void UBGraphicsItemTransformUndoCommand::redo()
mItem->setPos(mCurrentPosition);
mItem->setTransform(mCurrentTransform);
// mItem->setZValue(mCurrentZValue);
UBGraphicsItem::assignZValue(mItem, mCurrentZValue);
UBGraphicsItem::assignZValue(mItem, /*mCurrentZValue*/mItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
UBResizableGraphicsItem* resizableItem = dynamic_cast<UBResizableGraphicsItem*>(mItem);
......
......@@ -60,6 +60,7 @@
#include "UBGraphicsStroke.h"
#include "core/memcheck.h"
#include "qtlogger.h"
qreal UBGraphicsScene::backgroundLayerStart = -20000000.0;
qreal UBGraphicsScene::objectLayerStart = -10000000.0;
......@@ -139,6 +140,8 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
}
connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedProcessing()));
QtLogger::logger().start("/home/ilia/Documents/tmp/2/log.txt");
QtLogger::logger().finish();
}
UBGraphicsScene::~UBGraphicsScene()
......@@ -152,12 +155,15 @@ UBGraphicsScene::~UBGraphicsScene()
void UBGraphicsScene::selectionChangedProcessing()
{
QtLogger::logger().start("/home/ilia/Documents/tmp/2/log.txt");
QtLogger::logger() << "selection processing started\n" << endl;
// if (selectedItems().count())
// UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f'));
if (selectedItems().count())
UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f'));
QList<QGraphicsItem *> allItemsList = items();
QtLogger::logger() << "=====all items searching...======" << endl;
for( int i = 0; i < allItemsList.size(); i++ )
{
QGraphicsItem *nextItem = allItemsList.at(i);
......@@ -167,18 +173,27 @@ void UBGraphicsScene::selectionChangedProcessing()
continue;
//Temporary stub end (sankore 360)
// qreal zValue = nextItem->zValue();
nextItem->setZValue(qreal(1));
// nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
nextItem->setZValue(1);
QtLogger::logger() << "own Z " << QString::number(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f')
<< " next Z " << QString::number(nextItem->zValue(), 'f')<< endl;
// qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue);
}
QList<QGraphicsItem *> selItemsList = selectedItems();
QtLogger::logger() << "=====selected items searching...======" << endl;
QGraphicsItem *nextItem;
for( int i = 0; i < selItemsList.size(); i++ )
{
QGraphicsItem *nextItem = selItemsList.at(i);
nextItem = selItemsList.at(i);
QtLogger::logger() << "own Z " << QString::number(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f')
<< " next Z " << QString::number(nextItem->zValue(), 'f')<< endl;
// qreal zValue = nextItem->zValue();
nextItem->setZValue(2);
// qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
}
QtLogger::logger() << "\nselection processing finished" << endl;
QtLogger::logger().finish();
}
// MARK: -
......
......@@ -148,8 +148,8 @@ class UBThumbnail
if (!mSelectionItem->scene())
{
item->scene()->addItem(mSelectionItem);
// mSelectionItem->setZValue(item->zValue() - 1);
UBGraphicsItem::assignZValue(mSelectionItem, item->zValue() - 1);
mSelectionItem->setZValue(item->zValue() - 1);
// UBGraphicsItem::assignZValue(mSelectionItem, item->zValue() - 1);
mAddedToScene = true;
}
......
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