|
|
@ -164,6 +164,7 @@ void UBGraphicsScene::selectionChangedProcessing() |
|
|
|
|
|
|
|
|
|
|
|
QList<QGraphicsItem *> allItemsList = items(); |
|
|
|
QList<QGraphicsItem *> allItemsList = items(); |
|
|
|
QtLogger::logger() << "=====all items searching...======" << endl; |
|
|
|
QtLogger::logger() << "=====all items searching...======" << endl; |
|
|
|
|
|
|
|
qreal maxZ = 0.; |
|
|
|
for( int i = 0; i < allItemsList.size(); i++ ) |
|
|
|
for( int i = 0; i < allItemsList.size(); i++ ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QGraphicsItem *nextItem = allItemsList.at(i); |
|
|
|
QGraphicsItem *nextItem = allItemsList.at(i); |
|
|
@ -173,27 +174,29 @@ void UBGraphicsScene::selectionChangedProcessing() |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
//Temporary stub end (sankore 360)
|
|
|
|
//Temporary stub end (sankore 360)
|
|
|
|
// qreal zValue = nextItem->zValue();
|
|
|
|
// qreal zValue = nextItem->zValue();
|
|
|
|
// nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
|
|
|
|
if (nextItem->zValue() > maxZ) |
|
|
|
nextItem->setZValue(1); |
|
|
|
maxZ = nextItem->zValue(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal()); |
|
|
|
|
|
|
|
// nextItem->setZValue(qreal(1));
|
|
|
|
QtLogger::logger() << "own Z " << QString::number(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f') |
|
|
|
QtLogger::logger() << "own Z " << QString::number(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f') |
|
|
|
<< " next Z " << QString::number(nextItem->zValue(), 'f')<< endl; |
|
|
|
<< " next Z " << QString::number(nextItem->zValue(), 'f')<< endl; |
|
|
|
// qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue);
|
|
|
|
// qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue);
|
|
|
|
} |
|
|
|
} |
|
|
|
QList<QGraphicsItem *> selItemsList = selectedItems(); |
|
|
|
QList<QGraphicsItem *> selItemsList = selectedItems(); |
|
|
|
QtLogger::logger() << "=====selected items searching...======" << endl; |
|
|
|
QtLogger::logger() << "=====selected items searching...======" << endl; |
|
|
|
QGraphicsItem *nextItem; |
|
|
|
// QGraphicsItem *nextItem;
|
|
|
|
for( int i = 0; i < selItemsList.size(); i++ ) |
|
|
|
for( int i = 0; i < selItemsList.size(); i++ ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nextItem = selItemsList.at(i); |
|
|
|
QGraphicsItem *nextItem = selItemsList.at(i); |
|
|
|
QtLogger::logger() << "own Z " << QString::number(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f') |
|
|
|
QtLogger::logger() << "own Z " << QString::number(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f') |
|
|
|
<< " next Z " << QString::number(nextItem->zValue(), 'f')<< endl; |
|
|
|
<< " next Z " << QString::number(nextItem->zValue(), 'f')<< endl; |
|
|
|
// qreal zValue = nextItem->zValue();
|
|
|
|
// qreal zValue = nextItem->zValue();
|
|
|
|
nextItem->setZValue(2); |
|
|
|
nextItem->setZValue(maxZ + 0.0001); |
|
|
|
// qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
|
|
|
|
// qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
|
|
|
|
} |
|
|
|
} |
|
|
|
QtLogger::logger() << "\nselection processing finished" << endl; |
|
|
|
QtLogger::logger() << "\nselection processing finished" << endl; |
|
|
|
QtLogger::logger().finish(); |
|
|
|
QtLogger::logger().finish(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MARK: -
|
|
|
|
// MARK: -
|
|
|
@ -424,23 +427,23 @@ void UBGraphicsScene::drawEraser(const QPointF &pPoint, bool isFirstDraw) |
|
|
|
|
|
|
|
|
|
|
|
if(isFirstDraw) |
|
|
|
if(isFirstDraw) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
qreal maxZ = 0.; |
|
|
|
QList<QGraphicsItem *> allItemsList = items(); |
|
|
|
QList<QGraphicsItem *> allItemsList = items(); |
|
|
|
for( int i = 0; i < allItemsList.size(); i++ ) |
|
|
|
for( int i = 0; i < allItemsList.size(); i++ ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QGraphicsItem *nextItem = allItemsList.at(i); |
|
|
|
QGraphicsItem *nextItem = allItemsList.at(i); |
|
|
|
qreal zValue = nextItem->zValue(); |
|
|
|
qreal zValue = nextItem->zValue(); |
|
|
|
nextItem->setZValue(qreal(1)); |
|
|
|
if (zValue > maxZ) |
|
|
|
qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue); |
|
|
|
maxZ = zValue; |
|
|
|
|
|
|
|
nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mEraser->setZValue(2); |
|
|
|
mEraser->setZValue(maxZ + 0.0001); |
|
|
|
mEraser->show(); |
|
|
|
mEraser->show(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsScene::drawPointer(const QPointF &pPoint, bool isFirstDraw) |
|
|
|
void UBGraphicsScene::drawPointer(const QPointF &pPoint, bool isFirstDraw) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qreal pointerDiameter = UBSettings::pointerDiameter / UBApplication::boardController->currentZoom(); |
|
|
|
qreal pointerDiameter = UBSettings::pointerDiameter / UBApplication::boardController->currentZoom(); |
|
|
@ -456,19 +459,20 @@ void UBGraphicsScene::drawPointer(const QPointF &pPoint, bool isFirstDraw) |
|
|
|
|
|
|
|
|
|
|
|
if(isFirstDraw) |
|
|
|
if(isFirstDraw) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
qreal maxZ = 0.; |
|
|
|
QList<QGraphicsItem *> allItemsList = items(); |
|
|
|
QList<QGraphicsItem *> allItemsList = items(); |
|
|
|
for( int i = 0; i < allItemsList.size(); i++ ) |
|
|
|
for( int i = 0; i < allItemsList.size(); i++ ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QGraphicsItem *nextItem = allItemsList.at(i); |
|
|
|
QGraphicsItem *nextItem = allItemsList.at(i); |
|
|
|
qreal zValue = nextItem->zValue(); |
|
|
|
qreal zValue = nextItem->zValue(); |
|
|
|
nextItem->setZValue(qreal(1)); |
|
|
|
if (zValue > maxZ) |
|
|
|
qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue); |
|
|
|
maxZ = zValue; |
|
|
|
|
|
|
|
nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mPointer->setZValue(2); |
|
|
|
mPointer->setZValue(maxZ + 0.0001); |
|
|
|
mPointer->show(); |
|
|
|
mPointer->show(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|