From b693122a4e08e5745d1b288ef7e1525b085c1ebd Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 22 Jan 2020 11:05:50 +0100 Subject: qdoc: Fix regression in QML types inheriting property groups Property groups from base types were not listed on 'All Members' pages of a QML type. This was because we skipped all shared comment nodes for base types; property group is a special type of SCN. Remove duplication in the code that distributes the nodes; this ensures that there is no difference in output between members of a type and members inherited from its base types. Use logging category to display debug warnings instead of qDebug(). Add a test to cover this. Fixes: QTBUG-81262 Change-Id: I46c3e6afa87c510a7929088acbd1fb354f6733af Reviewed-by: Paul Wicking --- .../qml-qdoc-test-anotherchild-members.html | 25 +++++++++++ .../generatedoutput/qmlpropertygroups/parent.qdoc | 52 ++++++++++++++++++++++ .../qmlpropertygroups/qmlpropertygroups.qdocconf | 7 +++ .../qdoc/generatedoutput/tst_generatedoutput.cpp | 7 +++ 4 files changed, 91 insertions(+) create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html create mode 100644 tests/auto/qdoc/generatedoutput/qmlpropertygroups/parent.qdoc create mode 100644 tests/auto/qdoc/generatedoutput/qmlpropertygroups/qmlpropertygroups.qdocconf (limited to 'tests') diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html b/tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html new file mode 100644 index 000000000..557061cc0 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html @@ -0,0 +1,25 @@ + + + + + + List of All Members for AnotherChild | Test + + + +

List of All Members for AnotherChild

+

This is the complete list of members for AnotherChild, including inherited members.

+ +

The following members are inherited from Parent.

+ + + diff --git a/tests/auto/qdoc/generatedoutput/qmlpropertygroups/parent.qdoc b/tests/auto/qdoc/generatedoutput/qmlpropertygroups/parent.qdoc new file mode 100644 index 000000000..c7002e96b --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/qmlpropertygroups/parent.qdoc @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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$ +** +****************************************************************************/ + +/*! + \qmltype Parent + \inqmlmodule QDoc.Test + \brief Base QML type. +*/ + +/*! + \qmlproperty int Parent::group.c + \qmlproperty int Parent::group.a + \qmlproperty int Parent::group.b + \brief Property group. +*/ + +/*! + \qmltype AnotherChild + \inqmlmodule QDoc.Test + \inherits Parent + \brief Just another child inheriting a parent. +*/ + +/*! + \qmlproperty string AnotherChild::name + \brief Name of this child. +*/ diff --git a/tests/auto/qdoc/generatedoutput/qmlpropertygroups/qmlpropertygroups.qdocconf b/tests/auto/qdoc/generatedoutput/qmlpropertygroups/qmlpropertygroups.qdocconf new file mode 100644 index 000000000..6ed830c82 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/qmlpropertygroups/qmlpropertygroups.qdocconf @@ -0,0 +1,7 @@ +include(../testqml.qdocconf) + +includepaths += .. +sourcedirs += . + +HTML.nosubdirs = true +HTML.outputsubdir = qmlpropertygroups diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index a56e0fd7d..ce4aefa99 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -48,6 +48,7 @@ private slots: void webXmlFromCppBug80259(); void examplesManifestXml(); + void inheritedQmlPropertyGroups(); private: QScopedPointer m_outputDir; @@ -244,6 +245,12 @@ void tst_generatedOutput::examplesManifestXml() "examples-manifest.xml"); } +void tst_generatedOutput::inheritedQmlPropertyGroups() +{ + testAndCompare("qmlpropertygroups/qmlpropertygroups.qdocconf", + "qmlpropertygroups/qml-qdoc-test-anotherchild-members.html"); +} + QTEST_APPLESS_MAIN(tst_generatedOutput) #include "tst_generatedoutput.moc" -- cgit v1.2.3 From 4f8bb92f9654efd6cc5dc7c6b08979fe3106b3ea Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 22 Jan 2020 14:45:15 +0100 Subject: qdoc: Sort the members of shared comment node collective Nodes sharing a comment will be listed together as a group, so sort them alphabetically. Fixes: QTBUG-81265 Change-Id: Ia8dcba92d74116bf6757bfc9aaded1c65d7271fd Reviewed-by: Paul Wicking --- .../generatedoutput/expected_output/qml-qdoc-test-type.html | 12 ++++++------ .../qml-qdoc-test-anotherchild-members.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html index d4c278659..363a4bf16 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html @@ -73,12 +73,12 @@
- - + +

-fourth : int

fifth : int

+fourth : int

A group of properties sharing a documentation comment.

@@ -161,12 +161,12 @@
- - + +

-enable()

disable()

+enable()

Enables or disables this type.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html b/tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html index 557061cc0..aa80b49df 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qmlpropertygroups/qml-qdoc-test-anotherchild-members.html @@ -15,9 +15,9 @@

The following members are inherited from Parent.

-- cgit v1.2.3