Results 1 to 4 of 4

Thread: A checkbox only column in QTableView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: A checkbox only column in QTableView

    You have two options:

    - make your delegate create a QCheckBox in createEditor and also implement setEditorData and setModelData
    - make the model return a value for Qt::CheckStateRole in column 0 instead of a value for Qt:isplayRole. Might not even need a delegate in this case.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    gfernandes (28th January 2014)

Similar Threads

  1. Can not remove the checkBox from QtableView?
    By mismael85 in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2010, 13:48
  2. How to centering the checkbox in qtableview
    By nemesisqp in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2010, 17:22
  3. CheckBox inside a QTableView
    By voilier92 in forum Qt Programming
    Replies: 2
    Last Post: 5th March 2010, 05:04
  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

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