| 2717 | } |
| 2718 | |
| 2719 | void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* graphicsWidget) |
| 2720 | { |
| 2721 | mActiveScene->setURStackEnable(false); |
| 2722 | UBGraphicsItem *toolW3C = duplicateItem(dynamic_cast<UBItem *>(graphicsWidget)); |
| 2723 | UBGraphicsWidgetItem *copyedGraphicsWidget = NULL; |
| 2724 | |
| 2725 | if (toolW3C) |
| 2726 | { |
| 2727 | if (UBGraphicsWidgetItem::Type == toolW3C->type()) |
| 2728 | copyedGraphicsWidget = static_cast<UBGraphicsWidgetItem *>(toolW3C); |
| 2729 | |
| 2730 | UBToolWidget *toolWidget = new UBToolWidget(copyedGraphicsWidget, mControlView); |
| 2731 | |
| 2732 | graphicsWidget->remove(false); |
| 2733 | mActiveScene->addItemToDeletion(graphicsWidget); |
| 2734 | |
| 2735 | mActiveScene->setURStackEnable(true); |
| 2736 | |
| 2737 | QPoint controlViewPos = mControlView->mapFromScene(graphicsWidget->sceneBoundingRect().center()); |
| 2738 | toolWidget->centerOn(mControlView->mapTo(mControlContainer, controlViewPos)); |
| 2739 | toolWidget->show(); |
| 2740 | } |
| 2741 | } |
| 2742 | |
| 2743 | |
| 2744 | void UBBoardController::moveToolWidgetToScene(UBToolWidget* toolWidget) |
no test coverage detected