Results 1 to 2 of 2

Thread: One QStandardItemModel for different QTableView, Generic vs Specific Views

  1. #1
    Join Date
    Jun 2010
    Posts
    36
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default One QStandardItemModel for different QTableView, Generic vs Specific Views

    I really don't know if this makes sense but this is what I trying to do:

    I'm doing my game's editor in QT. Currently I'm using a QStandardItemModel to store all my scene items. These items have names, position, Textures(vector of Texture which is a custom class), Animations (vector of Animation), etc.

    I find it useful to have one item for row cause I can add or remove these items easily besides having them in a single place so changing this model should affect the entire app.

    Now, I'm trying to do specific views for say the "Textures" of a certain item. This QTableView should show the texture's name, path etc. So, basically how can I grab the vector of Textures in the general model and fill another view without doing another model?
    Last edited by toglia3d; 30th August 2010 at 21:21.

  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: One QStandardItemModel for different QTableView, Generic vs Specific Views

    Use a proxy model.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Searching a QTableView for a specific row
    By GreyGeek in forum Qt Programming
    Replies: 4
    Last Post: 20th March 2013, 12:51
  2. QStandardItemModel / QTableView sorting issue
    By AlphaWolfXV in forum Qt Programming
    Replies: 2
    Last Post: 31st August 2010, 05:42
  3. One Model, Two Views (QTreeView and QTableView)
    By dgarrett97 in forum Newbie
    Replies: 2
    Last Post: 14th September 2009, 18:10
  4. qtableview QStandardItemModel read only
    By JeanC in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2008, 16:42
  5. Extract QStandardItemModel from QTableView
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 08:34

Tags for this Thread

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.