PDA

View Full Version : [resolved] need help solving pyqt problem!!



meGenius
6th March 2009, 14:13
hi all,,

me is a beginner in pyqt, so i've chosen to write through an IDE to help me. then i used Monkey Studio IDE.
form the first i had a problem & i need your help to solve it.
please download the compressed project files & help me solving the problem.

EDIT: read the next post.

rgrds ||| meGenius

meGenius
6th March 2009, 17:10
maybe, people are afraid of downloading packs, plus that, i re-wrote the script into one file as the following:



# -*- coding: utf-8 -*-
import sys

# import PyQt4 QtCore and QtGui modules
from PyQt4.QtCore import *
from PyQt4.QtGui import *

from PyQt4 import uic

#from mainwindow import MainWindow

if __name__ == '__main__':

# create application
app = QApplication(sys.argv)
app.setApplicationName('My PyQt4 QtGui Project')

# create widget
#global w
#w = MainWindow()
#w = uic.loadUi('mainwindow.ui')
#w.setWindowTitle('My PyQt4 QtGui Project')
#w.show()

class MainWindow(QWidget):
def __init__(self, parent = None):
QWidget.__init__(self, parent)
self.ui = uic.loadUi('mainwindow.ui')
self.connect(self.ui.toolButton, SIGNAL('clicked()'), self, SLOT('quit()'))
self.ui.setWindowTitle('My PyQt4 QtGui Project')
self.ui.show()
#self.ui.setupUi(self)

def quit():
print "we'll exit now..."
quit()

MainWindow_class = MainWindow()

# connection
QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()'))

# execute application
sys.exit(app.exec_())


my application does run, but, it doesn't connect the button to the slot it do nothing, & tells me that:


Object::connect: No such slot MainWindow::quit()
Object::connect: (sender name: 'toolButton')


what's the problem & how to solve it now??

pls, help me i'm a real newbie..