Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to add items of a QTreeView in a grid view with icons only.

How to add items of a QTreeView in a grid view with icons only.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 637 Views
  • 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.
  • A Offline
    A Offline
    Anand H
    wrote on 3 Apr 2019, 12:55 last edited by
    #1

    Hi, I am trying to implement a QDockWidget with QTreeView to show certain branches which contain elements in it (they are only icons), add it is needed to be shown in a Grid.

    A Snap of what I want to achieve:

    0_1554295869244_b6ec81e2-947b-4c77-b2c4-ec9bdba3b9c1-image.png

    It would be great if anyone could help me with some suggestion providing the ways in which this can be achieved using QtreeWidget and QAbstractItemModel.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Apr 2019, 13:35 last edited by
      #2

      Hi,

      What about using a QStackedWidget with a QListView to show these specific entries ?

      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
      • A Offline
        A Offline
        Anand H
        wrote on 3 Apr 2019, 15:43 last edited by
        #3

        Thanks for the reply,
        I wanted the ListItems to be a widget. Also, I don't clearly understand how QStackWidget will be useful in representing a hierarchical structure.

        I found a link: https://stackoverflow.com/questions/3639468/what-qt-widgets-to-use-for-read-only-scrollable-collapsible-icon-list

        Will the above mentioned solution work?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 3 Apr 2019, 22:37 last edited by
          #4

          Hi
          Just as a note.
          There is also tool Box widget that is collapsible
          alt text

          1 Reply Last reply
          3

          1/4

          3 Apr 2019, 12:55

          • Login

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