Results 1 to 2 of 2

Thread: [resolved] need help solving pyqt problem!!

  1. #1
    Join Date
    Mar 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [resolved] need help solving pyqt problem!!

    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
    Attached Files Attached Files
    Last edited by meGenius; 6th March 2009 at 17:12. Reason: i've made some progress...

  2. #2
    Join Date
    Mar 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: need help solving pyqt problem!!

    maybe, people are afraid of downloading packs, plus that, i re-wrote the script into one file as the following:

    Qt Code:
    1. # -*- coding: utf-8 -*-
    2. import sys
    3.  
    4. # import PyQt4 QtCore and QtGui modules
    5. from PyQt4.QtCore import *
    6. from PyQt4.QtGui import *
    7.  
    8. from PyQt4 import uic
    9.  
    10. #from mainwindow import MainWindow
    11.  
    12. if __name__ == '__main__':
    13.  
    14. # create application
    15. app = QApplication(sys.argv)
    16. app.setApplicationName('My PyQt4 QtGui Project')
    17.  
    18. # create widget
    19. #global w
    20. #w = MainWindow()
    21. #w = uic.loadUi('mainwindow.ui')
    22. #w.setWindowTitle('My PyQt4 QtGui Project')
    23. #w.show()
    24.  
    25. class MainWindow(QWidget):
    26. def __init__(self, parent = None):
    27. QWidget.__init__(self, parent)
    28. self.ui = uic.loadUi('mainwindow.ui')
    29. self.connect(self.ui.toolButton, SIGNAL('clicked()'), self, SLOT('quit()'))
    30. self.ui.setWindowTitle('My PyQt4 QtGui Project')
    31. self.ui.show()
    32. #self.ui.setupUi(self)
    33.  
    34. def quit():
    35. print "we'll exit now..."
    36. quit()
    37.  
    38. MainWindow_class = MainWindow()
    39.  
    40. # connection
    41. QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()'))
    42.  
    43. # execute application
    44. sys.exit(app.exec_())
    To copy to clipboard, switch view to plain text mode 

    my application does run, but, it doesn't connect the button to the slot it do nothing, & tells me that:
    Qt Code:
    1. Object::connect: No such slot MainWindow::quit()
    2. Object::connect: (sender name: 'toolButton')
    To copy to clipboard, switch view to plain text mode 

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

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

Similar Threads

  1. pyqt custom QItemDelegate problem
    By spohle in forum Qt Programming
    Replies: 0
    Last Post: 31st January 2009, 01:48
  2. Qmutex/QThread PyQt problem
    By boom in forum Newbie
    Replies: 3
    Last Post: 1st September 2008, 12:49
  3. Problem with PyQt 4.4.2 and Qt 4.4.0
    By tlam in forum Installation and Deployment
    Replies: 1
    Last Post: 6th August 2008, 16:34
  4. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  5. PyQt QTimer problem { FIXED }
    By WinchellChung in forum Newbie
    Replies: 0
    Last Post: 1st March 2008, 16:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.