I have recently created an asset browser inside of Maya using Maya’s built in UI toolsets. I’m currently in the process of converting this interface to PyQt partly because I want to give the user more control over how the data can be accessed/manipulated, but also just as a nice project I can sink my teeth into and learn PyQt with.
I currently have a model (QAbstractTableModel) that is populated by my Maya assets (QStandardItem). Each item holds different pieces of information about the asset such as, name, type, filePath, hasX, hasY…. So on. I have successfully been able to make a QTableView where each row is an item in the model and each column is some data from the item, so column 1 returns item.name and column 2 returns item.type, etc.
I am now trying, and failing, to create a second view pointing at the same model, in this instance some sort of list view with a flow layout, that will be populated with the thumbnails for each item. This way I can toggle between views and maintain item selection/filtering between them.
I was able to create a window that had a flowLayout and I then populated it by iterating over the items in my data set and for each item generated a QWidget that housed the icon as well as a label for the name of the item. But this wasn’t (unless I am miss-understanding PyQt) pointing at my model to make it so that if I updated my model or used a QFilterProxyModel the windows/widgets wouldn’t stay in sync.
As I am relatively new to PyQt I’m not sure if I’m just using the wrong tool for the job, or completely missing something… Any help or insight is greatly appreciated.
Thanks,
Daniel
I am now trying, and failing, to create a second view pointing at the same model, in this instance some sort of list view with a flow layout, that will be populated with the thumbnails for each item. This way I can toggle between views and maintain item selection/filtering between them.
I was able to create a window that had a flowLayout and I then populated it by iterating over the items in my data set and for each item generated a QWidget that housed the icon as well as a label for the name of the item. But this wasn’t (unless I am miss-understanding PyQt) pointing at my model to make it so that if I updated my model or used a QFilterProxyModel the windows/widgets wouldn’t stay in sync.
As I am relatively new to PyQt I’m not sure if I’m just using the wrong tool for the job, or completely missing something… Any help or insight is greatly appreciated.
Thanks,Daniel
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b9a18cac-728a-4b4c-81fd-e5e80bae34b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.