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

Method bindDock

pj_app/src/ui/Scene2DConfigPanel.cpp:76–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void Scene2DConfigPanel::bindDock(SceneDockWidget* dock) {
77 if (dock_.data() == dock) {
78 return;
79 }
80 disconnectDock();
81 dock_ = dock;
82
83 list_->clearRows();
84 config_host_->clear();
85
86 if (dock == nullptr) {
87 return;
88 }
89
90 rebuildList();
91
92 connect(dock, &SceneDockWidget::layerAdded, this, [this](ObjectTopicId topic_id) {
93 if (dock_ == nullptr) {
94 return;
95 }
96 if (ISceneLayer* layer = dock_->layerFor(topic_id)) {
97 const auto info = layer->info();
98 list_->addRow(LayerRow{info.topic_id.id, info.display_name, info.visible});
99 }
100 updateConfigPane();
101 });
102 connect(dock, &SceneDockWidget::layerRemoved, this, [this](ObjectTopicId topic_id) {
103 list_->removeRow(topic_id.id);
104 updateConfigPane();
105 });
106 connect(dock, &SceneDockWidget::layerVisibilityChanged, this, [this](ObjectTopicId topic_id, bool visible) {
107 list_->setRowVisible(topic_id.id, visible);
108 });
109 connect(dock, &SceneDockWidget::layerWarningChanged, this, [this](ObjectTopicId topic_id, bool warn, QString reason) {
110 list_->setRowWarning(topic_id.id, warn, reason);
111 });
112}
113
114void Scene2DConfigPanel::disconnectDock() {
115 if (dock_ != nullptr) {

Callers 1

onDockFocusedMethod · 0.45

Calls 9

clearRowsMethod · 0.80
layerForMethod · 0.80
addRowMethod · 0.80
removeRowMethod · 0.80
setRowVisibleMethod · 0.80
setRowWarningMethod · 0.80
dataMethod · 0.45
clearMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected