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

#include <QShader> fails: QShader header not found in default QtGui include directory, only available under rhi subdirectory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9.2
    • GUI: Other, Qt RHI
    • None
    •     Qt version: 6.9.2 (MSVC 2022 64-bit)
          Windows 11 x64
          Installed using official Qt online installer
          Checked CMake builds
    • Windows

      What did you do?

      • Installed Qt 6.9.2 (MSVC 2022 64-bit) via the official Qt installer.
      • Tried to use the QShader class in a CMake-based project, following the official documentation:
        [QShader Class | Qt GUI | Qt 6.9.2|http://doc.qt.io/qt-6/qshader.html]
      • CMakeLists.txt contains:
        cmake
         
      • find_package(Qt6 REQUIRED COMPONENTS Gui)target_link_libraries(mytarget PRIVATE Qt6::Gui)

      • Source code contains:
         
      • #include <QShader>

      What did you expect to happen?

      I expected the project to compile successfully, and for the header <QShader> (or qshader.h) to be found in the default QtGui include directory, as is typical for other public Qt classes.

      What happened instead?

      The compiler reports that <QShader> cannot be found. Manually checking the installation directories:

      • There is no QShader or qshader.h in
        C:\Qt\6.9.2\msvc2022_64\include\QtGui
      • The file is only present at:
        C:\Qt\6.9.2\msvc2022_64\include\QtGui\6.9.2\QtGui\rhi\qshader.h

      This is inconsistent with the documentation, which states:
      #include <QShader>
      and does not mention the need to include from an rhi subdirectory.

        1. main.cpp
          0.1 kB
        2. CMakeLists.txt
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jasonjiang Paul Reese
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes