plot: Add button to load all data

See issue #499.

This also fixes a bug introduced in 6784a6a854
which effectively disabled the partial prefetch mechanism on large
tables.
This commit is contained in:
Martin Kleusberg
2016-05-05 22:57:57 +02:00
parent cb79aba0c2
commit b00c4f791f
3 changed files with 87 additions and 39 deletions

View File

@@ -1713,10 +1713,6 @@ 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);
@@ -2493,3 +2489,16 @@ void MainWindow::browseDataSetDefaultTableEncoding()
{
browseDataSetTableEncoding(true);
}
void MainWindow::browseDataFetchAllData()
{
if(m_browseTableModel)
{
// Make sure all data is loaded
while(m_browseTableModel->canFetchMore())
m_browseTableModel->fetchMore();
// Update plot
updatePlot(m_browseTableModel);
}
}