| 450 | } |
| 451 | |
| 452 | void ViewProviderDrawingView::stackBottom() |
| 453 | { |
| 454 | QGIView* qView = getQView(); |
| 455 | if (!qView || !getViewProviderPage()) { |
| 456 | //no view, nothing to stack |
| 457 | return; |
| 458 | } |
| 459 | int minZ = std::numeric_limits<int>::max(); |
| 460 | auto parent = qView->parentItem(); |
| 461 | if (parent) { |
| 462 | //if we have a parentItem, we have to stack within the parentItem, not within the page |
| 463 | auto siblings = parent->childItems(); |
| 464 | for (auto& child : siblings) { |
| 465 | if (child->zValue() < minZ) { |
| 466 | minZ = child->zValue(); |
| 467 | } |
| 468 | } |
| 469 | } else { |
| 470 | //TODO: need to special case DPGI or any other member of a collection |
| 471 | //if we have no parentItem, we are a top level QGIView and we need to stack |
| 472 | //with respect to the other top level views on this page |
| 473 | std::vector<App::DocumentObject*> peerObjects = getViewProviderPage()->claimChildren(); |
| 474 | Gui::Document* gDoc = getDocument(); |
| 475 | for (auto& peer: peerObjects) { |
| 476 | auto vpPeer = gDoc->getViewProvider(peer); |
| 477 | ViewProviderDrawingView* vpdv = static_cast<ViewProviderDrawingView*>(vpPeer); |
| 478 | int z = vpdv->StackOrder.getValue(); |
| 479 | if (z < minZ) { |
| 480 | minZ = z; |
| 481 | } |
| 482 | } |
| 483 | } |
| 484 | StackOrder.setValue(minZ - 1); |
| 485 | qView->setStack(minZ - 1); |
| 486 | } |
| 487 | |
| 488 | const char* ViewProviderDrawingView::whoAmI() const |
| 489 | { |
no test coverage detected