MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / updateSelectionFrame

Method updateSelectionFrame

src/domain/UBGraphicsScene.cpp:1338–1371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1336}
1337
1338void UBGraphicsScene::updateSelectionFrame()
1339{
1340 if (!mSelectionFrame) {
1341 mSelectionFrame = new UBSelectionFrame();
1342 bool sceneWasModified = isModified();
1343 addItem(mSelectionFrame);
1344 setModified(sceneWasModified);
1345 }
1346
1347 QList<QGraphicsItem*> selItems = selectedItems();
1348 switch (selItems.count()) {
1349 case 0 : {
1350 mSelectionFrame->setVisible(false);
1351 mSelectionFrame->setEnclosedItems(selItems);
1352 } break;
1353 case 1: {
1354 mSelectionFrame->setVisible(false);
1355 mSelectionFrame->setEnclosedItems(QList<QGraphicsItem*>());
1356
1357 UBGraphicsItemDelegate *itemDelegate = UBGraphicsItem::Delegate(selItems.first());
1358 if (itemDelegate)
1359 {
1360 itemDelegate->createControls();
1361 selItems.first()->setVisible(true);
1362 itemDelegate->showControls();
1363 }
1364
1365 } break;
1366 default: {
1367 mSelectionFrame->setVisible(true);
1368 mSelectionFrame->setEnclosedItems(selItems);
1369 } break;
1370 }
1371}
1372
1373void UBGraphicsScene::updateSelectionFrameWrapper(int)
1374{

Callers 4

handleItemsSelectionMethod · 0.80
mouseReleaseEventMethod · 0.80
undoMethod · 0.80
updateLazySceneMethod · 0.80

Calls 4

setEnclosedItemsMethod · 0.80
showControlsMethod · 0.80
setVisibleMethod · 0.45
createControlsMethod · 0.45

Tested by

no test coverage detected