From 6784a6a854813bc6577f81c4300d8983abb3cee9 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Wed, 27 Jan 2016 20:50:39 +0100 Subject: [PATCH] Plot: Load all data before drawing a plot Load all table data first, before drawing a plot. Otherwise the plot might be incomplete because not all data is loaded yet due to partial table loading. See issue #499. --- src/MainWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 66dee55f..e513d82e 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1682,6 +1682,10 @@ void MainWindow::updatePlot(SqliteTableModel *model, bool update) if(model) { + // Make sure all data is loaded before trying to plot anything + while(model->canFetchMore()) + model->fetchMore(); + for(int i = 0; i < model->columnCount(); ++i) { QVariant::Type columntype = guessdatatype(model, i);