Search code examples
c++qtqmlqtquick2conan

Which options should I enable in conanfile.txt to use with QML/ QtQuick?


I try to set up an environment with conan using qt/5.15.2@bincrafters/stable. Getting the following error when running the code

"main.qml:1:1: module "QtQuick" is not installed"

Need to find out how to install QML correctly with Conan.


Solution

  • As you found out yourself for QtQuick you need at least qtdeclarative=True, you can also add these options for the controls library:

    qtquickcontrols=True  # for QQC1
    qtquickcontrols2=True # for QQC2
    

    On Linux, I've also found adding these modules to be useful:

    config=-xcb
    qttools=True
    qttranslations=True
    qtvirtualkeyboard=True
    qtx11extras=True
    qtsvg=True