Hi Guys,
I am having this issue in maya 2018.
I made a UI in pyqt4 designer. I got it all working but for some reason Maya launches new version of UI when I run the script. It doesn't close the old already opened UI.
The title of window is different and scaling doesn't work. I have tried to solve it for few days but it doesn't work at all, any help will great.
I have attached the print screen of Maya and designer along with the .UI file I am laoding in Maya 2018.
########################################################################################################################################################################
########################################################################################################################################################################
from maya import cmds
from maya import mel
from maya import OpenMayaUI as omui
import os.path
import os, glob, time
import sys
import getpass
import maya.mel as mel
try:
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2.QtUiTools import *
from shiboken2 import wrapInstance
except ImportError:
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtUiTools import *
from shiboken import wrapInstance
mayaMainWindowPtr = omui.MQtUtil.mainWindow()
mayaMainWindow = wrapInstance(long(mayaMainWindowPtr), QWidget)
class CreateNodeUI(QWidget):
def __init__(self, *args, **kwargs):
super(CreateNodeUI,self).__init__(*args, **kwargs)
self.setParent(mayaMainWindow)
self.setWindowFlags( Qt.Window )
self.initUI()
def initUI(self):
loader = QUiLoader()
file = QFile("C:/Users/nitin.singh/Desktop/polyReduce_001.ui")
file.open(QFile.ReadOnly)
self.ui = loader.load(file, parentWidget=self)
file.close()
def main():
ui = CreateNodeUI()
ui.show()
return ui
if __name__ == '__main__':
main()