summaryrefslogtreecommitdiffstats
path: root/src/assistant
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-04-24 10:52:39 +0200
committerLiang Qi <liang.qi@qt.io>2019-04-24 11:55:36 +0200
commit4399a1683a016794e22ecdd03eafca07b93af4e2 (patch)
treed1a4da3ad9a57d60da2c7c71ae03a13701c67f16 /src/assistant
parentd91ecc26252f42641a23e25f6a6a18495e0e7700 (diff)
parent97075ce49ee73609330804b8bbbc12fabbb30766 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: .qmake.conf src/qdoc/qmlmarkupvisitor.h src/qdoc/qmlvisitor.h tests/auto/qtattributionsscanner/testdata/good/expected.json Done-With: Kai Koehne <kai.koehne@qt.io> Change-Id: I180ee214d1e5999fc1279b092bd9214b6bf8f858
Diffstat (limited to 'src/assistant')
-rw-r--r--src/assistant/assistant/bookmarkmanager.cpp3
-rw-r--r--src/assistant/assistant/main.cpp1
-rw-r--r--src/assistant/help/qhelpsearchresultwidget.cpp47
3 files changed, 27 insertions, 24 deletions
diff --git a/src/assistant/assistant/bookmarkmanager.cpp b/src/assistant/assistant/bookmarkmanager.cpp
index f15e23a6e..331cea864 100644
--- a/src/assistant/assistant/bookmarkmanager.cpp
+++ b/src/assistant/assistant/bookmarkmanager.cpp
@@ -526,7 +526,8 @@ void BookmarkManager::focusInEventOccurred()
void BookmarkManager::managerWidgetAboutToClose()
{
- delete bookmarkManagerWidget;
+ if (bookmarkManagerWidget)
+ bookmarkManagerWidget->deleteLater();
bookmarkManagerWidget = nullptr;
storeBookmarks();
diff --git a/src/assistant/assistant/main.cpp b/src/assistant/assistant/main.cpp
index 3f4390450..3ddbdbc29 100644
--- a/src/assistant/assistant/main.cpp
+++ b/src/assistant/assistant/main.cpp
@@ -268,6 +268,7 @@ void setupTranslations()
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
TRACE_OBJ
QScopedPointer<QCoreApplication> a(createApplication(argc, argv));
diff --git a/src/assistant/help/qhelpsearchresultwidget.cpp b/src/assistant/help/qhelpsearchresultwidget.cpp
index 86e56b733..b7d61b494 100644
--- a/src/assistant/help/qhelpsearchresultwidget.cpp
+++ b/src/assistant/help/qhelpsearchresultwidget.cpp
@@ -43,6 +43,7 @@
#include <QtCore/QString>
#include <QtCore/QPointer>
#include <QtCore/QStringList>
+#include <QtCore/QTextStream>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLayout>
@@ -71,39 +72,39 @@ public:
void showResultPage(const QVector<QHelpSearchResult> results, bool isIndexing)
{
- QString htmlFile = QString(QLatin1String("<html><head><title>%1"
- "</title></head><body>")).arg(tr("Search Results"));
+ QString htmlFile;
+ QTextStream str(&htmlFile);
+ str << "<html><head><title>" << tr("Search Results") << "</title></head><body>";
const int count = results.count();
if (count != 0) {
- if (isIndexing)
- htmlFile += QString(QLatin1String("<div style=\"text-align:left;"
- " font-weight:bold; color:red\">"
- "%1&nbsp;<span style=\"font-weight:normal; color:black\">"
- "%2</span></div></div><br>")).arg(tr("Note:"))
- .arg(tr("The search results may not be complete since the "
- "documentation is still being indexed."));
+ if (isIndexing) {
+ str << "<div style=\"text-align:left;"
+ " font-weight:bold; color:red\">" << tr("Note:")
+ << "&nbsp;<span style=\"font-weight:normal; color:black\">"
+ << tr("The search results may not be complete since the "
+ "documentation is still being indexed.")
+ << "</span></div></div><br>";
+ }
for (const QHelpSearchResult &result : results) {
- htmlFile += QString(QLatin1String("<div style=\"text-align:left;"
- " font-weight:bold\"><a href=\"%1\">%2</a>"
+ str << "<div style=\"text-align:left; font-weight:bold\"><a href=\""
+ << result.url().toString() << "\">" << result.title() << "</a>"
"<div style=\"color:green; font-weight:normal;"
- " margin:5px\">%3</div></div><p></p>"))
- .arg(result.url().toString(), result.title(),
- result.snippet());
+ " margin:5px\">" << result.snippet() << "</div></div><p></p>";
}
} else {
- htmlFile += QLatin1String("<div align=\"center\"><br><br><h2>")
- + tr("Your search did not match any documents.")
- + QLatin1String("</h2><div>");
- if (isIndexing)
- htmlFile += QLatin1String("<div align=\"center\"><h3>")
- + tr("(The reason for this might be that the documentation "
- "is still being indexed.)")
- + QLatin1String("</h3><div>");
+ str << "<div align=\"center\"><br><br><h2>"
+ << tr("Your search did not match any documents.")
+ << "</h2><div>";
+ if (isIndexing) {
+ str << "<div align=\"center\"><h3>"
+ << tr("(The reason for this might be that the documentation "
+ "is still being indexed.)") << "</h3><div>";
+ }
}
- htmlFile += QLatin1String("</body></html>");
+ str << "</body></html>";
setHtml(htmlFile);
}