Hi,
I already posted this on nuke-dev, but then realized that this is right
place for my question.
I'm experimenting with PySide and QUiLoader. I have problems connecting
signals to slots. Take a look at one of examples I've modified:
import nuke
import PySide.QtCore as QtCore
import PySide.QtGui as QtGui
from nukescripts import panels
import PySide.QtUiTools as QtUiTools
class NukeTestWindow(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
loader = QtUiTools.QUiLoader()
file = QtCore.QFile("c:/temp/test.ui")
file.open(QtCore.QFile.ReadOnly)
myWidget = loader.load(file, self)
print myWidget
file.close()
layout = QtGui.QVBoxLayout()
layout.addWidget(myWidget)
self.setLayout(layout)
self.connect(myWidget.layout().itemAt(0).itemAt(0).itemAt(1).widget(),
QtCore.SIGNAL("clicked()"), self, QtCore.SLOT("BClicked()"))
def BClicked(arg):
print arg
panels.registerWidgetAsPanel('NukeTestWindow', 'Test table panel',
'uk.co.thefoundry.NukeTestWindow')
This code works flawlessly (BClicked is invoked) but self.connect looks
nasty. Is there a way to get widget that I need without all these itemAt?
regards
Adam
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python