Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Treeview
Forum Updated to NodeBB v4.3 + New Features

QML Treeview

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 6 Posters 7.1k Views 1 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.
  • M Offline
    M Offline
    Magnus21
    wrote on last edited by
    #1

    Hello,
    I need to use a Treeview in my application and I noticed that there is only one available for Quick Controls 1, but none for Quick Controls 2.
    What is the best way to get a Tree View in Quick Controls 2?

    1 Reply Last reply
    2
    • A Offline
      A Offline
      ambershark
      wrote on last edited by ambershark
      #2

      There isn't one. According to this:

      https://doc.qt.io/qt-5/qtquickcontrols2-differences.html

      You'll see there is no TreeView in 2, and no alternate to use. Why they dropped it, you'd have to ask a Qt developer.

      As for best way to get one, I'd imagine you will have to write your own. But I'll let someone better with QML answer that. ;)

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      JonBJ E 2 Replies Last reply
      0
      • A ambershark

        There isn't one. According to this:

        https://doc.qt.io/qt-5/qtquickcontrols2-differences.html

        You'll see there is no TreeView in 2, and no alternate to use. Why they dropped it, you'd have to ask a Qt developer.

        As for best way to get one, I'd imagine you will have to write your own. But I'll let someone better with QML answer that. ;)

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @ambershark
        QScrollView is still in 2. Could you manage with that then?

        M 1 Reply Last reply
        0
        • A ambershark

          There isn't one. According to this:

          https://doc.qt.io/qt-5/qtquickcontrols2-differences.html

          You'll see there is no TreeView in 2, and no alternate to use. Why they dropped it, you'd have to ask a Qt developer.

          As for best way to get one, I'd imagine you will have to write your own. But I'll let someone better with QML answer that. ;)

          E Offline
          E Offline
          Eeli K
          wrote on last edited by
          #4

          @ambershark said in QML Treeview:

          Why they dropped it, you'd have to ask a Qt developer.

          http://blog.qt.io/blog/2016/10/06/qt-quick-controls-2-1-and-beyond/

          1 Reply Last reply
          2
          • JonBJ JonB

            @ambershark
            QScrollView is still in 2. Could you manage with that then?

            M Offline
            M Offline
            Magnus21
            wrote on last edited by
            #5

            @JNBarchan ScrollView isn't really much help for a TreeView.
            I don't understand how such a large, viral GUI toolkit like Qt is missing fundamental components like a TreeView.
            This is really a bummer, and I don't really want to implement one myself, that's the job of Qt as a toolkit for me...

            Is it at least available in one of the next upcoming Qt releases?

            JonBJ E I 3 Replies Last reply
            1
            • M Magnus21

              @JNBarchan ScrollView isn't really much help for a TreeView.
              I don't understand how such a large, viral GUI toolkit like Qt is missing fundamental components like a TreeView.
              This is really a bummer, and I don't really want to implement one myself, that's the job of Qt as a toolkit for me...

              Is it at least available in one of the next upcoming Qt releases?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @Magnus21
              QTreeView is derived from QScrollView, so there might have been a chance you were only using the latter's facilities. You'd be surprised how people might use a more complex component than they really need!

              To be clear, it's not Qt that is missing your QTreeView, it is Qt Quick (2). I am using QTreeView in a Qt application quite happily.

              I am not one of the Qt experts, but I suspect Qt Quick is concentrating on mobile support, and QTreeView is probably a bit "heavyweight" for what they want to support natively...

              1 Reply Last reply
              1
              • M Magnus21

                @JNBarchan ScrollView isn't really much help for a TreeView.
                I don't understand how such a large, viral GUI toolkit like Qt is missing fundamental components like a TreeView.
                This is really a bummer, and I don't really want to implement one myself, that's the job of Qt as a toolkit for me...

                Is it at least available in one of the next upcoming Qt releases?

                E Offline
                E Offline
                Eeli K
                wrote on last edited by
                #7

                @Magnus21 https://bugreports.qt.io/browse/QTBUG-61630

                1 Reply Last reply
                1
                • GrecKoG Offline
                  GrecKoG Offline
                  GrecKo
                  Qt Champions 2018
                  wrote on last edited by
                  #8

                  You could still use the one from QQC1

                  import QtQuick.Controls 2.0
                  import QtQuick.Controls 1.4 as QQC1
                  
                  Button {} //QQC2 button
                  QQC1.TreeView{} // QQC1 tree view
                  
                  M 1 Reply Last reply
                  2
                  • GrecKoG GrecKo

                    You could still use the one from QQC1

                    import QtQuick.Controls 2.0
                    import QtQuick.Controls 1.4 as QQC1
                    
                    Button {} //QQC2 button
                    QQC1.TreeView{} // QQC1 tree view
                    
                    M Offline
                    M Offline
                    Magnus21
                    wrote on last edited by
                    #9

                    @GrecKo I prefer to keep my app Quick Controls 2 only.
                    Mixing QC1 with QC2 is bad, since for example QC2 scale with the DPI while QC1 do not. Also QC1 would have a performance impact, so I would not consider that a solution.

                    1 Reply Last reply
                    0
                    • M Magnus21

                      @JNBarchan ScrollView isn't really much help for a TreeView.
                      I don't understand how such a large, viral GUI toolkit like Qt is missing fundamental components like a TreeView.
                      This is really a bummer, and I don't really want to implement one myself, that's the job of Qt as a toolkit for me...

                      Is it at least available in one of the next upcoming Qt releases?

                      I Offline
                      I Offline
                      IceMichael
                      wrote on last edited by
                      #10

                      @Magnus21 You are absolutely right. Are Qt developers not interested in improving the Desktop version anymore at all??

                      1 Reply Last reply
                      2

                      • Login

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