mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Printing support #1525: pre-formatted, wrapped output of Schema column
The schema column of objects is pre-formatted with wrapped style. In this way, if the "db.hideschemalinebreaks" setting is enabled, the printed output is formatted in the same way, but with a wrapping style, so long lines do not extend the Schema column too much. Added tooltip to Preferences dialog, so it isn't a so hidden feature. Translations updated accordingly for the release. The header style is not applied in that same case.
This commit is contained in:
@@ -3469,7 +3469,7 @@ void MainWindow::printDbStructure ()
|
||||
|
||||
out << "<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
|
||||
<< QString("<title>%1</title>").arg(treeView->windowTitle())
|
||||
<< "</head><body bgcolor=\"#FFFFFF\">";
|
||||
<< "<style type=\"text/css\">pre {white-space: pre-wrap;}</style></head><body bgcolor=\"#FFFFFF\">";
|
||||
|
||||
for (int row = 0; row < rowCount; row++) {
|
||||
|
||||
@@ -3498,7 +3498,10 @@ void MainWindow::printDbStructure ()
|
||||
if (!treeView->isColumnHidden(column2)) {
|
||||
QModelIndex cellIndex = model->index(rowChild, column2, groupIndex);
|
||||
QString data = model->data(cellIndex).toString().toHtmlEscaped();
|
||||
out << QString("<td><h2>%1</h2></td>").arg((!data.isEmpty()) ? data : QString(" "));
|
||||
if (column2 != DbStructureModel::ColumnSQL)
|
||||
out << QString("<td><h2>%1</h2></td>").arg((!data.isEmpty()) ? data : QString(" "));
|
||||
else
|
||||
out << QString("<td><pre>%1</pre></td>").arg((!data.isEmpty()) ? data : QString(" "));
|
||||
}
|
||||
}
|
||||
out << "</tr>";
|
||||
|
||||
Reference in New Issue
Block a user