|
|
@ -2318,13 +2318,9 @@ void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* gr |
|
|
|
{ |
|
|
|
{ |
|
|
|
mActiveScene->setURStackEnable(false); |
|
|
|
mActiveScene->setURStackEnable(false); |
|
|
|
graphicsWidget->remove(false); |
|
|
|
graphicsWidget->remove(false); |
|
|
|
UBGraphicsItem *toolW3C = duplicateItem(dynamic_cast<UBItem *>(graphicsWidget)); |
|
|
|
mActiveScene->addItemToDeletion(graphicsWidget); |
|
|
|
UBGraphicsWidgetItem *copyedGraphicsWidget = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (UBGraphicsWidgetItem::Type == toolW3C->type()) |
|
|
|
UBToolWidget *toolWidget = new UBToolWidget(graphicsWidget, mControlView); |
|
|
|
copyedGraphicsWidget = static_cast<UBGraphicsWidgetItem *>(toolW3C); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBToolWidget *toolWidget = new UBToolWidget(copyedGraphicsWidget, mControlView); |
|
|
|
|
|
|
|
mActiveScene->setURStackEnable(true); |
|
|
|
mActiveScene->setURStackEnable(true); |
|
|
|
|
|
|
|
|
|
|
|
QPoint controlViewPos = mControlView->mapFromScene(graphicsWidget->sceneBoundingRect().center()); |
|
|
|
QPoint controlViewPos = mControlView->mapFromScene(graphicsWidget->sceneBoundingRect().center()); |
|
|
@ -2335,11 +2331,15 @@ void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* gr |
|
|
|
|
|
|
|
|
|
|
|
void UBBoardController::moveToolWidgetToScene(UBToolWidget* toolWidget) |
|
|
|
void UBBoardController::moveToolWidgetToScene(UBToolWidget* toolWidget) |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBGraphicsWidgetItem *graphicsWidgetItem = addW3cWidget(toolWidget->toolWidget()->widgetUrl(), QPointF(0, 0)); |
|
|
|
UBGraphicsWidgetItem *widgetToScene = toolWidget->toolWidget(); |
|
|
|
graphicsWidgetItem->setPos(toolWidget->pos()); |
|
|
|
|
|
|
|
toolWidget->hide(); |
|
|
|
QPoint mainWindowCenter = toolWidget->mapTo(mMainWindow, QPoint(toolWidget->width(), toolWidget->height()) / 2); |
|
|
|
delete toolWidget; |
|
|
|
QPoint controlViewCenter = mControlView->mapFrom(mMainWindow, mainWindowCenter); |
|
|
|
graphicsWidgetItem->setSelected(true);
|
|
|
|
QPointF scenePos = mControlView->mapToScene(controlViewCenter); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mActiveScene->addGraphicsWidget(widgetToScene, scenePos); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toolWidget->remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|