Results 1 to 2 of 2

Thread: Getting a Signal when the current selection in a QTreeView changes.

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Getting a Signal when the current selection in a QTreeView changes.

    I have a QTreeView connected to a QDirModel. I need a signal whenever the user changes the highlighted item in the tree view - whether by mouse or by up/dn arrow keys (I have to change the active state of a button depending upon if it is pointing at a directory or a file). I cannot find any such signal in either the QTreeView nor the QDirModel.

    How to implement?

    Thanks,
    Doug

  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: Getting a Signal when the current selection in a QTreeView changes.

    See the signals from QItemSelectionModel( for example, the currentChanged signal). You must connect to those.
    You can access the selection model for your view with QTreeView::selectionModel().

    Regards

Similar Threads

  1. [SOLVED] QTreeView drawing selection with icons
    By Timewarp in forum Qt Programming
    Replies: 7
    Last Post: 7th February 2013, 07:52
  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. Qtreeview selection highlighted problem?
    By thefisher in forum Qt Programming
    Replies: 4
    Last Post: 24th November 2006, 09:50
  5. QSortFilterProxyModel signal and selection confusion
    By pascal123 in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2006, 16:25

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.