From 046447a6fa686ed076a7df8d27b00abe0811750b Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 18 Apr 2023 20:44:37 +0000 Subject: qdoc: Add status information to the requisites table for types QDoc provides various ways to document the status of an entity; \deprecated, \preliminary, and \modulestate commands. These commands produce a brief sentence describing the status, however, for C++ and QML types, a logical place for this information is also the 'requisites' table at the start of the page. Having the status information in the table makes it more apparent for the reader that they're looking at documentation for a deprecated or preliminary type. For HTML generator, this commit also adds a element that allows additional visuals via CSS (e.g. an icon) for a specific status. Pick-to: 6.5 Fixes: QTBUG-113026 Change-Id: If38a6d51631277a0d98b2cb702acf2598b694643 Reviewed-by: Luca Di Sera --- .../docbook/qml-qdoc-test-oldtype.xml | 36 ++++++++++++++++++++++ .../docbook/qml-test-nover-typenoversion.xml | 6 ++++ .../expected_output/qml-qdoc-test-oldtype.html | 32 +++++++++++++++++++ .../qml-test-nover-typenoversion.html | 2 +- .../qdoc/generatedoutput/expected_output/test.qhp | 7 +++++ .../expected_output/testtagfile.tags | 4 +++ .../qdoc/generatedoutput/testdata/qml/type.cpp | 7 +++++ .../qdoc/generatedoutput/tst_generatedoutput.cpp | 2 ++ 8 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-oldtype.html (limited to 'tests') diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml new file mode 100644 index 000000000..ce2999582 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml @@ -0,0 +1,36 @@ + + + +OldType QML Type +Test +A test project for QDoc build artifacts + +Deprecated old type. +This type is deprecated since 1.0. We strongly advise against using it in new code. +This type was introduced in Qt 1.1. + + + + +Import Statement + +import QDoc.Test 1.1 + + + +Since: + +Qt 1.1 + + + +Status: + +Deprecated since 1.0 + + + + +Detailed Description + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml index 676098113..87576add4 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml @@ -28,6 +28,12 @@ TestDerived + +Status: + +Tech Preview + + Detailed Description diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-oldtype.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-oldtype.html new file mode 100644 index 000000000..f314ad331 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-oldtype.html @@ -0,0 +1,32 @@ + + + + + + + OldType QML Type | Test + + +
  • Types
  • +
  • OldType
  • + +

    OldType QML Type

    + +

    Deprecated old type. More...

    + +
    +
    Import Statement: import QDoc.Test 1.1
    Since: Qt 1.1
    Status: Deprecated since 1.0
    + +

    Detailed Description

    + + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion.html index 432085d63..b426c95a9 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-test-nover-typenoversion.html @@ -23,7 +23,7 @@

    Another QML type documented in a .cpp file. More...

    -
    Import Statement: import Test.NoVer
    Since: Qt 1.1
    Instantiates: TestDerived
      + Import Statement: import Test.NoVer Since: Qt 1.1 Instantiates: TestDerived Status: Tech Preview diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp index 7ef863788..2070d5635 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp +++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp @@ -42,6 +42,9 @@
      +
      +
      +
      @@ -72,6 +75,8 @@ + + @@ -172,6 +177,8 @@ qml-qdoc-test-child.html qml-qdoc-test-doctest-members.html qml-qdoc-test-doctest.html + qml-qdoc-test-oldtype-members.html + qml-qdoc-test-oldtype.html qml-qdoc-test-type-members.html qml-qdoc-test-type-obsolete.html qml-qdoc-test-type.html diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags index 891909786..729ced4c0 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags +++ b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags @@ -86,6 +86,10 @@ (bool really) + + QDoc.Test.OldType + qml-qdoc-test-oldtype.html + UIComponents.ProgressBar qml-uicomponents-progressbar.html diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp index f0d913853..8e4d6e677 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp @@ -41,6 +41,13 @@ \brief Another QML type documented in a .cpp file. */ +/*! + \qmltype OldType + \inqmlmodule QDoc.Test + \brief Deprecated old type. + \deprecated [1.0] +*/ + /*! \qmlproperty int Type::id \readonly diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 552ed39cc..f39a87223 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -242,6 +242,7 @@ void tst_generatedOutput::htmlFromQml() "qml-qdoc-test-type-members.html " "qml-qdoc-test-type-obsolete.html " "qml-qdoc-test-type.html " + "qml-qdoc-test-oldtype.html " "qml-test-nover-typenoversion.html " "qml-test-nover-typenoversion-members.html " "qml-uicomponents-progressbar.html " @@ -332,6 +333,7 @@ void tst_generatedOutput::docBookFromQml() "docbook/qml-qdoc-test-yetanotherchild.xml " "docbook/qml-qdoc-test-doctest.xml " "docbook/qml-qdoc-test-type.xml " + "docbook/qml-qdoc-test-oldtype.xml " "docbook/qml-test-nover-typenoversion.xml " "docbook/qml-uicomponents-progressbar.xml " "docbook/qml-uicomponents-switch.xml " -- cgit v1.2.1