On Mon, Nov 13, 2017 at 11:23 AM vilkdage <[email protected]> wrote:

> amazing! At first I tried going through both list with zip() to find
> differences. That's where I failed.
> I must say that UserRole is something I have not heard about thus far. I
> will have to look into it. Thank you very much for teaching me!
>

Just in case the docs aren't clear about this, UserRole is the starting
value for any custom roles you want to store. Qt owns the values below that
point for stuff like DisplayRole, DecorationRole, and so on. So you can
store arbitrary amounts of extra data with your items with a pattern like
this:

PyMelNodeRole = QtCore.Qt.UserRole
OtherDataRole = QtCore.Qt.UserRole+1

def func():
    ...
    item.setData(PyMelNodeRole, node)
    data = item.data(OtherDataRole)


> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/8ea5377d-ab07-4666-aaa5-3b5ce7bf2d30%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/8ea5377d-ab07-4666-aaa5-3b5ce7bf2d30%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3Bu%2BhzcjjjyezKw%3DMZbFNJmLUsYOtXzaHSfU%3DB3M9Vpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to