Results 1 to 7 of 7

Thread: QTableWidget select only visible cells

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QTableWidget select only visible cells

    Hi
    A little question:

    I have a QTableWidget with lots of rows. I developed a filter, which shows and hides rows.
    But if a filter is active, i.e 3 of 300 rows are shown:

    001 row
    299 row
    300 row

    If the user selects 001 and 299 all the rows between 1 and 299 are also selected.
    How can I solve the problem?

    thank u

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableWidget select only visible cells

    Depends on what your filter does and how it does it.

    To me it sounds that you're doing something odd that's why you're getting hidden items back (or not doing something).

    If you're using QTableWidget then
    QModelIndexList QAbstractItemView::selectedIndexes () const [virtual protected]
    This convenience function returns a list of all selected and non-hidden item indexes in the view. The list contains no duplicates, and is not sorted.
    Should be all you need.

Similar Threads

  1. Replies: 7
    Last Post: 24th May 2011, 04:36
  2. Replies: 1
    Last Post: 6th January 2011, 04:19
  3. read QTableWidget cells
    By navid in forum Newbie
    Replies: 8
    Last Post: 4th April 2010, 10:40
  4. Focus of cells in a QTableWidget
    By SailinShoes in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2008, 08:19
  5. Text in QTableView cells not visible
    By juliarg in forum Newbie
    Replies: 2
    Last Post: 22nd March 2007, 15:49

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
  •  
Qt is a trademark of The Qt Company.