Results 1 to 3 of 3

Thread: QTableView checkbox center with stylesheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Poland
    Posts
    1

    Default QTableView checkbox center with stylesheet

    Hi!

    I tried to center the checkbox in QTableView by something like this:
    Qt Code:
    1. qApp->setStyleSheet("::indicator {subcontrol-position: center; subcontrol-origin: padding;}");
    To copy to clipboard, switch view to plain text mode 

    But it doesn't work for QTableView item (set by Qt::CheckStateRole in model), although it works good for any other usual widget like QCheckBox or QRadioButton.
    Is that bug in Qt or maybe Qt just does't provide this stylesheet subcontrol feature for item views?

    I see that other properties like e.g 'left' also work for checkbox indicator in view.
    Last edited by quiet; 1st March 2009 at 21:34.

Similar Threads

  1. QTableView paint row in stylesheet hover
    By estanisgeyer in forum Qt Programming
    Replies: 3
    Last Post: 23rd October 2012, 09:17
  2. boolean field checkbox QTableView
    By skuda in forum Qt Programming
    Replies: 4
    Last Post: 8th November 2010, 13:48
  3. QTreeView: How to center a checkbox in a cell
    By chezifresh in forum Qt Programming
    Replies: 3
    Last Post: 19th December 2008, 12:11
  4. QTableView with a checkbox
    By maxpower in forum Qt Programming
    Replies: 17
    Last Post: 18th February 2007, 09:45
  5. CheckBox and selection in QTableView
    By Mike Krus in forum Qt Programming
    Replies: 1
    Last Post: 21st September 2006, 20:31

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.