I am new to QtDesigner/Pyside (and stackoverflow). I have a QtDesigner interface that previews well. I run it through pyside-uic with no "stub" external signals, and it works fine (doesn't do much!). When I add external signals, I get problems. I have looked through all references to Signals/Slots that seem likely, but nothing points to my problem. I have googled the error message, also with minimal results. After two days of head-banging I have concluded that whatever I am doing is so dumb it doesn't normally warrant a question! Any pointers would be much appreciated. The Ui_tunerSym parent class is around 600 lines, automatically generated from pyside.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Mon May 05 10:01:00 2014
@author: Gordon
"""
from PySide import QtCore, QtGui
#import UI produced by QtDesigner after running through: pyside-uic -x TunerSymWindow.ui -o ui_tunerSym.py
from ui_tunerSym import Ui_tunerSym
# subclass my UI class
class tView(Ui_tunerSym):
def __init__(self):
QtCore.QObject.connect(self.coarse_commandLinkButton, QtCore.SIGNAL("clicked()"), self.execute_coarse_tune)
QtCore.QObject.connect(self.fine_commandLinkButton, QtCore.SIGNAL("clicked()"), self.execute_fine_tune)
QtCore.QMetaObject.connectSlotsByName(tunerSym)
def execute_coarse_tune(self):
print "Coarse tune button pushed"
def execute_fine_tune(self):
print "Fine tune button pushed"
#example from web site used as basis
#QtCore.QObject.connect(button, QtCore.SIGNAL('clicked()'), someFunc)
# copied from ui_tunerSym.pi. Shows the buttons and signals are in fact there...
# QtCore.QObject.connect(self.coarse_commandLinkButton, QtCore.SIGNAL("clicked()"), tunerSym.execute_coarse_tune)
# QtCore.QObject.connect(self.fine_commandLinkButton, QtCore.SIGNAL("clicked()"), tunerSym.execute_fine_tune)
# QtCore.QMetaObject.connectSlotsByName(tunerSym)
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
frame = tView()
frame.show()
app.exec_()
# throws the following error:
# AttributeError: 'tView' object has no attribute 'coarse_commandLinkButton'