- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am new to using pyqt and could use some help figuring out how to get this coded just right.
<code>
import maya.cmds as cmds
from pyside2uic import compileUi
class className():
def __init__(self):
self.VarA = 1
def doSomething(self):
print selfVarA=1
from functools import partial
if cmds.window(dialog, exists = True):
cmds.deleteUI(dialog)
dialog = cmds.loadUI(uiFile='pyqtuifile.ui')
cmds.showWindow(dialog)
</code>
I'm not sure where to put this code to compile the ui:
<code>
import sys, pprint
from pysideuic import compileUi
pyfile = open("[path to output python file]\output.py", 'w')
compileUi("[path to input ui file]\input.ui", pyfile, False, 4,
False)
pyfile.close()
</code>
and where to put this button code and exactly what it should look like?
<code>
myPushButton.clicked.connect(self.doSomething)
</code>
Thank you.
Adnan
Solved! Go to Solution.