MCPcopy Create free account
hub / github.com/KDE/labplot / load

Method load

src/frontend/dockwidgets/CartesianPlotDock.cpp:1849–1926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1847}
1848
1849void CartesianPlotDock::load() {
1850 // General-tab
1851 ui.chkVisible->setChecked(m_plot->isVisible());
1852
1853 int index = static_cast<int>(m_plot->rangeType());
1854 ui.cbRangeType->setCurrentIndex(index);
1855 rangeTypeChanged(index);
1856 ui.cbNiceExtend->setChecked(m_plot->niceExtend());
1857
1858 m_updateUI = false; // avoid updating twice
1859 updateRangeList(Dimension::X);
1860 m_updateUI = true;
1861 updateRangeList(Dimension::Y);
1862
1863 // Title
1864 labelWidget->load();
1865
1866 // x-range breaks, show the first break
1867 ui.chkXBreak->setChecked(m_plot->xRangeBreakingEnabled());
1868 this->toggleXBreak(m_plot->xRangeBreakingEnabled());
1869 ui.bRemoveXBreak->setVisible(m_plot->xRangeBreaks().list.size() > 1);
1870 ui.cbXBreak->clear();
1871 if (!m_plot->xRangeBreaks().list.isEmpty()) {
1872 for (int i = 1; i <= m_plot->xRangeBreaks().list.size(); ++i)
1873 ui.cbXBreak->addItem(QString::number(i));
1874 } else
1875 ui.cbXBreak->addItem(QStringLiteral("1"));
1876 ui.cbXBreak->setCurrentIndex(0);
1877
1878 // y-range breaks, show the first break
1879 ui.chkYBreak->setChecked(m_plot->yRangeBreakingEnabled());
1880 this->toggleYBreak(m_plot->yRangeBreakingEnabled());
1881 ui.bRemoveYBreak->setVisible(m_plot->yRangeBreaks().list.size() > 1);
1882 ui.cbYBreak->clear();
1883 if (!m_plot->yRangeBreaks().list.isEmpty()) {
1884 for (int i = 1; i <= m_plot->yRangeBreaks().list.size(); ++i)
1885 ui.cbYBreak->addItem(QString::number(i));
1886 } else
1887 ui.cbYBreak->addItem(QStringLiteral("1"));
1888 ui.cbYBreak->setCurrentIndex(0);
1889
1890 //"Plot Area"-tab
1891 const auto* plotArea = m_plot->plotArea();
1892
1893 // Background, border and cursor Lines
1894 QList<Background*> backgrounds;
1895 QList<Line*> cursorLines;
1896 QList<Line*> borderLines;
1897 for (auto* plot : m_plotList) {
1898 backgrounds << plot->plotArea()->background();
1899 borderLines << plot->plotArea()->borderLine();
1900 cursorLines << plot->cursorLine();
1901 }
1902
1903 backgroundWidget->setBackgrounds(backgrounds);
1904 borderLineWidget->setLines(borderLines);
1905 cursorLineWidget->setLines(cursorLines);
1906

Callers 1

setPlotsMethod · 0.95

Calls 15

toggleXBreakMethod · 0.95
toggleYBreakMethod · 0.95
niceExtendMethod · 0.80
plotAreaMethod · 0.80
cursorLineMethod · 0.80
setBackgroundsMethod · 0.80
setLinesMethod · 0.80
xMethod · 0.80
rectMethod · 0.80
heightMethod · 0.80
isVisibleMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected