summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:03:51 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:03:58 +0200
commit1bf494714cb63a613aab0d596c1f656738a45fa4 (patch)
treebcbf3e2a449fd853050131ccf3360fef326afe97
parentcbb56d8dab2447ce8fda454e6c6cd6938dffacb1 (diff)
parent7eb201e83514c5c949fcf0f8beebe7858c2d1ace (diff)
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
-rw-r--r--src/assistant/assistant/doc/images/assistant-assistant.pngbin85657 -> 47313 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-bookmarks.pngbin30047 -> 6083 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-dockwidgets.pngbin177943 -> 42222 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-index.pngbin39902 -> 4038 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-preferences-documentation.pngbin22238 -> 9533 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-preferences-filters.pngbin27758 -> 10729 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-preferences-fonts.pngbin21100 -> 5394 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-preferences-options.pngbin36334 -> 5730 bytes
-rw-r--r--src/assistant/assistant/doc/images/assistant-search.pngbin76139 -> 11710 bytes
-rw-r--r--src/assistant/assistant/doc/src/assistant-quick-guide.qdoc21
-rw-r--r--src/designer/src/lib/sdk/abstractwidgetbox.h4
-rw-r--r--src/windeployqt/main.cpp6
-rw-r--r--tests/auto/qdoc/generatedoutput/TestCPP1
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testcpp-module.html42
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html19
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html54
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html61
-rw-r--r--tests/auto/qdoc/generatedoutput/testcpp.cpp73
-rw-r--r--tests/auto/qdoc/generatedoutput/testcpp.h39
-rw-r--r--tests/auto/qdoc/generatedoutput/testcpp.qdocconf7
-rw-r--r--tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp114
21 files changed, 369 insertions, 72 deletions
diff --git a/src/assistant/assistant/doc/images/assistant-assistant.png b/src/assistant/assistant/doc/images/assistant-assistant.png
index d76ec0420..368b5c932 100644
--- a/src/assistant/assistant/doc/images/assistant-assistant.png
+++ b/src/assistant/assistant/doc/images/assistant-assistant.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-bookmarks.png b/src/assistant/assistant/doc/images/assistant-bookmarks.png
index 810d23960..9acdb8300 100644
--- a/src/assistant/assistant/doc/images/assistant-bookmarks.png
+++ b/src/assistant/assistant/doc/images/assistant-bookmarks.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-dockwidgets.png b/src/assistant/assistant/doc/images/assistant-dockwidgets.png
index 7a9c386a6..c657426e9 100644
--- a/src/assistant/assistant/doc/images/assistant-dockwidgets.png
+++ b/src/assistant/assistant/doc/images/assistant-dockwidgets.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-index.png b/src/assistant/assistant/doc/images/assistant-index.png
index 548c349e5..685396c97 100644
--- a/src/assistant/assistant/doc/images/assistant-index.png
+++ b/src/assistant/assistant/doc/images/assistant-index.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-preferences-documentation.png b/src/assistant/assistant/doc/images/assistant-preferences-documentation.png
index e640176ac..92e8e0568 100644
--- a/src/assistant/assistant/doc/images/assistant-preferences-documentation.png
+++ b/src/assistant/assistant/doc/images/assistant-preferences-documentation.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-preferences-filters.png b/src/assistant/assistant/doc/images/assistant-preferences-filters.png
index 3af283085..cdeda5c3d 100644
--- a/src/assistant/assistant/doc/images/assistant-preferences-filters.png
+++ b/src/assistant/assistant/doc/images/assistant-preferences-filters.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-preferences-fonts.png b/src/assistant/assistant/doc/images/assistant-preferences-fonts.png
index 4d9375917..a3879ec89 100644
--- a/src/assistant/assistant/doc/images/assistant-preferences-fonts.png
+++ b/src/assistant/assistant/doc/images/assistant-preferences-fonts.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-preferences-options.png b/src/assistant/assistant/doc/images/assistant-preferences-options.png
index 3a9efad6a..38233b7cf 100644
--- a/src/assistant/assistant/doc/images/assistant-preferences-options.png
+++ b/src/assistant/assistant/doc/images/assistant-preferences-options.png
Binary files differ
diff --git a/src/assistant/assistant/doc/images/assistant-search.png b/src/assistant/assistant/doc/images/assistant-search.png
index 3ab3caf9d..847af8ba2 100644
--- a/src/assistant/assistant/doc/images/assistant-search.png
+++ b/src/assistant/assistant/doc/images/assistant-search.png
Binary files differ
diff --git a/src/assistant/assistant/doc/src/assistant-quick-guide.qdoc b/src/assistant/assistant/doc/src/assistant-quick-guide.qdoc
index 28590fa25..411bf19e1 100644
--- a/src/assistant/assistant/doc/src/assistant-quick-guide.qdoc
+++ b/src/assistant/assistant/doc/src/assistant-quick-guide.qdoc
@@ -169,8 +169,12 @@
\QA provides a powerful full text search engine. You can search for certain
words or text in the \gui Search window. Enter the text you want to look for
and press \key{Enter} or click \gui{Search}. The search is not case sensitive.
- For example, \b Foo, \b fOo and \b FOO are all treated as the same. The
- following are examples of common search patterns:
+ For example, \b Foo, \b fOo and \b FOO are all treated as the same.
+
+ You can create complex queries using the
+ \l{https://sqlite.org/fts5.html#full_text_query_syntax}{FTS query syntax}.
+
+ The following are examples of common search patterns:
\list
\li \c deep -- lists all the documents that contain the word \b deep
@@ -182,19 +186,6 @@
\b {deep copy}
\endlist
- Use the \gui{Advanced search} for more flexibility.
- You can specify some words so that hits containing these are excluded from the
- result, or you can search for an exact phrase. Searching for similar words will
- give results like these:
-
- \list
- \li \c{QStin} -- lists all the documents with titles that are similar, such as \c{QString}
- \li \c{QSting} -- lists all the documents with titles that are similar, such as \c{QString}
- \li \c{QStrin} -- lists all the documents with titles that are similar, such as \c{QString}
- \endlist
-
- Options can be combined to improve the search results.
-
The list of documents found is ordered according to the number of
occurrences of the search text which they contain, with those containing
the highest number of occurrences appearing first. Simply click any
diff --git a/src/designer/src/lib/sdk/abstractwidgetbox.h b/src/designer/src/lib/sdk/abstractwidgetbox.h
index 7d7600e5b..06de2016c 100644
--- a/src/designer/src/lib/sdk/abstractwidgetbox.h
+++ b/src/designer/src/lib/sdk/abstractwidgetbox.h
@@ -71,6 +71,10 @@ public:
QSharedDataPointer<QDesignerWidgetBoxWidgetData> m_data;
};
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ using WidgetList = QList<Widget>;
+#endif
+
class Category {
public:
enum Type { Default, Scratchpad };
diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp
index 00fa4fbc4..a4cededce 100644
--- a/src/windeployqt/main.cpp
+++ b/src/windeployqt/main.cpp
@@ -1494,8 +1494,10 @@ static DeployResult deploy(const Options &options,
const QString qt5CoreName = QFileInfo(libraryPath(libraryLocation, "Qt5Core", qtLibInfix,
options.platform, isDebug)).fileName();
- if (!patchQtCore(targetPath + QLatin1Char('/') + qt5CoreName, errorMessage))
- return result;
+ if (!patchQtCore(targetPath + QLatin1Char('/') + qt5CoreName, errorMessage)) {
+ std::wcerr << "Warning: " << *errorMessage << '\n';
+ errorMessage->clear();
+ }
}
} // optLibraries
diff --git a/tests/auto/qdoc/generatedoutput/TestCPP b/tests/auto/qdoc/generatedoutput/TestCPP
new file mode 100644
index 000000000..50cce69ff
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/TestCPP
@@ -0,0 +1 @@
+#include "testcpp.h"
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp-module.html b/tests/auto/qdoc/generatedoutput/expected_output/testcpp-module.html
new file mode 100644
index 000000000..92103d867
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp-module.html
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- testcpp.cpp -->
+ <title>QDoc Test C++ Classes | TestCPP</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#namespaces">Namespaces</a></li>
+<li class="level1"><a href="#classes">Classes</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">QDoc Test C++ Classes</h1>
+<span class="subtitle"></span>
+<!-- $$$TestCPP-brief -->
+<p>A test module page. <a href="#details">More...</a></p>
+<!-- @@@TestCPP -->
+<a name="namespaces"></a>
+<h2 id="namespaces">Namespaces</h2>
+<div class="table"><table class="annotated">
+<tr class="odd topAlign"><td class="tblName"><p><a href="testqdoc.html">TestQDoc</a></p></td><td class="tblDescr"><p>A namespace</p></td></tr>
+</table></div>
+<a name="classes"></a>
+<h2 id="classes">Classes</h2>
+<div class="table"><table class="annotated">
+<tr class="odd topAlign"><td class="tblName"><p><a href="testqdoc-test.html">TestQDoc::Test</a></p></td><td class="tblDescr"><p>A class in a namespace</p></td></tr>
+</table></div>
+<!-- $$$TestCPP-description -->
+<a name="details"></a>
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+</div>
+<!-- @@@TestCPP -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html
new file mode 100644
index 000000000..caa002a7d
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-members.html
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- testcpp.cpp -->
+ <title>List of All Members for Test | TestCPP</title>
+</head>
+<body>
+<li>Test</li>
+<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">List of All Members for Test</h1>
+<p>This is the complete list of members for <a href="testqdoc-test.html">TestQDoc::Test</a>, including inherited members.</p>
+<ul>
+<li class="fn"><span class="name"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b></span>()</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b></span>(int ) : int</li>
+</ul>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html
new file mode 100644
index 000000000..f0ef69491
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- testcpp.cpp -->
+ <title>Test Class | TestCPP</title>
+</head>
+<body>
+<li>Test</li>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#public-functions">Public Functions</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Test Class</h1>
+<span class="small-subtitle">(<a href="testqdoc-test.html">TestQDoc::Test</a>)<br/></span>
+<!-- $$$Test-brief -->
+<p>A class in a namespace. <a href="#details">More...</a></p>
+<!-- @@@Test -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include &lt;Test&gt;</span>
+</td></tr></table></div><ul>
+<li><a href="testqdoc-test-members.html">List of all members, including inherited members</a></li>
+</ul>
+<a name="public-functions"></a>
+<h2 id="public-functions">Public Functions</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#inlineFunction">inlineFunction</a></b>()</td></tr>
+<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html#someFunction">someFunction</a></b>(int <i>v</i>)</td></tr>
+</table></div>
+<a name="details"></a>
+<!-- $$$Test-description -->
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+</div>
+<!-- @@@Test -->
+<div class="func">
+<h2>Member Function Documentation</h2>
+<!-- $$$inlineFunction[overload1]$$$inlineFunction -->
+<h3 class="fn" id="inlineFunction"><a name="inlineFunction"></a><span class="type">void</span> Test::<span class="name">inlineFunction</span>()</h3>
+<p>An inline function, documented using the \fn QDoc command.</p>
+<!-- @@@inlineFunction -->
+<!-- $$$someFunction[overload1]$$$someFunctionint -->
+<h3 class="fn" id="someFunction"><a name="someFunction"></a><span class="type">int</span> Test::<span class="name">someFunction</span>(<span class="type">int</span> <i>v</i>)</h3>
+<p>Function that takes a parameter <i>v</i>. Also returns the value of <i>v</i>.</p>
+<!-- @@@someFunction -->
+</div>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html
new file mode 100644
index 000000000..d46a4f5c8
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc.html
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<!-- testcpp.cpp -->
+ <title>TestQDoc Namespace | TestCPP</title>
+</head>
+<body>
+<div class="sidebar">
+<div class="toc">
+<h3><a name="toc">Contents</a></h3>
+<ul>
+<li class="level1"><a href="#classes">Classes</a></li>
+<li class="level1"><a href="#macros">Macros</a></li>
+<li class="level1"><a href="#details">Detailed Description</a></li>
+<li class="level2"><a href="#usage">Usage</a></li>
+</ul>
+</div>
+<div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">TestQDoc Namespace</h1>
+<!-- $$$TestQDoc-brief -->
+<p>A namespace. <a href="#details">More...</a></p>
+<!-- @@@TestQDoc -->
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include &lt;TestQDoc&gt;</span>
+</td></tr></table></div><ul>
+</ul>
+<a name="classes"></a>
+<h2 id="classes">Classes</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test.html">Test</a></b></td></tr>
+</table></div>
+<a name="macros"></a>
+<h2 id="macros">Macros</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="testqdoc.html#QDOCTEST_MACRO">QDOCTEST_MACRO</a></b></td></tr>
+</table></div>
+<a name="details"></a>
+<!-- $$$TestQDoc-description -->
+<div class="descr">
+<h2 id="details">Detailed Description</h2>
+<a name="usage"></a>
+<h3 id="usage">Usage</h3>
+<p>This namespace is for testing QDoc output.</p>
+</div>
+<!-- @@@TestQDoc -->
+<div class="classes">
+<h2>Classes</h2>
+<h3> class <a href="testqdoc-test.html">Test</a></h3><!-- $$$Test-brief -->
+<p>A class in a namespace. <a href="testqdoc-test.html#details">More...</a></p>
+<!-- @@@Test -->
+</div>
+<div class="macros">
+<h2>Macro Documentation</h2>
+<!-- $$$QDOCTEST_MACRO[overload1]$$$QDOCTEST_MACRO -->
+<h3 class="fn" id="QDOCTEST_MACRO"><a name="QDOCTEST_MACRO"></a>TestQDoc::<span class="name">QDOCTEST_MACRO</span></h3>
+<!-- @@@QDOCTEST_MACRO -->
+</div>
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testcpp.cpp
new file mode 100644
index 000000000..12698c9d6
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testcpp.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "testcpp.h"
+
+namespace TestQDoc {
+
+/*!
+ \module TestCPP
+ \title QDoc Test C++ Classes
+ \brief A test module page.
+*/
+
+/*!
+ \namespace TestQDoc
+ \inmodule TestCPP
+ \brief A namespace.
+
+ \section1 Usage
+ This namespace is for testing QDoc output.
+*/
+
+/*!
+ \class TestQDoc::Test
+ \inmodule TestCPP
+ \brief A class in a namespace.
+*/
+
+/*!
+ \macro QDOCTEST_MACRO
+ \relates TestQDoc
+*/
+
+/*!
+ Function that takes a parameter \a v.
+ Also returns the value of \a v.
+*/
+int Test::someFunction(int v)
+{
+ return v;
+}
+
+/*!
+ \fn void TestQDoc::Test::inlineFunction()
+
+ \brief An inline function, documented using the \CMDFN QDoc command.
+*/
+
+} // namespace TestQDoc
diff --git a/tests/auto/qdoc/generatedoutput/testcpp.h b/tests/auto/qdoc/generatedoutput/testcpp.h
new file mode 100644
index 000000000..46355711c
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testcpp.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#pragma once
+#define QDOCTEST_MACRO test
+
+namespace TestQDoc {
+
+class Test {
+public:
+ int someFunction(int v);
+ inline void inlineFunction() {};
+};
+
+} // namespace TestQDoc
diff --git a/tests/auto/qdoc/generatedoutput/testcpp.qdocconf b/tests/auto/qdoc/generatedoutput/testcpp.qdocconf
new file mode 100644
index 000000000..70c226cf2
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testcpp.qdocconf
@@ -0,0 +1,7 @@
+project = TestCPP
+includepaths += -I.
+
+headers = testcpp.h
+sources = testcpp.cpp
+
+macro.CMDFN = \\\\fn
diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
index ab7c91040..103198d42 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -38,14 +38,18 @@ private slots:
void init();
void htmlFromQDocFile();
+ void htmlFromCpp();
void htmlFromQml();
private:
QScopedPointer<QTemporaryDir> m_outputDir;
QString m_qdoc;
- bool runQDocProcess(const QStringList &arguments);
- void compareLineByLine(QString &expectedFilename, QString &actualFilename);
+ void runQDocProcess(const QStringList &arguments);
+ void compareLineByLine(const QStringList &expectedFiles);
+ void testAndCompare(const char *input,
+ const char *outNames,
+ const char *extraParams = nullptr);
};
void tst_generatedOutput::initTestCase()
@@ -66,7 +70,7 @@ void tst_generatedOutput::init()
}
}
-bool tst_generatedOutput::runQDocProcess(const QStringList &arguments)
+void tst_generatedOutput::runQDocProcess(const QStringList &arguments)
{
QProcess qdocProcess;
qdocProcess.setProgram(m_qdoc);
@@ -75,7 +79,7 @@ bool tst_generatedOutput::runQDocProcess(const QStringList &arguments)
qdocProcess.waitForFinished();
if (qdocProcess.exitCode() == 0)
- return true;
+ return;
QString output = qdocProcess.readAllStandardOutput();
QString errors = qdocProcess.readAllStandardError();
@@ -85,70 +89,70 @@ bool tst_generatedOutput::runQDocProcess(const QStringList &arguments)
qInfo() << "Received output:\n" << output;
if (errors.size() > 0)
qInfo() << "Received errors:\n" << errors;
- return false;
+
+ QFAIL("Running QDoc failed. See output above.");
}
-void tst_generatedOutput::compareLineByLine(QString &expected, QString &actual)
+void tst_generatedOutput::compareLineByLine(const QStringList &expectedFiles)
{
- QFile expectedFile(expected);
- if (!expectedFile.open(QIODevice::ReadOnly))
- QFAIL("Cannot open expected data file!");
- QTextStream expectedIn(&expectedFile);
-
- QFile actualFile(actual);
- if (!actualFile.open(QIODevice::ReadOnly))
- QFAIL("Cannot open actual data file!");
- QTextStream actualIn(&actualFile);
-
- int lineNumber = 0;
- while (!expectedIn.atEnd() && !actualIn.atEnd()) {
- lineNumber++;
- QString prefix = QString::number(lineNumber) + QLatin1String(": ");
- QString expectedLine = prefix + expectedIn.readLine();
- QString actualLine = prefix + actualIn.readLine();
- QCOMPARE(actualLine, expectedLine);
+ for (const auto &file : expectedFiles) {
+ QString expected(QFINDTESTDATA("/expected_output/" + file));
+ QString actual(m_outputDir->path() + "/" + file);
+
+ QFile expectedFile(expected);
+ if (!expectedFile.open(QIODevice::ReadOnly))
+ QFAIL("Cannot open expected data file!");
+ QTextStream expectedIn(&expectedFile);
+
+ QFile actualFile(actual);
+ if (!actualFile.open(QIODevice::ReadOnly))
+ QFAIL("Cannot open actual data file!");
+ QTextStream actualIn(&actualFile);
+
+ int lineNumber = 0;
+ while (!expectedIn.atEnd() && !actualIn.atEnd()) {
+ lineNumber++;
+ QString prefix = QString::number(lineNumber) + QLatin1String(": ");
+ QString expectedLine = prefix + expectedIn.readLine();
+ QString actualLine = prefix + actualIn.readLine();
+ QCOMPARE(actualLine, expectedLine);
+ }
}
}
-void tst_generatedOutput::htmlFromQDocFile()
+void tst_generatedOutput::testAndCompare(const char *input,
+ const char *outNames,
+ const char *extraParams)
{
- const QStringList arguments = {
- "--outputdir",
- m_outputDir->path(),
- QFINDTESTDATA("test.qdocconf")
- };
-
- if (!runQDocProcess(arguments))
- QFAIL("Running QDoc failed. See output above.");
+ QStringList args{ "-outputdir", m_outputDir->path(), QFINDTESTDATA(input) };
+ if (extraParams)
+ args << QString(QLatin1String(extraParams)).split(QChar(' '));
+ runQDocProcess(args);
+ if (QTest::currentTestFailed())
+ return;
+ compareLineByLine(QString(QLatin1String(outNames)).split(QChar(' ')));
+}
- QString expectedFile = QFINDTESTDATA("/expected_output/qdoctests-qdocfileoutput.html");
- QString actualFile = m_outputDir->path() + QLatin1String("/qdoctests-qdocfileoutput.html");
+void tst_generatedOutput::htmlFromQDocFile()
+{
+ testAndCompare("test.qdocconf",
+ "qdoctests-qdocfileoutput.html");
+}
- compareLineByLine(expectedFile, actualFile);
+void tst_generatedOutput::htmlFromCpp()
+{
+ testAndCompare("testcpp.qdocconf",
+ "testcpp-module.html "
+ "testqdoc-test.html "
+ "testqdoc-test-members.html "
+ "testqdoc.html");
}
void tst_generatedOutput::htmlFromQml()
{
- const QStringList arguments = {
- "--outputdir",
- m_outputDir->path(),
- QFINDTESTDATA("testqml.qdocconf")
- };
-
- if (!runQDocProcess(arguments))
- QFAIL("Running QDoc failed. See output above.");
-
- const QStringList files{
- "test-componentset-example.html",
- "uicomponents-qmlmodule.html"};
-
- for (const auto &file : files) {
- QString expectedPath = "/expected_output/" + file;
- QString expectedFile(QFINDTESTDATA(expectedPath));
- QString actualFile(m_outputDir->path() + "/" + file);
-
- compareLineByLine(expectedFile, actualFile);
- }
+ testAndCompare("testqml.qdocconf",
+ "test-componentset-example.html "
+ "uicomponents-qmlmodule.html");
}
QTEST_APPLESS_MAIN(tst_generatedOutput)