name.0001.extname.0002.extname.0003.ext
- name (not an actual folder, virtual row I want to insert)--name.0001.ext--name.0002.ext--name.0003.ext
--
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/df3e4b4a-69e1-432e-9fd9-0164463d8d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
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/df3e4b4a-69e1-432e-9fd9-0164463d8d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/4afb7027-7593-4c92-aecb-60285c47eec4%40googlegroups.com.
def index(self, row, column, parent=QtCore.QModelIndex()):
return self.createIndex(row, column, row)
def mapFromSource(self, source):
return self.index(source.row(), source.column(), source.parent())
def mapToSource(self, proxy):
if not proxy.isValid() and not self.sourceModel():
return QtCore.QModelIndex()
return self.sourceModel().index(proxy.row(), proxy.column(), proxy.parent())
If your model is read-only, then it will be a lot less work and you don't need to implement insertRow().I can try to put together a simplified example of my own implementation when I get back to work. It's a grouping proxy model that is meant to take a table model and create a tree model with a virtual parent item for a configured attribute of the items. As an example, one could say "group on 'category'" and then you would go from this:ford, carmazda, carapple, foodbanana, foodto this:carfordmazdafoodapplebananaI tried a quick search to see if there are existing examples, and maybe these will give you some more info:Justin
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/df3e4b4a-69e1-432e-9fd9-0164463d8d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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_maya+unsub...@googlegroups.com.
Makes sense.
I was mistakenly trying to use insertRow for the virtual row. I do intend for the sourceModel to be read-only.
Appreciate the links, I am reading through them though it's a bit difficult for me.
I also got that one can use the data method to write the filename for the virtual row.
I am trying to add this code to the subclass to create a new index for the virtual row. (Based on reading this Link. )
There is still a problem with the indexes though: "source.parent()" and "proxy.parent()" won't be understood by the either classes. This example was using table model and won't work with a tree model.
def index(self, row, column, parent=QtCore.QModelIndex()):
return self.createIndex(row, column, row)
def mapFromSource(self, source):
return self.index(source.row(), source.column(), source.parent())
def mapToSource(self, proxy):
if not proxy.isValid() and not self.sourceModel():
return QtCore.QModelIndex()
return self.sourceModel().index(proxy.row(), proxy.column(), proxy.parent())
It might seem I am trying to eat more than I can chew right now. I will give it some more time but I will have to leave it due to time constraints and pick it up later when I understand Qt more.
If would be great to have a simplified example, if possible of course.
Thank you for all the help.
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/df3e4b4a-69e1-432e-9fd9-0164463d8d57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/4afb7027-7593-4c92-aecb-60285c47eec4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/e53040af-2502-47dc-8194-fc2bc10b3776%40googlegroups.com.