mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user