即使安装了 cmake 也找不到 QtQuick

Mar*_*ark 2 c++ qt cmake qtquick2

我使用在线安装程序安装了 Qt 6.2.0,并选择了大部分模块进行桌面开发。我收到这个奇怪的消息:

/home/user/Qt/Examples/Qt-6.2.0/multimedia/video/mediaplayer/CMakeLists.txt:28: error: Found package configuration file: /home/user/Qt/6.2.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT FOUND.  Reason given by package: Failed to find Qt component "Quick". Expected Config file at "/home/user/Qt/6.2.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake" exists
Run Code Online (Sandbox Code Playgroud)

英语不是我的主要语言,我不确定最后一句话的真正含义:

"Expected Config file at <path> exists"
Run Code Online (Sandbox Code Playgroud)

实际上该文件存在:

$ ls /home/user/Qt/6.2.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake 
/home/user/Qt/6.2.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake
Run Code Online (Sandbox Code Playgroud)

我不明白为什么它找不到 QtQuick,然后我不知道如何修复它......

小智 6

我必须在 Ubuntu 中为 Qt Creator 安装 qt6-declarative-dev 包才能自动选择它。之后,它开箱即用。