27 #include "../../../dataaccess.h" 28 #include "../../../dataaccess/dataset/ObjectIdSet.h" 29 #include "../../../datatype/Property.h" 35 #include "ui_ChartDisplayWidgetForm.h" 38 #include <QMessageBox> 39 #include <QFileDialog> 42 #include <qwt_plot_seriesitem.h> 46 m_ui(new
Ui::ChartDisplayWidgetForm),
53 QGridLayout* layout =
new QGridLayout(
m_ui->m_plotFrame);
57 m_ui->m_exportToolButton->setIcon(QIcon::fromTheme(
"document-save"));
89 if(this->parentWidget())
107 const QwtPlotItemList& itmList =
m_display->itemList();
110 for (QwtPlotItemIterator it = itmList.begin();
111 it != itmList.end(); ++it)
117 QMessageBox::warning(
this, tr(
"Chart Display"), tr(
"This function is not supported on this chart type."));
120 QString fileName = QFileDialog::getSaveFileName(
nullptr, tr(
"Export chart..."), QString(), tr(
"CSV (*.csv *.CSV)"));
122 if (!fileName.isEmpty())
124 QFileInfo info(fileName);
126 if (info.suffix().isEmpty())
127 fileName.append(
".csv");
135 QMessageBox::warning(
this, tr(
"Chart Display"), e.
what());
137 catch (
const std::exception& e)
139 QMessageBox::warning(
this, tr(
"Chart Display"), e.what());
143 QMessageBox::warning(
this, tr(
"Chart Display"), tr(
"Unknown error occurred."));
A class that models the description of a dataset.
virtual const char * what() const
It outputs the exception message.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
A class used to define a chartDisplay's style.
A dialog used to customize a graphic's parameters, weather it is about it's data or it's visual style...
A class to represent a chart display.