Try changing this line?
- self.connect(self.button1, SIGNAL("didSomething"),
self.updateLabel)
+ self.connect(self, SIGNAL("didSomething"),
self.updateLabel)
-Chris
On Mon, Jun 15, 2009 at 9:02 AM, marcin <[email protected]> wrote:
>
> Hi!
>
> How can I update Qt gui using scriptJob ? I want to update QLabel when
> user changed selection, so I try emit custom signal with scriptJob.
> But this code doesn't work for me.
>
> import sys
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
> import pumpThread as pt
> import pymel as pm
>
> form=None
> app=None
>
> class Form(QDialog):
>
> def __init__(self, parent=None):
> super(Form, self).__init__(parent)
>
> self.button1 = QPushButton("One")
> self.label = QLabel("Click a button")
>
> layout = QHBoxLayout()
> layout.addWidget(self.button1)
> layout.addWidget(self.label)
> self.setLayout(layout)
>
> self.connect(self.button1, SIGNAL("didSomething"),
> self.updateLabel)
> self.doSomething()
>
> def updateLabel(self):
> self.label.setText("Update")
>
> def doSomething(self):
> pm.scriptJob(e=["SelectionChanged",self.emit(SIGNAL
> ("didSomething"))])
>
> def myUI():
> global app
> global form
> pt.initializePumpThread()
> app = qApp
> form = Form()
> form.show()
>
>
> Marcin
> >
>
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---