Results 1 to 4 of 4

Thread: Creating a Tree Model from a QStandardModel

  1. #1
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Creating a Tree Model from a QStandardModel

    Hi,

    I need to create a tree model from an other model (QStandard Model).
    The data is present in the QStandard model, the requirement is to create a tree in such a way that one of the columns of QStandard model is root of that tree.

    Please guide to how can i do it.
    If some sample code or some reference is provided, it would be great.

    Regards,
    GK

  2. #2
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Creating a Tree Model from a QStandardModel

    Any Ideas ???

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Creating a Tree Model from a QStandardModel

    Quote Originally Posted by kaushal_gaurav View Post
    I need to create a tree model from an other model (QStandard Model).
    Luckily there is "an example usage of QStandardItemModel to create a tree" in QStandardItemModel docs.

    The data is present in the QStandard model, the requirement is to create a tree in such a way that one of the columns of QStandard model is root of that tree.
    Could you elaborate? How could one column be a root?
    J-P Nurmi

  4. #4
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Creating a Tree Model from a QStandardModel

    By one column has to be root i mean that...

    The hierarchy goes as follows///
    One of the column is Manufacturer... it would have many types of devices.. and then each type of device would have further substypes... for eg....

    Manufacturer-----Device--------- Product
    ---------------------------------------------------------
    HP-----------------Printer------------Inkjet
    ----------------------------------------Laser
    --------------------Camera-----------Digital
    ----------------------------------------Analog

    Cannon-------------Printer------------Inkjet
    ----------------------------------------Laser
    ---------------------Camera-----------Digital
    ----------------------------------------Analog

    Other----------------Printer------------Inkjet
    ------------------------------------------Laser
    ----------------------Camera-----------Digital
    ------------------------------------------Analog

    So here Manufacturer column is root so when user selected an item from Manufacturer column then the Devices column is branched and so on...
    It is similar to MAC Finder window.....
    I need to create a Tree Model and i am totally blank on how to proceed.......

    Please help
    GK

Similar Threads

  1. How use Model view with a tree wich have Cycle ?
    By weepdoo in forum Qt Programming
    Replies: 2
    Last Post: 9th December 2008, 18:05
  2. problem creating dom tree
    By dreamer in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2008, 09:12
  3. creating a Tree
    By mickey in forum General Programming
    Replies: 0
    Last Post: 20th April 2008, 18:57
  4. using the example of simple tree model
    By krishna.bv in forum Qt Programming
    Replies: 1
    Last Post: 22nd December 2006, 13:28
  5. creating a tree hierarchy using QStandardModel
    By wind in forum Qt Programming
    Replies: 3
    Last Post: 19th September 2006, 22:54

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.