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

Can find TreeView module in QML



  • I'm trying to build a simple QML app which uses a TreeView, using QT Creator with QT 5.15.2. I discovered that TreeView is not included with QtQuick Controls 2.x so the compilation fails.

    Instead it seems (if I understand the documentation correctly) that I must import QtQuick.Controls 1.4 But Qt Creator complains that it's not installed. And the Qt Maintenance tools doesn't offer a way to install this.

    Help! What am I doing wrong?



  • I installed 5.x kit, so Qt Controls 1.x SHOULD be installed. I closed Qt Creator and reopened and now warning is gone. Strange...

    But I am still unclear on something. is TreeView included with QtQuick Controls 2.x ? If not, does that mean TreeView is deprecated and will be dropped in Qt 6? (Should I avoid using TreeView ?)


  • Moderators

    @ocgltd if you're running open source, you can get it "for free" from the market place

    https://marketplace.qt.io/products/treeview?_pos=1&_sid=1fe207197&_ss=r



  • QtQuick.Controls 1.x is always installed. Did you try using it with QtQuick.Controls 2.x?
    Is that case:

    import QtQuick.Controls 1.4 as QC1
    
    ...
    
    QC1.TreeView {
    }
    

  • Moderators

    @fcarney if the op uses Qt6, than Control 1 is not automatically installed :(

    I know @ocgltd said using QT Creator with QT 5.15.2 but that may be from the about QtCreator page and not from the kit he uses



  • I installed 5.x kit, so Qt Controls 1.x SHOULD be installed. I closed Qt Creator and reopened and now warning is gone. Strange...

    But I am still unclear on something. is TreeView included with QtQuick Controls 2.x ? If not, does that mean TreeView is deprecated and will be dropped in Qt 6? (Should I avoid using TreeView ?)


Log in to reply