Results 1 to 3 of 3

Thread: QTableWidget - Select multiple rows.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QTableWidget - Select multiple rows.

    Hello,

    I am looking to select multiple rows in a tablewidget at once, as if the user had Ctrl+clicked or Shift-clicked on the vertical headers.

    I have the selection mode set to QAbstractItemView::ExtendedSelection and can perform this operation by clicking.

    Using selectRow(int) clears the previous selection. Looking through the source code, selectRow in QTableView calls QTableViewPrivate::selectRow(int, bool).

    My guess is that I would have to reimplement QTableView::selectRow() but I'm not quite sure how to do that to get the behaviour I want. I'm working on it in the mean time but if anyone has any suggestions that would be great.

    Edit:
    I am currently using Python and PyQt4 for most of my development but I am comfortable with C++ as well.
    Last edited by wally; 17th October 2008 at 19:30.

Similar Threads

  1. Copy row(s) from QTableWidget
    By allensr in forum Qt Programming
    Replies: 10
    Last Post: 1st February 2017, 08:59
  2. QTableWidget sorting with hidden rows
    By alex140773 in forum Qt Programming
    Replies: 0
    Last Post: 8th July 2008, 12:35
  3. Select columns from a QTableWidget
    By toglez in forum Qt Programming
    Replies: 10
    Last Post: 7th October 2007, 15:15
  4. QTableWidget (resizing rows, turning off selection, etc.)
    By kiss-o-matic in forum Qt Programming
    Replies: 6
    Last Post: 11th January 2007, 01:57
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

Tags for this Thread

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.