mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +226,7 @@ private slots:
|
||||
void showRowidColumn(bool show);
|
||||
void browseDataSetTableEncoding(bool forAllTables = false);
|
||||
void browseDataSetDefaultTableEncoding();
|
||||
void browseDataFetchAllData();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>280</width>
|
||||
<width>468</width>
|
||||
<height>558</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -1255,6 +1255,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonLoadAllData">
|
||||
<property name="toolTip">
|
||||
<string>Load all data. This has only an effect if not all data has been fetched from the table yet due to the partial fetch mechanism.</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons/icons.qrc">
|
||||
<normaloff>:/icons/keyword</normaloff>:/icons/keyword</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1867,6 +1878,16 @@
|
||||
<tabstop>spinPragmaWalAutoCheckpoint</tabstop>
|
||||
<tabstop>comboLogSubmittedBy</tabstop>
|
||||
<tabstop>buttonLogClear</tabstop>
|
||||
<tabstop>mainTab</tabstop>
|
||||
<tabstop>buttonBegin</tabstop>
|
||||
<tabstop>buttonEnd</tabstop>
|
||||
<tabstop>tabSqlAreas</tabstop>
|
||||
<tabstop>treePlotColumns</tabstop>
|
||||
<tabstop>comboLineType</tabstop>
|
||||
<tabstop>comboPointShape</tabstop>
|
||||
<tabstop>butSavePlot</tabstop>
|
||||
<tabstop>buttonLoadAllData</tabstop>
|
||||
<tabstop>treeSchemaDock</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="icons/icons.qrc"/>
|
||||
@@ -1959,8 +1980,8 @@
|
||||
<slot>addRecord()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>443</x>
|
||||
<y>141</y>
|
||||
<x>402</x>
|
||||
<y>143</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@@ -1975,8 +1996,8 @@
|
||||
<slot>deleteRecord()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>565</x>
|
||||
<y>141</y>
|
||||
<x>506</x>
|
||||
<y>143</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@@ -1991,8 +2012,8 @@
|
||||
<slot>navigatePrevious()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>74</x>
|
||||
<y>585</y>
|
||||
<x>86</x>
|
||||
<y>539</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@@ -2007,8 +2028,8 @@
|
||||
<slot>navigateNext()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>168</x>
|
||||
<y>585</y>
|
||||
<x>183</x>
|
||||
<y>539</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@@ -2023,8 +2044,8 @@
|
||||
<slot>navigateGoto()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>413</x>
|
||||
<y>586</y>
|
||||
<x>365</x>
|
||||
<y>539</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@@ -2039,8 +2060,8 @@
|
||||
<slot>navigateGoto()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>565</x>
|
||||
<y>586</y>
|
||||
<x>506</x>
|
||||
<y>538</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@@ -2295,8 +2316,8 @@
|
||||
<slot>createTreeContextMenu(QPoint)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>101</x>
|
||||
<y>125</y>
|
||||
<x>111</x>
|
||||
<y>261</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
@@ -2343,8 +2364,8 @@
|
||||
<slot>loadPragmas()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>101</x>
|
||||
<y>125</y>
|
||||
<x>111</x>
|
||||
<y>540</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>-1</x>
|
||||
@@ -2359,8 +2380,8 @@
|
||||
<slot>savePragmas()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>101</x>
|
||||
<y>125</y>
|
||||
<x>111</x>
|
||||
<y>540</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>802</x>
|
||||
@@ -2379,8 +2400,8 @@
|
||||
<y>126</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>691</x>
|
||||
<y>163</y>
|
||||
<x>632</x>
|
||||
<y>173</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@@ -2395,8 +2416,8 @@
|
||||
<y>126</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>990</x>
|
||||
<y>240</y>
|
||||
<x>1028</x>
|
||||
<y>230</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@@ -2407,12 +2428,12 @@
|
||||
<slot>setCurrentIndex(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>872</x>
|
||||
<y>126</y>
|
||||
<x>772</x>
|
||||
<y>135</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>987</x>
|
||||
<y>240</y>
|
||||
<x>1028</x>
|
||||
<y>230</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
@@ -2439,8 +2460,8 @@
|
||||
<slot>closeSqlTab(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>81</x>
|
||||
<y>125</y>
|
||||
<x>91</x>
|
||||
<y>259</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>-1</x>
|
||||
@@ -2663,8 +2684,8 @@
|
||||
<slot>navigateEnd()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>189</x>
|
||||
<y>573</y>
|
||||
<x>223</x>
|
||||
<y>539</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>499</x>
|
||||
@@ -2679,8 +2700,8 @@
|
||||
<slot>navigateBegin()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>69</x>
|
||||
<y>140</y>
|
||||
<x>50</x>
|
||||
<y>539</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>499</x>
|
||||
@@ -2727,8 +2748,8 @@
|
||||
<slot>jumpToRow(QString,QString,QByteArray)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>60</x>
|
||||
<y>105</y>
|
||||
<x>70</x>
|
||||
<y>242</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>518</x>
|
||||
@@ -2800,6 +2821,22 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonLoadAllData</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>browseDataFetchAllData()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>1003</x>
|
||||
<y>389</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>1005</x>
|
||||
<y>412</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>fileOpen()</slot>
|
||||
@@ -2860,5 +2897,6 @@
|
||||
<slot>showRowidColumn(bool)</slot>
|
||||
<slot>browseDataSetTableEncoding()</slot>
|
||||
<slot>browseDataSetDefaultTableEncoding()</slot>
|
||||
<slot>browseDataFetchAllData()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user