Results 1 to 3 of 3

Thread: How do I save QStandardItemModel's checkState

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How do I save QStandardItemModel's checkState

    Hello, I need to save QStandardItemModel, which is fine. But I also need to save each item's checkState of the model separately. How can I do that? I am getting QModelIndex of each item, but the QModelIndex is related to its parent, for instance, in the attachment, item11 and item21 have same index.row() and index.column(). The QModelIndex::internalPointer() can't really be used when saving to a file...

    Help is very much appreciated!
    Attached Images Attached Images

  2. #2
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How do I save QStandardItemModel's checkState

    save the check state separately ? you mean in a different file ?
    in a seperate file i would save the full path of the item (until !index.parent().isValid()) separate by '|' for exemple so that you can recreate it easily.

  3. #3
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How do I save QStandardItemModel's checkState

    Quote Originally Posted by Le_B View Post
    save the check state separately ? you mean in a different file ?
    in a seperate file i would save the full path of the item (until !index.parent().isValid()) separate by '|' for exemple so that you can recreate it easily.
    Many thanks!

Similar Threads

  1. using QStandardItemModel
    By GrahamLabdon in forum Newbie
    Replies: 1
    Last Post: 6th March 2011, 10:13
  2. QStandardItemModel Help
    By frenk_castle in forum Newbie
    Replies: 1
    Last Post: 16th January 2010, 18:54
  3. Disabling the user to change QCheckBox checkstate
    By ChiliPalmer in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2009, 17:20
  4. QStandardItemModel alignment
    By Pembar in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2009, 17:07
  5. QStandardItemModel save/load Problem
    By sun in forum Newbie
    Replies: 9
    Last Post: 1st October 2008, 19:20

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.