Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Using the Qt Quick TreeView with CMake
Forum Updated to NodeBB v4.3 + New Features

Using the Qt Quick TreeView with CMake

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 581 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    evol
    wrote on last edited by
    #1

    Hello,
    I'm trying to use the Qt Quick TreeView from Qt Marketplace inside my Qt project and I'm hitting several issues.

    I wanted to initially use Qt 5.15, but unfortunately, I'm using CMake as the build system and this commit suggests that I can only use the TreeView with CMake on Qt 6.

    Anyway, I can't get the TreeView to work with this minimal example: https://github.com/evoL/qml-treeview-demo. I managed to get my executable to use the QML plugin, but the engine can't find the TreeView QML file at runtime.

    Does somebody know what I'm doing wrong here?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      That commit only talks about building the module itself not about using it in your application.

      You should be able to use it as any other Qt module with cmake.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • E Offline
        E Offline
        evol
        wrote on last edited by
        #3

        Hey, thanks for the quick response!

        I wanted to use the module via add_subdirectory in my project — it's a convenient way to manage dependencies because I can use FetchContent functions. However, this way the module gets built along with my project.

        Does it mean that in order to use it properly, I should first build and install TreeView separately and then use find_package to include it?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I think the idea here is that you build and install the Quick TreeView so that you can reuse it from within different projects.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved