Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Issues importing QtQuick.Controls 6.0



  • Hello all,

    I'm currently implementing a QML application which is interfacing with C++ for the underlying logic. I've been able to use QtQuick within the QML by importing using import QtQuick 6.0 and everything works well. However, as soon as I try to do import QtQuick.Controls 6.0 it just complains that:

    qrc:/qml/Warden.qml:2:1: module "QtQuick.Controls" is not installed
         import QtQuick.Controls 6.0
         ^
    

    when attempting to run. Is there anything I'm missing? I'm confused on why QtQuick works but not any underlying plug ins?

    I'm running this within CLion and CMake with Qt 6.1 on Windows.

    This is the current CMake library stuff:

    set(QT_VERSION 6)
    set(REQUIRED_LIBS QuickControls2 QmlModels OpenGL Qml Quick QuickWidgets Gui Widgets Core)
    set(REQUIRED_LIBS_QUALIFIED Qt::QuickControls2 Qt::OpenGL Qt::QmlModels Qt::Qml Qt::Quick Qt::QuickWidgets Qt::Gui Qt::Widgets Qt::Core)
    


  • Not sure but did you mention the following in the .pro file

    QT += quick quickcontrols2
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Based on the doc, no versioning is needed.



  • @chilarai This is done within CMake so not .pro file is included as far as I'm aware



  • @SGaist Thank you for the welcome

    I've attempted with and without the versioning, again without versioning for import QtQuick without the versioning and with the versioning and works for both. However, with import QtQuick.Controls or import import QtQuick.Controls 6.0 it doesn't work. All of the dlls are still present Qt6QuickControls2.dll is in the right place.

    I've followed the documentation but I still feel like I'm missing something basic. All the CMake reflects that in the documentation too.

    Is there anything I need to include on the C++ side of things for the QML to show up properly? A particular #include?


  • Lifetime Qt Champion

    How did you install Qt 6 ?



  • @SGaist Using the Qt online installer via the Qt website. Is there a particular check field I need to make sure I have installed?


Log in to reply