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:
mgr
2018-10-03 21:36:44 +02:00
parent c78c03bf0b
commit fd0b34265c
16 changed files with 1299 additions and 1224 deletions

View File

@@ -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("&nbsp;"));
if (column2 != DbStructureModel::ColumnSQL)
out << QString("<td><h2>%1</h2></td>").arg((!data.isEmpty()) ? data : QString("&nbsp;"));
else
out << QString("<td><pre>%1</pre></td>").arg((!data.isEmpty()) ? data : QString("&nbsp;"));
}
}
out << "</tr>";