Results 1 to 13 of 13

Thread: Subclasing QAbstractItemModel Issue

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    14
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3

    Default Subclasing QAbstractItemModel Issue

    Hi,
    im working on one application and I need to subclass QAbstractItemModel. I googled which methods I need to reimplement to make it work. Basic Idea is I need to reimplement mainly data methode (the others just to do the same as usualy), to choose what is returned. Problem is, if I return anything else than simple QVariant(), for example if I return 1 (I also tryed conversion of everything I tryed straight to QVariant befor returning) result looks like this:

    Im not able to figure out from where these checkboxes appeared there. I can return anything, and still, here they are. Its different when I return like 0 or 1. On 0 its unchecked on 1 its checked. But still, I cant figure it out.

    I know maybe I just forgot something basic, or Im just blind to see the problem and it can be something realy simple, but I tryed for some time and Im out of ideas.
    Can please anybody help me with this? I would realy appreciate any help.

    PS: I put this class in simple project, sou if needed, you can try to run it and see what it is doing.
    Attached Files Attached Files
    Last edited by wolfi3b; 23rd September 2010 at 13:34.

Similar Threads

  1. subclasing a Qlist?
    By Ricardo_arg in forum Qt Programming
    Replies: 3
    Last Post: 21st March 2010, 09:40
  2. Once more : QAbstractItemModel woes
    By Valheru in forum Qt Programming
    Replies: 10
    Last Post: 15th January 2008, 11:44
  3. Checkboxes in QAbstractITemModel
    By Valheru in forum Qt Programming
    Replies: 5
    Last Post: 28th November 2007, 21:23
  4. QAbstractItemModel shifiting up and down
    By mattjgalloway in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2007, 09:41
  5. QAbstractItemModel for dummies
    By morty in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2006, 16:25

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.