MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / addFloatingDockWidget

Method addFloatingDockWidget

src/gui/map/map_editor.cpp:3519–3534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3517}
3518
3519void MapEditorController::addFloatingDockWidget(QDockWidget* dock_widget)
3520{
3521 if (!window->restoreDockWidget(dock_widget))
3522 {
3523 dock_widget->setFloating(true);
3524 // We must set the size from the sizeHint() ourselves,
3525 // otherwise QDockWidget may use the minimum size.
3526 QRect geometry(window->pos(), dock_widget->sizeHint());
3527 geometry.translate(window->width() - geometry.width(), window->centralWidget()->y());
3528 const int max_height = window->centralWidget()->height();
3529 if (geometry.height() > max_height)
3530 geometry.setHeight(max_height);
3531 dock_widget->setGeometry(geometry);
3532 connect(dock_widget, &QDockWidget::dockLocationChanged, this, &MapEditorController::setWindowStateChanged);
3533 }
3534}
3535
3536
3537void MapEditorController::enableGPSDisplay(bool enable)

Callers 2

initMethod · 0.80
positionClickedMethod · 0.80

Calls 6

posMethod · 0.80
yMethod · 0.80
sizeHintMethod · 0.45
translateMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected