Jakob Kousholt
2018-11-29 09:38:47 UTC
Hi,
So I am slowly getting the hang of pyside, but a thing I have postponed too
long is to figure out how to make the UI sit on top of mayas main UI like
every other UI inside of maya. So far my code is this: (any other unrelated
tips on a better boileterplate is most welcome too)
from PySide2 import QtCore, QtGui, QtWidgets
from shiboken2 import wrapInstance
import maya.OpenMayaUI as omui
def maya_main_window():
main_window_ptr = omui.MQtUtil.mainWindow()
return wrapInstance(long(main_window_ptr), QtWidgets.QWidget)
class gSubmission(QtWidgets.QMainWindow):
def __init__(self, parent=maya_main_window()):
super(gSubmission, self).__init__(parent)
self.setWindowTitle("Temp")
if __name__ == "__main__":
try:
ui.close()
except:
pass
ui = gSubmission()
ui.show()
So I am slowly getting the hang of pyside, but a thing I have postponed too
long is to figure out how to make the UI sit on top of mayas main UI like
every other UI inside of maya. So far my code is this: (any other unrelated
tips on a better boileterplate is most welcome too)
from PySide2 import QtCore, QtGui, QtWidgets
from shiboken2 import wrapInstance
import maya.OpenMayaUI as omui
def maya_main_window():
main_window_ptr = omui.MQtUtil.mainWindow()
return wrapInstance(long(main_window_ptr), QtWidgets.QWidget)
class gSubmission(QtWidgets.QMainWindow):
def __init__(self, parent=maya_main_window()):
super(gSubmission, self).__init__(parent)
self.setWindowTitle("Temp")
if __name__ == "__main__":
try:
ui.close()
except:
pass
ui = gSubmission()
ui.show()
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/678a5041-d94d-4403-bb03-78ef3b3d6db4%40googlegroups.com.
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/678a5041-d94d-4403-bb03-78ef3b3d6db4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.