In Maya 2016 everything is fine. But in Maya 2017 (after I did all the pyqt conversions), any Error happening in a function called from a qt signal doesn't get shown immediately. Then if I run another code in the script editor, such as "print 0", the error from the previous function comes up
To try it out, simply run the code, and click the button "error".
I tried it on Windows and Mac. Also asked a friend to try on his - and he had same issue. Again, on Maya 2016 it's all fine. The issue is only happening in Maya 2017
from PySide2 import QtWidgets, QtGui, QtCore
from shiboken2 import wrapInstance
import maya.OpenMayaUI as mui
mainWin = None
def showUI():
global mainWin
if mainWin != None:
print "reloading UI..."
mainWin.close()
mainWin = myWindow()
mainWin.show()
def getMayaWindow():
ptr = mui.MQtUtil.mainWindow()
return wrapInstance(long(ptr), QtWidgets.QWidget)
class myWindow(QtWidgets.QDialog):
def __init__(self, parent=getMayaWindow()):
super(myWindow, self).__init__(parent, QtCore.Qt.WindowStaysOnTopHint)
def funcApply():
oooo # this should error!
self.layout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.TopToBottom, self)
self.testButton = QtWidgets.QPushButton('error')
self.layout.addWidget(self.testButton)
self.testButton.clicked.connect(funcApply)
showUI()