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

Cannot enable direct mode while using Shapes API

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.7.2
    • Quick: Shapes
    • None
    • Qt Commercial
    • All

    Description

      QtQuick.Shapes API cannot be found by the QML compiler when QT_QMLCACHEGEN_DIRECT_CALLS is enabled.

      Compilation fails with `error: private/qquickshape_p.h: No such file or directory`.

      /test/build/Desktop_Qt_6_7_2-Debug/.rcc/qmlcache/apptest_Main_qml.cpp:19:10: fatal error: private/qquickshape_p.h: No such file or directory
         19 | #include <private/qquickshape_p.h>
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~`

       

      Edit:

      It worked.

      The interface is a bit odd because one needs to specify QuickShapesPrivate in find_package, which breaks the usual pattern of finding packages that are not explicitly private and then linking to their private libraries in them via target_link_libraries. Nevertheless it worked, so thank you!

      The resulting code looks like this:

      find_package(Qt6 6.5 REQUIRED COMPONENTS Quick QuickShapesPrivate)

      target_link_libraries(apptest
          PRIVATE Qt6::Quick
                  Qt6::QuickPrivate
                  Qt6::QuickShapesPrivate
      )

      Attachments

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

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            javier.cordero Javier Cordero
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes