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

Method exportView

src/backend/matrix/Matrix.cpp:136–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136bool Matrix::exportView() const {
137#ifndef SDK
138 auto* dlg = new ExportSpreadsheetDialog(m_view);
139 dlg->setFileName(name());
140 dlg->setMatrixMode(true);
141
142 // TODO FITS filter to decide if it can be exported to both
143 dlg->setExportTo(QStringList() << i18n("FITS image") << i18n("FITS table"));
144 if (m_view->selectedColumnCount() == 0)
145 dlg->setExportSelection(false);
146
147 bool ret;
148 if ((ret = (dlg->exec() == QDialog::Accepted))) {
149 const QString path = dlg->path();
150 WAIT_CURSOR;
151
152 if (dlg->format() == ExportSpreadsheetDialog::Format::LaTeX) {
153 const bool verticalHeader = dlg->matrixVerticalHeader();
154 const bool horizontalHeader = dlg->matrixHorizontalHeader();
155 const bool latexHeader = dlg->exportHeader();
156 const bool gridLines = dlg->gridLines();
157 const bool entire = dlg->entireSpreadheet();
158 const bool captions = dlg->captions();
159 m_view->exportToLaTeX(path, verticalHeader, horizontalHeader, latexHeader, gridLines, entire, captions);
160 } else if (dlg->format() == ExportSpreadsheetDialog::Format::FITS) {
161 const int exportTo = dlg->exportToFits();
162 m_view->exportToFits(path, exportTo);
163 } else {
164 const QString separator = dlg->separator();
165 const QLocale::Language format = dlg->numberFormat();
166 m_view->exportToFile(path, separator, format);
167 }
168 RESET_CURSOR;
169 }
170 delete dlg;
171
172 return ret;
173#else
174 return 0;
175#endif
176}
177
178bool Matrix::printView() {
179#ifndef SDK

Callers

nothing calls this directly

Calls 15

setMatrixModeMethod · 0.80
setExportSelectionMethod · 0.80
execMethod · 0.80
matrixVerticalHeaderMethod · 0.80
exportHeaderMethod · 0.80
gridLinesMethod · 0.80
entireSpreadheetMethod · 0.80
captionsMethod · 0.80
separatorMethod · 0.80
setFileNameMethod · 0.45
setExportToMethod · 0.45

Tested by

no test coverage detected