Results 1 to 4 of 4

Thread: QTableView multiselection with shift

  1. #1
    Join Date
    Mar 2010
    Posts
    5

    Question QTableView multiselection with shift

    I'm using multiselection in my QTableView. And it is fine, but it's not selecting rows with shift + up or shift + down.
    Is it possible to fix it?

    I was trying to use other selectionModes, but with them it is impossible to unselect all rows.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTableView multiselection with shift

    What do you have set as selection behavior etc. on your view?

  3. #3
    Join Date
    Mar 2010
    Posts
    5

    Default Re: QTableView multiselection with shift

    table.setSelectionBehavior(SelectionBehavior.Selec tRows);

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTableView multiselection with shift

    Ok, I see the problem now. Maybe QAbstractItemView::ExtendedSelection as selection mode is what you are looking for. If not, you have to detected when the use is holding Shift and a) handle the selection by your own, or set for that specific time ExtendedSelection.

Similar Threads

  1. Window Shift problem in Qt4.3.4
    By santosh.kumar in forum Qt Programming
    Replies: 0
    Last Post: 5th July 2010, 05:37
  2. QListWidget multiselection indexes
    By OverTheOCean in forum Newbie
    Replies: 2
    Last Post: 2nd June 2010, 06:13
  3. QPen color shift
    By Alberto in forum Qt Programming
    Replies: 0
    Last Post: 22nd October 2008, 11:35
  4. QListView multiSelection
    By cristiano in forum Qt Programming
    Replies: 3
    Last Post: 19th December 2006, 23:41
  5. Rubberband painting on multiselection in a list view
    By SkripT in forum Qt Programming
    Replies: 10
    Last Post: 19th March 2006, 11:13

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.