Results 1 to 5 of 5

Thread: error No such slot QMainWindow::open()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Symbian S60

    Unhappy error No such slot QMainWindow::open()

    hi,

    When i am running the following program i am getting following error
    Object::connect: No such slot QMainWindow::open()
    pls help me to resolve this one


    my win.h Header File
    Qt Code:
    1. #ifndef WIN_H
    2. #define WIN_H
    3. #include<QtGui>
    4. class win : public : QMainWindow
    5. {
    6. public:
    7. win();
    8. private slots:
    9. void open();
    10. private :
    11. };
    12. #endif
    To copy to clipboard, switch view to plain text mode 
    my win.cpp file

    Qt Code:
    1. #include"win.h"
    2. #include<QtGui>
    3. win::win()
    4. {
    5. setWindowTitle("test Window");
    6. pb1=createLink(tr("& test"),SLOT(open()));
    7. pb1->setVisible(true);
    8. pb1->setGeometry(0,0,40,40);
    9. pb1->setText("test");
    10. QObject::connect(pb1,SIGNAL(pressed()),this,SLOT(open()));
    11. }
    12. void win::open()
    13. {
    14. setWindowTitle("event occured");
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 12th August 2009 at 07:19. Reason: missing [code] tags

Similar Threads

  1. How to declare SLOT as a parameter to member function?
    By QPlace in forum Qt Programming
    Replies: 2
    Last Post: 17th July 2018, 00:41
  2. Differences in calling a Slot
    By Denarius in forum Qt Programming
    Replies: 7
    Last Post: 28th April 2009, 15:32
  3. Replies: 12
    Last Post: 18th September 2008, 15:04
  4. Problem When Creating my own Slot
    By Fatla in forum Qt Programming
    Replies: 12
    Last Post: 6th June 2008, 14:44

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
  •  
Qt is a trademark of The Qt Company.