So, the key to this is that in Maya 2017 you’re using PySide2, not PySide. This means a switch (under the hood) from Qt4 to Qt5. It’s not super-significant, but it means that things might not be where you would expect them to be as a seasoned Qt developer, and that a LOT of the old training material will be incorrect.
The biggest issue is that the widgets portion of Qt got pulled out of QtGui and into QtWidgets, but it’s not quite as simple as just switching the names, as Drawing, Icons, Pixmaps, etc are all still in the QtGui module. So, in your case, QtGui.QDialog no longer exists—that’s 100% correct. It is instead QtWidgets.QDialog(). So this should suffice: from PySide2 import QtWidgets, QtCore, QtUiToolsfrom shiboken2 import wrapInstance import maya.cmds as mcimport maya.OpenMayaUI as omui def getMayaWindow(): ''' pointer to the maya main window ''' ptr = omui.MQtUtil.mainWindow() if ptr: return wrapInstance(Long(ptr), QtGui.QMainWindow) def run(): ''' builds our UI ''' global win win = GeometryGenerator(parent=getMayaWindow()) win.show() class GeometryGenerator(QtWidgets.QDiaLog): def __init__(self,parent=None): super(GeometryGenerator,self).__init__(parent) On Wed, Oct 11, 2017 at 5:54 PM jettam <justinmet...@gmail.com> wrote: > Can someone tell me why I am getting this error. > I am running maya2017. It appears the QtGui.QDiaLog doesn't exist. Can > someone suggest what I should be looking for here instead. > > from PySide2 import QtGui, QtCore, QtUiTools > from shiboken2 import wrapInstance > > import maya.cmds as mc > import maya.OpenMayaUI as omui > > def getMayaWindow(): > ''' pointer to the maya main window ''' > ptr = omui.MQtUtil.mainWindow() > if ptr: > return wrapInstance(Long(ptr), QtGui.QMainWindow) > > def run(): > ''' builds our UI ''' > global win > win = GeometryGenerator(parent=getMayaWindow()) > win.show() > > class GeometryGenerator(QtGui.QDiaLog): > > def __init__(self,parent=None): > super(GeometryGenerator,self).__init__(parent) > > # Error: 'module' object has no attribute 'QDiaLog' > # Traceback (most recent call last): > # File "<maya console>", line 1, in <module> > # AttributeError: 'module' object has no attribute 'QDiaLog' # > > -- > 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 python_inside_maya+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/32c94e48-1794-481d-afda-1e3f520b2e12%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/32c94e48-1794-481d-afda-1e3f520b2e12%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da4WprXafe9gJ157Y%2BTKP3LTnf8EUnXdCwGNNkd2tLtcWg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.