Results 1 to 2 of 2

Thread: QTableView with checkboxes - can't disable selections between checkboxes

  1. #1
    Join Date
    Dec 2011
    Posts
    60
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableView with checkboxes - can't disable selections between checkboxes

    Rather strange issue. I have a simple QTableView with one row and only checkboxes.

    In my code I've done:

    Qt Code:
    1. tableView->setSelectionMode(QAbstractItemView::NoSelection);
    To copy to clipboard, switch view to plain text mode 
    and in the model flags I have:

    Qt Code:
    1. return (Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    To copy to clipboard, switch view to plain text mode 
    Yes, I'm still able to click the area between (to the right) of a checkbox and see a selection/highlight. This is the light purple color below.

    Am I missing something obvious? Is there a way to fully disable this selection (highlighting?) behavior?

    qtableview.PNG

  2. #2
    Join Date
    Jun 2012
    Location
    Austria
    Posts
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTableView with checkboxes - can't disable selections between checkboxes

    Are you sure that the "light purple" is really the selection marker and not just the "current cell" marking?
    Just to be sure: Enable cell selection and select something - does it look like your screenshot?

Similar Threads

  1. Replies: 4
    Last Post: 22nd June 2015, 11:30
  2. Bigger checkboxes in QTableView?
    By qlands in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2012, 13:13
  3. No checkboxes are displayed in a QTableView
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 15th October 2010, 18:28
  4. Unsolicited checkboxes in QTableView
    By MattPhillips in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2009, 22:44
  5. QTableView and checkboxes
    By ibergmark in forum Qt Programming
    Replies: 3
    Last Post: 23rd February 2008, 16:20

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.