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. Selected Index in TreeView
Forum Updated to NodeBB v4.3 + New Features

Selected Index in TreeView

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 306 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.
  • Q Offline
    Q Offline
    QtisHard
    wrote on last edited by QtisHard
    #1

    How do I see which item I have selected in the treeview?
    I have a list of items in a treeview. If the user selects one item, how do I see which item has been selected and how do I print out which item has been selected?

    I am working in C++

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

      Hi,

      Have a look at the QItemSelectionModel class.

      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
      • Q Offline
        Q Offline
        QtisHard
        wrote on last edited by
        #3

        I did look into this but because I am a beginner I am not able to use the Help section in QT and the Help section in the forum to its fullest yet.

        Can you please explain it to me little bit in detail or point me to an example so I can take reference.

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

          Since you are a beginner, did you went through the Model View Programming chapter in Qt's documentation ?

          That would be the best starting point.

          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