Results 1 to 3 of 3

Thread: current item in treeview

  1. #1
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default current item in treeview

    hi all.
    how can i get in a meinwindow which the current selected item in my treeview is?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: current item in treeview

    Connect the currentChanged signal from QTreeView::selectionModel to some slot in your class and using the tree view model get the data at the index provided by that signal.

    EDIT: forget that, use QTreeView::currentIndex in conjunction with the model and get the data of the current index. No need for signals/slots.

  3. #3
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: current item in treeview

    QItemSelectionModel....
    reading the docu helps.....

Similar Threads

  1. get current item from QCompleter
    By evgenM in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 18:16
  2. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  3. Replies: 15
    Last Post: 21st April 2007, 17:46
  4. Replies: 1
    Last Post: 19th April 2007, 22:23
  5. TreeView click item not connecting
    By Big Duck in forum Qt Programming
    Replies: 2
    Last Post: 9th June 2006, 19:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.