Commit 96b8d5c3 authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

SANKORE-155

Work with objects on the page is difficult.
parent de2fb68f
...@@ -130,6 +130,9 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent) ...@@ -130,6 +130,9 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
UBApplication::applicationController->initialHScroll(), UBApplication::applicationController->initialHScroll(),
UBApplication::applicationController->initialVScroll())); UBApplication::applicationController->initialVScroll()));
} }
connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedProcessing()));
} }
...@@ -138,6 +141,29 @@ UBGraphicsScene::~UBGraphicsScene() ...@@ -138,6 +141,29 @@ UBGraphicsScene::~UBGraphicsScene()
// NOOP // NOOP
} }
void UBGraphicsScene::selectionChangedProcessing()
{
QList<QGraphicsItem *> allItemsList = items();
for( int i = 0; i < allItemsList.size(); i++ )
{
QGraphicsItem *nextItem = allItemsList.at(i);
qreal zValue = nextItem->zValue();
nextItem->setZValue(qreal(1));
qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue);
}
QList<QGraphicsItem *> selItemsList = selectedItems();
for( int i = 0; i < selItemsList.size(); i++ )
{
QGraphicsItem *nextItem = selItemsList.at(i);
qreal zValue = nextItem->zValue();
nextItem->setZValue(2);
qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
}
}
// MARK: - // MARK: -
// MARK: Mouse/Tablet events handling // MARK: Mouse/Tablet events handling
...@@ -1063,6 +1089,7 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co ...@@ -1063,6 +1089,7 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
graphicsWidget->setFlag(QGraphicsItem::ItemIsSelectable, true); graphicsWidget->setFlag(QGraphicsItem::ItemIsSelectable, true);
graphicsWidget->setZValue(getNextObjectZIndex()); graphicsWidget->setZValue(getNextObjectZIndex());
// QGraphicsScene::addWidget(graphicsWidget->widgetWebView());
addItem(graphicsWidget); addItem(graphicsWidget);
qreal ssf = 1 / UBApplication::boardController->systemScaleFactor(); qreal ssf = 1 / UBApplication::boardController->systemScaleFactor();
...@@ -1079,6 +1106,16 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co ...@@ -1079,6 +1106,16 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
UBApplication::undoStack->push(uc); UBApplication::undoStack->push(uc);
setDocumentUpdated(); setDocumentUpdated();
// graphicsWidget->widgetWebView()->setParent(graphicsWidget->v));
// QObject *zz1= graphicsWidget->widgetWebView()->parent();
// QWidget *zz2= graphicsWidget->widgetWebView()->parentWidget();
//
// QObject *zz3= graphicsWidget->parent();
// QGraphicsWidget *zz4= graphicsWidget->parentWidget();
// graphicsWidget->widgetWebView()->loadUrl();
} }
else else
{ {
......
...@@ -271,6 +271,9 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem ...@@ -271,6 +271,9 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void setToolCursor(int tool); void setToolCursor(int tool);
void selectionChangedProcessing();
signals: signals:
void pageSizeChanged(); void pageSizeChanged();
......
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