From 9d5d92a49256af65a85fa69b58e6744c2722321b Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Tue, 3 Mar 2020 15:10:31 +0200 Subject: Add changes file for Qt 5.14.2 + 447f33743c3e07d645831f07b821ad76a203fd6f QDoc: Let configure accept libclang built from git sources + b693122a4e08e5745d1b288ef7e1525b085c1ebd qdoc: Fix regression in QML types inheriting property groups + 4f8bb92f9654efd6cc5dc7c6b08979fe3106b3ea qdoc: Sort the members of shared comment node collective + 5eae325fcb4140155fe97ee0dff6101e4a2db444 QMake: fix GCC 9 -Wdeprecated-copy warnings + cd50765264adac52dc7ace48b0f339c0b13f76fc qdoc: Allow per-example override of install path + 653884ab6988ea72fc0d5cc21675efcef67d0455 qdoc: Override isObsolete() for a FunctionNode + 01dbe9a348f09cfefc927d1de96d82afbd09f995 qdoc: Do not sort nodes based on their address + 1639c9a80490fc56c2bb1438dfa0d84455be55ed QDoc: Move logging to helper method + a3d82bec9678fda3d8c8b7766e83267142d1ef4a Bump version + cd352d921fc2f523f8d83d387d51390305e71d89 Doc: Remove references to 4.x in QDoc manual + 559332dc3efa507baaaba4ea8288bdb2318bc73d qdoc: Fix regression in linking to QML properties in offline docs + 26daab2554a55243a0cb6744346e1cfb27cfc3a9 QDoc: Remove Location::null + c555d3493f52c378707a40d824d70f369e0b4db9 qdoc: Extend \include command to include exampledirs + 698ffa215fd3fd7b8dd67ed9be88ca1a6731df91 windeployqt: Use correct file name for ANGLE + ce895f066579f71d87c3b46361e291ad7734e88e QDoc: Fix handling of -F option Change-Id: I9704f2e8778288bd01915cd2fd4a4ace93285496 Reviewed-by: Friedemann Kleint --- dist/changes-5.14.2 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 dist/changes-5.14.2 diff --git a/dist/changes-5.14.2 b/dist/changes-5.14.2 new file mode 100644 index 000000000..f90f45318 --- /dev/null +++ b/dist/changes-5.14.2 @@ -0,0 +1,24 @@ +Qt 5.14.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.14.0 through 5.14.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.14 series is binary compatible with the 5.13.x series. +Applications compiled for 5.13 will continue to run with 5.14. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* qdoc * +**************************************************************************** + + - [QTBUG-82252] Fixed "-F" option on macOS -- cgit v1.2.3 From 676b08f947098a3dd3d417a38631567157c4e757 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 15 Apr 2020 06:33:10 +0200 Subject: Doc: Add note about the llvm installer on Windows Note that one has to restart their build shell after installing llvm with the pre-built installer on Windows. Task-number: QTBUG-83429 Change-Id: Ife15ba8179bb53930315f597f05c09bd1a12cbeb Reviewed-by: Leena Miettinen --- src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc index 201706b70..07082fa31 100644 --- a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc +++ b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc @@ -637,6 +637,10 @@ install the \c libclang-dev package and its dependencies. For running QDoc, the \c libclang package is required. + \note On Windows, after installing the pre-built LLVM you must restart your + build shell to ensure that LLVM's binary directory is added to the PATH + variable. This is needed to be able to run qdoc. + \section1 Set Clang location automatically The Qt build system uses the tool \c llvm-config to discover the location -- cgit v1.2.3 From 11459960cdee71a325c7373992adde8fed1db86a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 16 Apr 2020 09:20:39 +0200 Subject: Parse the otool line when it has ", weak" as part of the it With Xcode 11.4, in some cases it will have ", weak" as part of the framework description when running otool. Therefore we need to account for this so it still sees it as a valid entry. Cherry-picked from branch: dev Change-Id: I4018d42aa54f4e6434ee6defa119f3c913893819 Reviewed-by: cherrypickbot --- src/macdeployqt/shared/shared.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index 607dce880..a81a2f0d9 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -183,7 +183,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath) static const QRegularExpression regexp(QStringLiteral( "^\\t(.+) \\(compatibility version (\\d+\\.\\d+\\.\\d+), " - "current version (\\d+\\.\\d+\\.\\d+)\\)$")); + "current version (\\d+\\.\\d+\\.\\d+)(, weak)?\\)$")); QString output = otool.readAllStandardOutput(); QStringList outputLines = output.split("\n", Qt::SkipEmptyParts); -- cgit v1.2.3 From d690a99b99ce68cee6bde71e12a3fc6190812f3f Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 7 Apr 2020 12:21:32 +0200 Subject: qdoc: Remove defunct code for 'edition' qdocconf variable There was some old code and documentation for this variable, but using it had no effect on the output. Similarly, the \generatelist command no longer recognized the edition-specific parameter. Fixes: QTBUG-83367 Change-Id: I42a1e67855ffd781e326e9d89cec0dde51cb14d0 Reviewed-by: Paul Wicking --- src/qdoc/config.cpp | 1 - src/qdoc/config.h | 2 -- src/qdoc/doc/qdoc-manual-qdocconf.qdoc | 36 ++-------------------------------- src/qdoc/generator.h | 2 -- src/qdoc/htmlgenerator.cpp | 13 ------------ 5 files changed, 2 insertions(+), 52 deletions(-) diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp index 1387fb411..9ff22c8b1 100644 --- a/src/qdoc/config.cpp +++ b/src/qdoc/config.cpp @@ -57,7 +57,6 @@ QString ConfigStrings::DEFINES = QStringLiteral("defines"); QString ConfigStrings::DEPENDS = QStringLiteral("depends"); QString ConfigStrings::DESCRIPTION = QStringLiteral("description"); QString ConfigStrings::DOCBOOKEXTENSIONS = QStringLiteral("usedocbookextensions"); -QString ConfigStrings::EDITION = QStringLiteral("edition"); QString ConfigStrings::ENDHEADER = QStringLiteral("endheader"); QString ConfigStrings::EXAMPLEDIRS = QStringLiteral("exampledirs"); QString ConfigStrings::EXAMPLES = QStringLiteral("examples"); diff --git a/src/qdoc/config.h b/src/qdoc/config.h index f8823d521..933aad543 100644 --- a/src/qdoc/config.h +++ b/src/qdoc/config.h @@ -228,7 +228,6 @@ struct ConfigStrings static QString DEPENDS; static QString DESCRIPTION; static QString DOCBOOKEXTENSIONS; - static QString EDITION; static QString ENDHEADER; static QString EXAMPLEDIRS; static QString EXAMPLES; @@ -315,7 +314,6 @@ struct ConfigStrings #define CONFIG_DEPENDS ConfigStrings::DEPENDS #define CONFIG_DESCRIPTION ConfigStrings::DESCRIPTION #define CONFIG_DOCBOOKEXTENSIONS ConfigStrings::DOCBOOKEXTENSIONS -#define CONFIG_EDITION ConfigStrings::EDITION #define CONFIG_ENDHEADER ConfigStrings::ENDHEADER #define CONFIG_EXAMPLEDIRS ConfigStrings::EXAMPLEDIRS #define CONFIG_EXAMPLES ConfigStrings::EXAMPLES diff --git a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc index 6d26de344..5f43a1d41 100644 --- a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc +++ b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc @@ -91,7 +91,6 @@ \li \l {Cpp.ignoretokens-variable} {Cpp.ignoretokens} \li \l {defines-variable} {defines} \li \l {depends-variable} {depends} - \li \l {edition-variable} {edition} \li \l {exampledirs-variable} {exampledirs} \li \l {examples-variable} {examples} \li \l {examples.fileextensions-variable} {examples.fileextensions} @@ -244,10 +243,10 @@ line using the -D option. For example: \badcode - currentdirectory$ qdoc -Dconsoleedition qtgui.qdocconf + currentdirectory$ qdoc -Dqtforpython qtgui.qdocconf \endcode - In this case the -D option ensures that the \c consoleedition + In this case the -D option ensures that the \c qtforpython preprocessor symbol is defined when QDoc processes the source files defined in the qtgui.qdocconf file. @@ -305,37 +304,6 @@ See also \l indexes, \l project, and \l url. - \target edition-variable - \section1 edition - - The \c edition variable specifies which modules are included in - each edition of a package, and provides QDoc with information to - provide class lists for each edition. - - This feature is mostly used when providing documentation for Qt - packages. - - The \c edition variable is always used with a particular edition - name to define the modules for that edition: - - \badcode - edition.Console = QtCore QtNetwork QtSql QtXml - edition.Desktop = QtCore QtGui QtNetwork QtOpenGL QtSql QtXml \ - QtDesigner QtAssistant Qt3Support QAxContainer \ - QAxServer - edition.DesktopLight = QtCore QtGui Qt3SupportLight - \endcode - - In the above examples, the \c Console edition only includes the - contents of four modules. Only the classes from these modules will - be used when the \l{Miscellaneous#generatelist-command} - {generatelist} command is used to generate a list of classes for - this edition: - - \badcode - \generatelist{classesbyedition Console} - \endcode - \target exampledirs-variable \section1 exampledirs diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h index f12aff933..dca915ba7 100644 --- a/src/qdoc/generator.h +++ b/src/qdoc/generator.h @@ -159,8 +159,6 @@ protected: static bool hasExceptions(const Node *node, NodeList &reentrant, NodeList &threadsafe, NodeList &nonreentrant); - QMap editionGroupMap; - QMap editionModuleMap; QString naturalLanguage; #ifndef QT_NO_TEXTCODEC QTextCodec *outputCodec; diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 104d97bc2..a1a1cd876 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -185,19 +185,6 @@ void HtmlGenerator::initializeGenerator() if (naturalLanguage.isEmpty()) naturalLanguage = QLatin1String("en"); - const QSet editionNames = config->subVars(CONFIG_EDITION); - for (const auto &editionName : editionNames) { - QStringList editionModules = config->getStringList(CONFIG_EDITION + Config::dot - + editionName + Config::dot + "modules"); - QStringList editionGroups = config->getStringList(CONFIG_EDITION + Config::dot + editionName - + Config::dot + "groups"); - - if (!editionModules.isEmpty()) - editionModuleMap[editionName] = editionModules; - if (!editionGroups.isEmpty()) - editionGroupMap[editionName] = editionGroups; - } - codeIndent = config->getInt(CONFIG_CODEINDENT); // QTBUG-27798 codePrefix = config->getString(CONFIG_CODEPREFIX); codeSuffix = config->getString(CONFIG_CODESUFFIX); -- cgit v1.2.3 From 0214ec3e091f69bd9b8ebeed2bc9a6cd88882059 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 15 Apr 2020 13:08:34 +0200 Subject: Doc: QDoc Manual: Refer to the tool as 'QDoc' consistently And add 'QDoc' as a word ignored for auto-linking. Change-Id: I16a33b8448e8bfa340f4c62149f702fea13d5533 Reviewed-by: Leena Miettinen Reviewed-by: Paul Wicking --- src/qdoc/doc/config/qdoc.qdocconf | 2 ++ src/qdoc/doc/examples/samples.qdocinc | 4 +-- src/qdoc/doc/qa-pages.qdoc | 12 ++++----- src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc | 10 +++---- src/qdoc/doc/qdoc-manual-intro.qdoc | 4 +-- src/qdoc/doc/qdoc-manual-markupcmds.qdoc | 46 ++++++++++++++++---------------- src/qdoc/doc/qdoc-manual-qdocconf.qdoc | 18 ++++++------- src/qdoc/doc/qdoc-manual-topiccmds.qdoc | 2 +- src/qdoc/doc/qtgui-qdocconf.qdoc | 2 +- 9 files changed, 51 insertions(+), 49 deletions(-) diff --git a/src/qdoc/doc/config/qdoc.qdocconf b/src/qdoc/doc/config/qdoc.qdocconf index f29b20aaf..a850d3eb6 100644 --- a/src/qdoc/doc/config/qdoc.qdocconf +++ b/src/qdoc/doc/config/qdoc.qdocconf @@ -65,4 +65,6 @@ depends += \ qtwidgets \ qtxml +ignorewords += QDoc + navigation.landingpage = "QDoc Manual" diff --git a/src/qdoc/doc/examples/samples.qdocinc b/src/qdoc/doc/examples/samples.qdocinc index afe634326..1b83428b2 100644 --- a/src/qdoc/doc/examples/samples.qdocinc +++ b/src/qdoc/doc/examples/samples.qdocinc @@ -62,10 +62,10 @@ \page generic-guide.html \title Generic QDoc Guide \nextpage Creating QDoc Configuration Files - There are three essential materials for generating documentation with qdoc: + There are three essential materials for generating documentation with QDoc: \list - \li \c qdoc binary + \li \c QDoc binary (\c {qdoc}) \li \c qdocconf configuration files \li \c Documentation in \c C++, \c QML, and \c .qdoc files \endlist diff --git a/src/qdoc/doc/qa-pages.qdoc b/src/qdoc/doc/qa-pages.qdoc index 1e3ca19f4..47f57eb38 100644 --- a/src/qdoc/doc/qa-pages.qdoc +++ b/src/qdoc/doc/qa-pages.qdoc @@ -32,14 +32,14 @@ \title QA Pages - qdoc can generate some extra HTML pages that can be useful for - debugging qdoc documentation. These \e QA pages make it easier for + QDoc can generate some extra HTML pages that can be useful for + debugging QDoc documentation. These \e QA pages make it easier for those who write documentation to find links that either go to the wrong targets or don't go anywhere at all. \section2 Generating the QA Pages - Add \c {-write-qa-pages} to the command line to tell qdoc to + Add \c {-write-qa-pages} to the command line to tell QDoc to generate the QA pages. If this option is not provided, the QA pages will not be generated, and previolusly generated QA pages will be deleted. @@ -49,7 +49,7 @@ The main QA page for a module is not linked into the module's generated documentation, but it is located in the same output directory. To find the top-level QA page for module \e {xxx}, set - your browser to the qdoc output directory for module \e {xxx}. + your browser to the QDoc output directory for module \e {xxx}. Several files whose names begin with \e {aaa} appear at the top of the list. These are the QA pages for module \e{xxx}. The file names begin with \e {aaa} to ensure that they are easy to find at @@ -83,11 +83,11 @@ QtCore to QtQuick. The first column of each table entry contains a link to some link in QtCore. The link text as it appears in QtCore is shown. The second and third columns contain the source - file name and line number for where qdoc saw the link in a qdoc + file name and line number for where QDoc saw the link in a qdoc comment. \note The line number will normally refer to the first line of the - comment where qdoc saw the link. + comment where QDoc saw the link. Clicking on a link in the table takes you to that link in the documentation. There the link will be marked with three red diff --git a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc index c964493bc..abd2661d8 100644 --- a/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc +++ b/src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc @@ -37,7 +37,7 @@ \l{writing-markup}{mark up} to enhance the layout and formatting of the final output. - There are three essential materials for generating documentation with qdoc: + There are three essential materials for generating documentation with QDoc: \list \li \c QDoc binary \li \c qdocconf configuration files @@ -95,12 +95,12 @@ can style the documentation in DITA at a later time. DITA XML is therefore more flexible in allowing different styles to apply to the same information. - To run qdoc, the project configuration file is supplied as an argument. + To run QDoc, the project configuration file is supplied as an argument. \code qdoc project.qdocconf \endcode - The project configuration contains information that qdoc uses to create the + The project configuration contains information that QDoc uses to create the documentation. \section2 Project Information @@ -267,7 +267,7 @@ comment; the comment itself and anything after it, until a newline, is omitted from the generated output. - QDoc will parse C++ and QML files to look for qdoc comments. To explicitly + QDoc will parse C++ and QML files to look for QDoc comments. To explicitly omit a certain file type, omit it from the \l{Input and Output Directories}{configuration} file. @@ -280,7 +280,7 @@ \target writing-topic-commands \section2 QDoc Topics - Each qdoc comment must have a \e topic type. A topic distinguishes it from + Each QDoc comment must have a \e topic type. A topic distinguishes it from other topics. To specify a topic type, use one of the several \l{Topic Commands}{topic commands}. diff --git a/src/qdoc/doc/qdoc-manual-intro.qdoc b/src/qdoc/doc/qdoc-manual-intro.qdoc index a943863a6..525445b4f 100644 --- a/src/qdoc/doc/qdoc-manual-intro.qdoc +++ b/src/qdoc/doc/qdoc-manual-intro.qdoc @@ -88,7 +88,7 @@ \section1 Running QDoc - The name of the QDoc program is \c {qdoc}. To run qdoc from the + The name of the QDoc program is \c {qdoc}. To run QDoc from the command line, give it the name of a configuration file: \quotation @@ -284,7 +284,7 @@ For each QDoc comment it finds, it searches the master tree for the item where the documentation belongs. Then it interprets the - qdoc commands in the comment and stores the interpreted commands + QDoc commands in the comment and stores the interpreted commands and the comment text in the tree node for the item. Finally, QDoc traverses the master tree. For each node, if the diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc index 6fc16c9e1..69d10fb9a 100644 --- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc @@ -206,9 +206,9 @@ text (which may include other QDoc commands) to which special formatting attributes should be applied. - An argument must be provided in curly braces, as in the qdoc + An argument must be provided in curly braces, as in the QDoc comment shown below. The argument is not interpreted but is used - as attribute(s) of the tag that is output by qdoc. + as attribute(s) of the tag that is output by QDoc. For example, we might want to render an inline image so that it floats to the right of the current block of text: @@ -222,7 +222,7 @@ * / \endcode - If qdoc is generating HTML, it will translate these commands to: + If QDoc is generating HTML, it will translate these commands to: \code

@@ -1699,7 +1699,7 @@ ... \endcode - By default, qdoc looks for \c{//!} as a code snippet marker. + By default, QDoc looks for \c{//!} as a code snippet marker. For \c{.pro}, \c{.py}, \c{.cmake}, and \c{CMakeLists.txt} files, \c {#!} is detected. Finally, \c{ -

int Test::someFunction(int v)

+

int Test::someFunction(int v = 0)

Function that takes a parameter v. Also returns the value of v.

This function was introduced in Test 1.0.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html index 3fc1f2bc7..864205274 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html @@ -40,7 +40,7 @@

Public Functions

- +
void inlineFunction()
int someFunction(int v)
int someFunction(int v = 0)
void someFunctionDefaultArg(int i, bool b = false)
virtual void virtualFun()
@@ -85,7 +85,7 @@

An inline function, documented using the \fn QDoc command.

-

int Test::someFunction(int v)

+

int Test::someFunction(int v = 0)

Function that takes a parameter v. Also returns the value of v.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html index 4ec52916a..75643dede 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html @@ -34,7 +34,7 @@

Public Functions

- +
void inlineFunction()
int someFunction(int v)
int someFunction(int v = 0)
void someFunctionDefaultArg(int i, bool b = false)
virtual void virtualFun()
@@ -73,7 +73,7 @@

An inline function, documented using the \fn QDoc command.

-

int Test::someFunction(int v)

+

int Test::someFunction(int v = 0)

Function that takes a parameter v. Also returns the value of v.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index index ae997fa52..ae3b4a875 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index +++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index @@ -22,7 +22,7 @@ - + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html index 84c0c4fe3..49066d0e6 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html @@ -34,7 +34,7 @@

Public Functions

- +
void inlineFunction()
int someFunction(int v)
int someFunction(int v = 0)
void someFunctionDefaultArg(int i, bool b = false)
virtual void virtualFun()
@@ -68,7 +68,7 @@

An inline function, documented using the \fn QDoc command.

-

int Test::someFunction(int v)

+

int Test::someFunction(int v = 0)

Function that takes a parameter v. Also returns the value of v.

diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp index 17045eed5..31b910fae 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp @@ -124,13 +124,7 @@ void Test::someFunctionDefaultArg(int i, bool b = false) return; } -/*! - Function that takes a parameter \a v. - Also returns the value of \a v. -\if defined(test_ignoresince) - \since Test 1.0 -\endif -*/ +// Documented below with an \fn command. Unnecessary but we support it, and it's used. int Test::someFunction(int v) { return v; @@ -142,6 +136,16 @@ int Test::someFunction(int v) \brief An inline function, documented using the \CMDFN QDoc command. */ +/*! + \fn int Test::someFunction(int v = 0) + + Function that takes a parameter \a v. + Also returns the value of \a v. +\if defined(test_ignoresince) + \since Test 1.0 +\endif +*/ + /*! Function that must be reimplemented. */ diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h index 4ae33a404..cb812375b 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h +++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h @@ -41,7 +41,7 @@ public: OmittedValue = 99 }; #endif - int someFunction(int v); + int someFunction(int v = 0); void someFunctionDefaultArg(int i, bool b); void obsoleteMember(); void anotherObsoleteMember(); -- cgit v1.2.3 From 6f74a799af2c3c9c99dd425218f12fd010b5dd4b Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 15 Apr 2020 00:24:17 +0200 Subject: qdoc: tst_generatedoutput: Add option to regenerate expected data Replace the use of QTEST_APPLESS_MAIN with a main() that accepts a command line option -regenerate. When set, all tests are skipped and the expected data directory is re-populated from the output generated by QDoc. Fixes: QTBUG-81210 Change-Id: If362338570fca2f7348bf25e452b02a91a96ff14 Reviewed-by: Paul Wicking --- .../qdoc/generatedoutput/tst_generatedoutput.cpp | 34 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 40fcdfcac..f8abee1b4 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -34,6 +34,9 @@ class tst_generatedOutput : public QObject { Q_OBJECT +public: + void setRegenerate() { m_regen = true; } + private slots: void initTestCase(); void init(); @@ -73,6 +76,8 @@ private slots: private: QScopedPointer m_outputDir; QString m_qdoc; + QDir m_expectedDir; + bool m_regen = false; void runQDocProcess(const QStringList &arguments); void compareLineByLine(const QStringList &expectedFiles); @@ -87,6 +92,7 @@ void tst_generatedOutput::initTestCase() const auto binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath); const auto extension = QSysInfo::productType() == "windows" ? ".exe" : ""; m_qdoc = binpath + QLatin1String("/qdoc") + extension; + m_expectedDir.setPath(QFINDTESTDATA(".") + QLatin1String("/expected_output")); } void tst_generatedOutput::init() @@ -125,8 +131,8 @@ void tst_generatedOutput::runQDocProcess(const QStringList &arguments) void tst_generatedOutput::compareLineByLine(const QStringList &expectedFiles) { for (const auto &file : expectedFiles) { - QString expected(QFINDTESTDATA("/expected_output/" + file)); - QString actual(m_outputDir->path() + "/" + file); + QString expected(m_expectedDir.filePath(file)); + QString actual(m_outputDir->filePath(file)); QFile expectedFile(expected); if (!expectedFile.open(QIODevice::ReadOnly)) @@ -168,6 +174,19 @@ void tst_generatedOutput::testAndCompare(const char *input, const char *outNames for (auto &expectedOut : expectedOuts) expectedOut = QString(outputPathPrefix) + "/" + expectedOut; + if (m_regen) { + QVERIFY(m_expectedDir.mkpath(m_expectedDir.path())); + for (const auto &file : qAsConst(expectedOuts)) { + QFileInfo fileInfo(m_expectedDir.filePath(file)); + fileInfo.dir().remove(fileInfo.fileName()); // Allowed to fail + QVERIFY(m_expectedDir.mkpath(fileInfo.dir().path())); + QVERIFY(QFile::copy(m_outputDir->filePath(file), + fileInfo.filePath())); + } + QSKIP("Regenerated expected output only."); + return; + } + compareLineByLine(expectedOuts); } @@ -400,6 +419,15 @@ void tst_generatedOutput::nestedMacro() "nestedmacro/testcpp-module.html"); } -QTEST_APPLESS_MAIN(tst_generatedOutput) +int main(int argc, char *argv[]) +{ + tst_generatedOutput tc; + // Re-populate expected data and skip tests if option -regenerate is set + if (argc == 2 && QByteArray(argv[1]) == "-regenerate") { + tc.setRegenerate(); + --argc; + } + return QTest::qExec(&tc, argc, argv); +} #include "tst_generatedoutput.moc" -- cgit v1.2.3 From b3cdd63d4bdaea09222fb93ffcd5104a2dc0bf2e Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 21 Apr 2020 15:04:15 +0200 Subject: Assistant: keep text at the top visible when resizing After following a link to look up a keyword, resizing the width of the window would lead to the looked-up position being scroled away. This fix is adapted from the corresponding fix in Qt Creator, https://codereview.qt-project.org/c/qt-creator/qt-creator/+/274996 Fixes: QTBUG-34525 Change-Id: Ia9c2aab4b2c8039965eff098ff51dbdcc4967a01 Reviewed-by: Eike Ziller Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/assistant/assistant/helpviewer.h | 2 ++ src/assistant/assistant/helpviewer_qtb.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/assistant/assistant/helpviewer.h b/src/assistant/assistant/helpviewer.h index 667fa05a4..fa954cc9f 100644 --- a/src/assistant/assistant/helpviewer.h +++ b/src/assistant/assistant/helpviewer.h @@ -130,6 +130,7 @@ protected: void wheelEvent(QWheelEvent *event) override; void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; + void resizeEvent(QResizeEvent *e) override; private slots: void actionChanged(); @@ -141,6 +142,7 @@ private: void contextMenuEvent(QContextMenuEvent *event) override; QVariant loadResource(int type, const QUrl &name) TEXTBROWSER_OVERRIDE; bool handleForwardBackwardMouseButtons(QMouseEvent *e); + void scrollToTextPosition(int position); private: HelpViewerPrivate *d; diff --git a/src/assistant/assistant/helpviewer_qtb.cpp b/src/assistant/assistant/helpviewer_qtb.cpp index f9bdddb52..260dbfc1d 100644 --- a/src/assistant/assistant/helpviewer_qtb.cpp +++ b/src/assistant/assistant/helpviewer_qtb.cpp @@ -38,6 +38,7 @@ #include #include +#include #ifndef QT_NO_CLIPBOARD #include #endif @@ -312,6 +313,14 @@ void HelpViewer::mouseReleaseEvent(QMouseEvent *e) QTextBrowser::mouseReleaseEvent(e); } + +void HelpViewer::resizeEvent(QResizeEvent *e) +{ + const int topTextPosition = cursorForPosition({width() / 2, 0}).position(); + QTextBrowser::resizeEvent(e); + scrollToTextPosition(topTextPosition); +} + // -- private slots void HelpViewer::actionChanged() @@ -377,4 +386,16 @@ QVariant HelpViewer::loadResource(int type, const QUrl &name) return ba; } + +void HelpViewer::scrollToTextPosition(int position) +{ + QTextCursor tc(document()); + tc.setPosition(position); + const int dy = cursorRect(tc).top(); + if (verticalScrollBar()) { + verticalScrollBar()->setValue( + std::min(verticalScrollBar()->value() + dy, verticalScrollBar()->maximum())); + } +} + QT_END_NAMESPACE -- cgit v1.2.3