Results 1 to 2 of 2

Thread: No checkboxes are displayed in a QTableView

  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default No checkboxes are displayed in a QTableView

    Hello,

    i use a QSqlTableModel and a QTableView to show the data of the model.
    I inherit the QSqlTableModel and return also the Qt::ItemIsUserCheckable flag in the flags() function. But i didn't get a checkbox displayed. What I'm doing wrong?

    I need something like the following:
    Qt Code:
    1. [X] Product 1
    2. [ ] Product 2
    3. [X] Product 3
    To copy to clipboard, switch view to plain text mode 

    Did I need a reimplementation of a delegate or should it also work as it is?

    Thanks in advance

    Best Regards
    NoRulez

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: No checkboxes are displayed in a QTableView

    You also have to ensure that the data() function is returning a valid value for Qt::CheckStateRole.

Similar Threads

  1. Unsolicited checkboxes in QTableView
    By MattPhillips in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2009, 21:44
  2. QTableView and checkboxes
    By ibergmark in forum Qt Programming
    Replies: 3
    Last Post: 23rd February 2008, 15:20
  3. checkboxes
    By abrou in forum Newbie
    Replies: 2
    Last Post: 1st February 2008, 18:52
  4. how i can add checkboxes to contextMenus?
    By quickNitin in forum Newbie
    Replies: 3
    Last Post: 15th November 2006, 12:35
  5. QTreeView with checkboxes
    By shad in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2006, 13:29

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.