Hey no problem. Just giving some suggestions to help you get faster
replies. Sometimes people can't grab the attachments and view them right
away. But ya its valid to think the problem could have been elsewhere. So
thanks for providing the proper code!

I'm guessing there is some underlying bug or issue with Qt causing the
crash. The roles are used for getting various data results of a single
index for different purposes. There are the built in ones like Display,
Decoration, etc, and UserRole+N is provided to tack on more. I do stuff
where I might have 3 custom bits of data I want to request from an index
and returning the internal pointer is not always something you want to
expose.
Its just a pattern I have followed and I don't claim its the gold standard.
Just helps me define multiple custom types with constants that you can use.
On Oct 25, 2013 6:25 PM, "Bay" <[email protected]> wrote:

> Hi Justin,
>                first thank you for going through to the trouble to look
> through my code and think of a solution for me. I apologize for not
> providing the code snippet because I'm not knowledgeable enough about PyQT
> to isolate the problem, I was worried that the real problem was actually
> somewhere else in the model view so I thought it was safer for me to just
> give the whole code file, still having difficulties trying to understand
> what is being passed into the modelview, how it's stored and how to
> retrieve it.
>
>                And yes, what you gave me indeed solved the problem I've
> been having. I was wondering through, why it was causing the crash? The
> code examples I've been hunting through the net don't seemed to use the
> QtCore.Qt.UserRole(Or maybe it did and I didn't understand the relevance).
> Again, thanks for going through the time and trouble to give the solution.
>
> Thank you
> Gann Boon Bay
>
>
>
>
> On Tuesday, October 22, 2013 11:12:58 AM UTC-7, Bay wrote:
>>
>> Hi all,
>>           a problem I'm having right now with my script is that when my
>> gui takes in a series of selections decided by the user, I want to be able
>> to select a row/rows from the GUI and remove it. Currently I'm just trying
>> to get it to print out the information from the selection but it crashes
>> everytime I do so. After some attempts to debug it, I noticed that
>> everytime I send the information into the itemFromIndex method in my model
>> I'm getting some huge number like 65536 which is the reason it has been
>> crashing
>>
>>            Could anyone tell me the likely reason that this may be so? Or
>> possible mistakes I've made? Attached are the files.
>>
>> Thank you
>> Gann Boon Bay
>>
>  --
> 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/a44c62cb-a783-4e67-a3ee-fe805de36dc2%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAPGFgA3edU2hhCcYw_fKBCTn%2BNGsu0SRqpTa%2BMUjjUqPOAb2Sw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to