PyQt4直接返回的是QString类型,不能直接用,需要转换一下:
newFileNameQString = mainWindow.setupWindow.getInputFileName()
try:
newFileName =unicode(newFileNameQString.toUtf8(), 'utf-8', 'ignore')
except AttributeError:
newFileName =newFileNameQString.decode('utf8')