Plot: Minor code improvement

Use the actual data for type guessing, i.e. nothing for NULL values
instead of 'NULL'. This should be a bit simpler and faster and overall
more correct (even though it doesn't change the behaviour at all).
This commit is contained in:
Martin Kleusberg
2016-01-27 21:19:53 +01:00
parent 6784a6a854
commit 3ff20044e0

View File

@@ -1632,7 +1632,7 @@ QVariant::Type guessdatatype(SqliteTableModel* model, int column)
QVariant::Type type = QVariant::Invalid;
for(int i = 0; i < std::min(10, model->rowCount()) && type != QVariant::String; ++i)
{
QVariant data = model->data(model->index(i, column));
QVariant data = model->data(model->index(i, column), Qt::EditRole);
if(data.convert(QVariant::Double))
{
type = QVariant::Double;
@@ -1797,8 +1797,7 @@ void MainWindow::updatePlot(SqliteTableModel *model, bool update)
ydata[i] = model->data(model->index(i, y)).toDouble();
}
// set some graph styles, this could also be improved to let the user choose
// some styling
// set some graph styles
graph->setData(xdata, ydata);
graph->setLineStyle((QCPGraph::LineStyle) ui->comboLineType->currentIndex());
// WARN: ssDot is removed