View Single Post
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#27
Originally Posted by noobmonkey View Post
ok well tried it....
my class is
class Ui_MainWindow(object):

The error is:
Attribute error: 'UI_MainWindow' object has no attribute 'connect'

Button call in class, sub function, def setupUi(self, MainWindow):
self.connect(self.pushButton, QtCore.SIGNAL("clicked()"), self.updateTab1)

Function in Class:
def updateTab1(self, MainWindow):
If you do it that way You might need self.ui.btnName.connect....

Do it like I do it in my tutorial
Code:
QtCore.QObject.connect(self.ui.btnAdd, QtCore.SIGNAL('clicked()'), self.doAdd)
ETA: Also self.pushButton I don't think is going to work.. do you have a line similar to:
Code:
self.ui = Ui_MainWindow()
Then you need to use self.ui.pushButton...

Wait - looking at your code - are you using pyuic4 or did you write your own qt interface in the code?
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!

Last edited by fatalsaint; 2010-02-17 at 22:02.