Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-102837

qtdeclarative/src/qml/doc/snippets/qmltc ought to be a buildable example

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 6.4.0 FF
    • Fix Version/s: None
    • Labels:
      None

      Description

      https://www.qt.io/blog/qml-type-compilation says "The source code of that example is available in the qtdeclarative repository." Fine, so try to build it:

      $ cd qtdeclarative/src/qml/doc/snippets/qmltc
      $ cmake .
      CMake Warning (dev) in CMakeLists.txt:
        No project() command is present.  The top-level CMakeLists.txt file must
        contain a literal, direct call to the project() command.  Add a line of
        code such as
      
          project(ProjectName)
      
        near the top of the file, but after cmake_minimum_required().
      
        CMake is pretending there is a "project(Project)" command on the first
        line.
      This warning is for project developers.  Use -Wno-dev to suppress it.
      
      -- The C compiler identification is GNU 11.2.0
      -- The CXX compiler identification is GNU 11.2.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/lib/ccache/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/lib/ccache/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Error at CMakeLists.txt:11 (qt_internal_add_test):
        Unknown CMake command "qt_internal_add_test".
      
      
      CMake Warning (dev) in CMakeLists.txt:
        No cmake_minimum_required command is present.  A line of code such as
      
          cmake_minimum_required(VERSION 3.23)
      
        should be added at the top of the file.  The version specified may be lower
        if you wish to support older CMake versions for this project.  For more
        information run "cmake --help-policy CMP0000".
      This warning is for project developers.  Use -Wno-dev to suppress it.
      
      -- Configuring incomplete, errors occurred!
      See also "/home/rutledge/dev/qt6/qtdeclarative/src/qml/doc/snippets/qmltc/CMakeFiles/CMakeOutput.log".
      

      You have a whole directory to hold related stuff together for snippets, so why not make it a self-contained example too? Instead it's using qt_internal_add_test, which is not available for users. But OK I guess we value testing in CI more than letting users look at the non-highlighted parts of the snippets?

      Better yet, maybe we need another example to demonstrate how to use qmltc and qmlcachegen together, or just start routinely using them together in multiple examples, if that's what we expect users to do now.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qtqmlteam Qt Qml Team User
            Reporter:
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes