| 382 | } |
| 383 | |
| 384 | void CartesianPlotDock::setPlots(QList<CartesianPlot*> list) { |
| 385 | DEBUG(Q_FUNC_INFO) |
| 386 | CONDITIONAL_LOCK_RETURN; |
| 387 | m_plotList = list; |
| 388 | m_plot = list.first(); |
| 389 | setAspects(list); |
| 390 | |
| 391 | QList<TextLabel*> labels; |
| 392 | for (auto* plot : list) |
| 393 | labels.append(plot->title()); |
| 394 | |
| 395 | labelWidget->setLabels(labels); |
| 396 | |
| 397 | symmetricPaddingChanged(m_plot->symmetricPadding()); |
| 398 | |
| 399 | ui.leName->setStyleSheet(QString()); |
| 400 | ui.leName->setToolTip(QString()); |
| 401 | |
| 402 | // show the properties of the first plot |
| 403 | this->load(); |
| 404 | |
| 405 | // update active widgets |
| 406 | m_themeHandler->setCurrentTheme(m_plot->theme()); |
| 407 | |
| 408 | // Deactivate the geometry related widgets, if the worksheet layout is active. |
| 409 | // Currently, a plot can only be a child of the worksheet itself, so we only need to ask the parent aspect (=worksheet). |
| 410 | // TODO redesign this, if the hierarchy will be changend in future (a plot is a child of a new object group/container or so) |
| 411 | auto* w = dynamic_cast<Worksheet*>(m_plot->parentAspect()); |
| 412 | if (w) { |
| 413 | bool b = (w->layout() == Worksheet::Layout::NoLayout); |
| 414 | ui.sbTop->setEnabled(b); |
| 415 | ui.sbLeft->setEnabled(b); |
| 416 | ui.sbWidth->setEnabled(b); |
| 417 | ui.sbHeight->setEnabled(b); |
| 418 | connect(w, &Worksheet::layoutChanged, this, &CartesianPlotDock::layoutChanged); |
| 419 | } |
| 420 | |
| 421 | // SIGNALs/SLOTs |
| 422 | connect(m_plot, &CartesianPlot::rectChanged, this, &CartesianPlotDock::plotRectChanged); |
| 423 | connect(m_plot, &CartesianPlot::rangeTypeChanged, this, &CartesianPlotDock::plotRangeTypeChanged); |
| 424 | connect(m_plot, &CartesianPlot::rangeFirstValuesChanged, this, &CartesianPlotDock::plotRangeFirstValuesChanged); |
| 425 | connect(m_plot, &CartesianPlot::rangeLastValuesChanged, this, &CartesianPlotDock::plotRangeLastValuesChanged); |
| 426 | // TODO: check if needed |
| 427 | connect(m_plot, &CartesianPlot::autoScaleChanged, this, &CartesianPlotDock::plotAutoScaleChanged); |
| 428 | connect(m_plot, &CartesianPlot::minChanged, this, &CartesianPlotDock::plotMinChanged); |
| 429 | connect(m_plot, &CartesianPlot::maxChanged, this, &CartesianPlotDock::plotMaxChanged); |
| 430 | connect(m_plot, &CartesianPlot::rangeChanged, this, &CartesianPlotDock::plotRangeChanged); |
| 431 | connect(m_plot, &CartesianPlot::scaleChanged, this, &CartesianPlotDock::plotScaleChanged); |
| 432 | connect(m_plot, &CartesianPlot::rangeFormatChanged, this, &CartesianPlotDock::plotRangeFormatChanged); |
| 433 | |
| 434 | // range breaks |
| 435 | // TODO: activate later once range breaking is implemented |
| 436 | /* |
| 437 | connect(m_plot, &CartesianPlot::xRangeBreakingEnabledChanged, this, &CartesianPlotDock::plotXRangeBreakingEnabledChanged); |
| 438 | connect(m_plot, &CartesianPlot::xRangeBreaksChanged, this, &CartesianPlotDock::plotXRangeBreaksChanged); |
| 439 | connect(m_plot, &CartesianPlot::yRangeBreakingEnabledChanged, this, &CartesianPlotDock::plotYRangeBreakingEnabledChanged); |
| 440 | connect(m_plot, &CartesianPlot::yRangeBreaksChanged, this, &CartesianPlotDock::plotYRangeBreaksChanged); |
| 441 | */ |
nothing calls this directly
no test coverage detected