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. Getting index From QTreeView
Forum Updated to NodeBB v4.3 + New Features

Getting index From QTreeView

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 656 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.
  • A Offline
    A Offline
    ankush205
    wrote on last edited by
    #1

    I have implemented QTreeView and fill elements in order like
    root->patient->study->series->image

    and there can be multiple studies in a patient ,multiple series in a study and so on..i was able to fil up those values and QtreeView is displaying data correctly

    Now i wanted to implement Signal slot so that when i click on particular image so only that image is displayed so i called connect(treeview,SIGNAL(clicked(QModelIndex)),this,SLOT(fileselection(QModelIndex)));

    It returns me QmodelIndex .but how can i know the integer value from QmodelIndex like how it is filled.

    For Example lets the tree be
    patient1(1)
    study1(2)
    series1(3)
    image1(4)
    patient2(5)
    study2(6)
    series2(7)
    image2(8)

    Now i wanted to obtain those values that i have specified in bracket (QmodelIndex to bracket values)
    I fill them in same order like first patient 1,then study 1 and so on

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

      Hi,

      Where do these values come from ?

      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