Results 1 to 3 of 3

Thread: What is the best way to support CheckBox in a QSqlTableModel ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default What is the best way to support CheckBox in a QSqlTableModel ?

    Hello all,

    I'm searching for a "generic" solution to store checkbox status in a QSqlTableModel. In fact, I have a custom QSqlTableModel with a QSet<QPersistenModelIndex> to store all modelindex where the box are checked.
    Of course i have redefined data(), setData(), flag(), removeRows().
    --> My simple implementation is here on github :
    sqltablemodelcheckable.cpp
    sqltablemodelcheckable.h

    The problem is : when I call "SubmitAll()", all my QPersistenModelIndex are automatically set to invalid. Are the modelindex that they refers are deleted, then recreated or something like that (???)

    Does someone know why ? Or can indicate me another solution.
    Thanks a lot.
    Last edited by sOuSiX; 20th April 2011 at 18:50.

Similar Threads

  1. Replies: 8
    Last Post: 30th March 2011, 20:06
  2. checkbox
    By fluefiske in forum Newbie
    Replies: 3
    Last Post: 5th October 2010, 22:41
  3. QTableView with a checkbox
    By maxpower in forum Qt Programming
    Replies: 17
    Last Post: 18th February 2007, 09:45
  4. checkbox
    By nErnie in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2006, 21:59
  5. checkBox
    By mickey in forum Qt Programming
    Replies: 8
    Last Post: 1st April 2006, 23:05

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.