hi all,

so i'm trying to get a signal from a .ui desiger file to connect with a
call which worked well in pyQt but pyside has the QUiLoader and i'm having
trouble getting it to recognise a button. keeps on saying the object doesnt
exist.

has anyone used the QUiLoader and connected a button to a definition?
the ui appears but nothing works

here is what i have. i created a .ui dialog file with a single button and
named "create_button"
###############

import sys, os
from PySide import QtGui, QtCore, QtUiTools
from shiboken import wrapInstance
from maya import OpenMayaUI, cmds, OpenMaya


file = "D:\oneButtonTestDialog.ui"

def getMayaWindow():
    ptr = OpenMayaUI.MQtUtil.mainWindow()
    if ptr is not None:
        return wrapInstance(long(ptr), QtGui.QMainWindow)

class designerUI(QtGui.QDialog):
    def __init__(self,  parent=getMayaWindow()):
        super(designerUI, self).__init__(parent)
        loader = QtUiTools.QUiLoader(self)
        widget = loader.load(file, self)
        QtCore.QMetaObject.connectSlotsByName(widget)

        widget.show()

        self.connect(self.create_button, QtCore.SIGNAL('clicked()'),
self.create_button_cb)
        #old style signal

    def create_button_cb(self, *args):
        print "linked"


designerUI()

#############



john

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to