| 150 | } |
| 151 | |
| 152 | void DockWidget::setPlotWidget(PlotWidget* plot) { |
| 153 | if (plot_widget_ == plot) { |
| 154 | return; |
| 155 | } |
| 156 | clearCurrentContent(true); |
| 157 | plot_widget_ = plot; |
| 158 | content_widget_ = plot_widget_; |
| 159 | if (plot_widget_ == nullptr) { |
| 160 | return; |
| 161 | } |
| 162 | plot_widget_->setDataServices(session_, catalog_); |
| 163 | setWidget(plot_widget_); |
| 164 | layout()->setContentsMargins(6, 6, 6, 6); // plots keep a margin; reset to flush in clearCurrentContent |
| 165 | connect(plot_widget_, &PlotWidget::splitHorizontal, this, [this]() { splitHorizontal(); }); |
| 166 | connect(plot_widget_, &PlotWidget::splitVertical, this, [this]() { splitVertical(); }); |
| 167 | connect(plot_widget_, &PlotWidget::undoableChange, this, &DockWidget::undoableChange); |
| 168 | emit plotWidgetCreated(plot_widget_); |
| 169 | } |
| 170 | |
| 171 | void DockWidget::setObjectWidget(IDataWidget* widget) { |
| 172 | if (object_widget_ == widget) { |
no test coverage detected