MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / onDockFocused

Method onDockFocused

pj_app/src/MainWindow.cpp:4077–4112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4075}
4076
4077void MainWindow::onDockFocused(DockWidget* dock) {
4078 bindEditorToPlot(dock != nullptr ? dock->plotWidget() : nullptr);
4079
4080 // Placeholder docks (3-icon picker) and unknown widget kinds fall
4081 // through to the empty page — "nothing to configure" is the honest
4082 // signal when there is no curve, image, or scene to act on.
4083 QWidget* target = empty_dock_page_;
4084 Scene3DDockWidget* scene3d_dock = nullptr;
4085 SceneDockWidget* scene2d_dock = nullptr;
4086 if (dock != nullptr) {
4087 if (dock->plotWidget() != nullptr) {
4088 target = plot_config_page_;
4089 } else if (dock->objectWidget() != nullptr) {
4090 QWidget* obj = dock->objectWidget()->widget();
4091 if (auto* s2d = qobject_cast<Scene2DDockWidget*>(obj); s2d != nullptr) {
4092 target = scene2d_config_page_;
4093 scene2d_dock = s2d;
4094 } else if (auto* s3d = qobject_cast<Scene3DDockWidget*>(obj); s3d != nullptr) {
4095 target = scene3d_config_page_;
4096 scene3d_dock = s3d;
4097 }
4098 }
4099 }
4100 // Bind / unbind the config panels BEFORE switching the stack so the page is
4101 // already populated when it becomes visible. Passing nullptr when leaving a
4102 // scene dock detaches signal connections cleanly.
4103 if (scene2d_config_panel_ != nullptr) {
4104 scene2d_config_panel_->bindDock(scene2d_dock);
4105 }
4106 if (scene3d_config_panel_ != nullptr) {
4107 scene3d_config_panel_->bindDock(scene3d_dock);
4108 }
4109 if (right_panel_stack_ != nullptr) {
4110 right_panel_stack_->setCurrentWidget(target);
4111 }
4112}
4113
4114void MainWindow::buildGlobalToolbar() {
4115 // globalToolbarWidget is a 24-px fixed column packed with Chart icons,

Callers

nothing calls this directly

Calls 4

plotWidgetMethod · 0.80
objectWidgetMethod · 0.80
widgetMethod · 0.45
bindDockMethod · 0.45

Tested by

no test coverage detected