Results 1 to 2 of 2

Thread: slots and signals

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default slots and signals

    Hello
    any one can help to find the error

    i want when i click in the button the text changed
    Qt Code:
    1. #include <QApplication>
    2. #include <QPushButton>
    3.  
    4. void handleButton(QPushButton *m_bouton)
    5. {
    6. // change the text
    7. m_bouton->setText("Example");
    8. }
    9.  
    10. int main(int argc, char *argv[])
    11. {
    12. QApplication app(argc, argv);
    13.  
    14. QPushButton *m_bouton=new QPushButton("Salut les Zéros, la forme ?");
    15. m_bouton->show();
    16. QObject::connect(m_bouton, SIGNAL (clicked()), m_bouton, SLOT (handleButton(m_bouton)));
    17.  
    18.  
    19. return app.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 4th September 2016 at 17:49. Reason: missing [code] tags

Similar Threads

  1. Signals & slots
    By igoreshka3333 in forum Newbie
    Replies: 10
    Last Post: 20th December 2014, 17:49
  2. Qt signals/slots dll for non-Qt app
    By bareil76 in forum Qt Programming
    Replies: 3
    Last Post: 24th October 2014, 13:19
  3. Replies: 2
    Last Post: 18th April 2013, 12:15
  4. Signals and slots
    By sylvarant in forum Newbie
    Replies: 4
    Last Post: 11th September 2007, 15:48
  5. help with signals and slots
    By superutsav in forum Qt Programming
    Replies: 3
    Last Post: 4th May 2006, 12:49

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.