Results 1 to 3 of 3

Thread: From item based widgets to model/view

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: From item based widgets to model/view

    One big tree describing all your objects sure presents a fanciful idea, especially the ease with which most of the views can be ready almost instantly thanks to proxy model. However it becomes increasingly difficult to make a tree model for different object types. See, making a model for a type QList<ObjectType1> is not that difficult. Now if your objecttype1 has objecttype2 which is to be a child of a particular objecttype1, you can go ahead use the facilities of QObject and make objecttype2 child of objecttype1 or implement something like that yourself or create another node wrapper class which essentially goes ahead and dissects type of object and helps you with the index() and parent() functions.
    With the growing objectypes classes, managing this node class becomes increasingly messy. And difficult. Moreover you cannot envisage the whole program beforehand. Later, it will become a head-ache when a new type comes in.
    Having said that, it is better to have that object tree as big as possible, according to my opinion. The various classes generally interact with each other. Even if your data is outside your classes, and you interact directly with them, models need to be told with anything you changed. I wish there was a straight and correct answer to your question. I wish I knew it too.

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

    timom (22nd September 2011)

Similar Threads

  1. QT Model View - parent Item different from child
    By mromanuk in forum Qt Programming
    Replies: 2
    Last Post: 9th March 2011, 18:21
  2. Replies: 19
    Last Post: 25th November 2010, 08:52
  3. Qcombobox and model/item based question
    By yaguis in forum Newbie
    Replies: 5
    Last Post: 7th June 2010, 01:22
  4. Replies: 1
    Last Post: 1st February 2010, 18:42
  5. Default Item View classes and returning data from model
    By xerionn in forum Qt Programming
    Replies: 8
    Last Post: 23rd April 2009, 19:50

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.