PyQt ComboBox Causing Maya 2013 To Crash

Hey guys,
I’m have this problem where for some reason the decorators I to use for a Combo box in PyQt causes Maya 2013 to crash, but works perfectly fine in Maya 2012 and for any other Widget item.

Ex. @pyqtSignature( ‘QString’)
def on_my_Combo_activated( self):
print( ‘hey’)

Has anyone else run into this issue, and is there any other work around for solving this, besides not using decorators?

I would submit a simple reproducible test case and a bug to Autodesk. I’m avoiding 2013 until it stabilizes…

testMe.zip (1.71 KB)

I have attached a quick sample script for anyone to test out and see what I am running into. It seems to work one out of every 15 or so times.

I don’t have 2013 installed, otherwise I’d give it a try. Just a hunch, but I think you may just be running up against a simple Maya threading issue, or an issue where you are getting a callback event while you are currently inside the callback event. Try setting a flag that can be read from within the callback (a global variable, etc.), and exiting without doing anything if the flag is set.

callback():
    global is_in_callback
    if is_in_callback:
        return
    is_incallback = True
    dostuff()
    is_incallback = False

I don’t know if python calls to print are thread safe in Maya 2013. I don’t know why they wouldn’t be, but you might try adding some thread safety to the callback and see if that helps:

http://download.autodesk.com/global/docs/maya2013/en_us/index.html?url=files/Python_Python_and_threading.htm,topicNumber=d30e714110

Again, these are hunches with no basis in 2013 experience.

There is a little info on the changes to QT made with 2013. I would make sure that you are running with the correct version of PyQt:

Your example signature specified a type, but the def takes no arguments except self. Does


@pyqtSignature( 'QString')
def on_my_Combo_activated( self, *args):
    prrint *args

have the same behavior?

Did you check to make sure you are running the correct version as is indicated in the .pdf?

Check out my thread: [maya] Maya2013 and QTableView broken? - Coding - Tech-Artists.Org

Basically, are you using PyQt compiled with Visual Studio 2008? That’s not compatible with 2013.