On Wednesday, 26 June 2013 17:55:08 UTC-7, drchickins  wrote:
> 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

thanks Justin,

yeah i have used the newer signals but i have alot of code that uses the old 
convention so i really dont have time to change them all but i figuerd out my 
problem and its was just a simple hirarchy problem eg just needed. 
self.widget.create_button...

thanks again

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