Results 1 to 3 of 3

Thread: Selection row in QtreeView

  1. #1
    Join Date
    Jun 2006
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Selection row in QtreeView

    Using QtreeView ( QAbstractItemView::SingleSelection, QAbstractItemView::SelectRows ) with own QStandardItemModel based model.
    Selected row.
    If clicking on blank space in window - row lost selection. How to make inpossible lost row selection in this situation (like in address book example).

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Selection row in QtreeView

    Quote Originally Posted by visor_ua View Post
    If clicking on blank space in window - row lost selection. How to make inpossible lost row selection in this situation (like in address book example).
    Hmm, for me it doesn't lose the selection. I tried with Qt 4.4.0 both plastique and winxp styles. Anyway, you could adjust the behavior by reimplementing QAbstractItemView::selectionCommand().
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Selection row in QtreeView

    It might depend on the flags being set on the view... I know it is or used to be the case with a list view.

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. Replies: 1
    Last Post: 26th August 2007, 07:05
  3. Replies: 1
    Last Post: 28th February 2007, 08:34
  4. Qtreeview selection highlighted problem?
    By thefisher in forum Qt Programming
    Replies: 4
    Last Post: 24th November 2006, 09:50
  5. Selection problem in QTreeView
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 7th October 2006, 16:02

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.