PDA

View Full Version : One QStandardItemModel for different QTableView, Generic vs Specific Views



toglia3d
30th August 2010, 21:11
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?

wysota
30th August 2010, 21:24
Use a proxy model.