Results 1 to 2 of 2

Thread: QStandardItemModel: copy and append

  1. #1
    Join Date
    May 2007
    Location
    Huntsville, Alabama
    Posts
    10
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QStandardItemModel: copy and append

    Hi,

    I have two different QStandardItemModels filled with data. I want to create a new QStandardItemModel and append or add to it with the copies of the two QStandardItemModels I have. Do I have to loop through the data of the two I already have to add to the new QStandardItemModel, or is there an easier, more efficient way of doing this?

    (using Qt4.3.0)

    Thanks
    James

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QStandardItemModel: copy and append

    You have to loop and copy (clone) items. If you didn't want copies, you could provide a proxy model that wrapped two or more models to create a single unified model.

  3. The following user says thank you to wysota for this useful post:

    davisjamesf (20th September 2007)

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.