I can confirm this on Windows, or at least some odd behavior.
from PySide2 import QtWidgets
def on_pressed():
priknt("world")
button = QtWidgets.QPushButton("Hello")
button.pressed.connect(on_pressed)
button.show()
For me, when pressing the button, the window with the button in it stalls
and doesn’t do or say anything. The GUI is still responsive and works fine.
When I run:
button.close()
The expected exception appears.
# Error: NameError: file <maya console> line 4: global name 'priknt'
is not defined #
But the GUI remains.
The next time I call close(), the GUI closes, and all is well.
This is with a fresh copy of Maya 2017 on Windows 10, all settings default.
On 29 September 2016 at 09:01, Fredrik Averpil <[email protected]>
wrote:
> Not sure if it's just me or if this is a thing.
>
> So, I've noticed that with e.g. Maya 2015 (Qt4) and PySide, when my UI
> hits an error and I get the Traceback in the script editor the UI doesn't
> crash/disappear. It's still fully functional in Maya as well as when I run
> the UI in the cmd/terminal (standalone).
>
> However, with Maya 2017 (Qt5) and PySide2, the application still prints
> the traceback in the script editor but then simply crashes.
> If I run the UI in cmd/terminal (standalone) instead, the UI disappears as
> well.
>
> The error can be e.g. that when I click a pushButton it calls a function
> which prints "hello". But in this case let's say the function was
> misspelled so when I click the button a non-existing function is called.
>
> Is this something you guys have observed as well -- or could it be
> something specific to my code?
>
> Cheers,
> Fredrik
>
> --
> 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/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%
> 2BVRJnB4Hpg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
*Marcus Ottosson*
[email protected]
--
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/CAFRtmODypNPvuVxOjMFg1QFNtKsHgBubdz3d_WX9RhFn3SNb-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.