mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Make sure columns in the Execute SQL area don't get too big by default
When running a SQL statement the column widths of the result table view are set to fit their contents automatically. However, for very long values this makes the table hard to navigate. This is why this commit introduces a maximum column width while still trying to fit each column to its contents. See issue #79, point 2.
This commit is contained in:
@@ -57,7 +57,14 @@ QString SqlExecutionArea::getSelectedSql() const
|
||||
void SqlExecutionArea::finishExecution(const QString& result)
|
||||
{
|
||||
ui->editErrors->setText(result);
|
||||
|
||||
// Set column widths according to their contents but make sure they don't exceed a certain size
|
||||
ui->tableResult->resizeColumnsToContents();
|
||||
for(int i=0;i<model->columnCount();i++)
|
||||
{
|
||||
if(ui->tableResult->columnWidth(i) > 300)
|
||||
ui->tableResult->setColumnWidth(i, 300);
|
||||
}
|
||||
}
|
||||
|
||||
SqlTextEdit* SqlExecutionArea::getEditor()
|
||||
|
||||
Reference in New Issue
Block a user