Results 1 to 2 of 2

Thread: signals and slots with little c++ knowledge

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default signals and slots with little c++ knowledge

    hello, i am new to QT and i am trying to learn QT and its features.But as a C guy i am facing a bit difficult in understanding signals and slots except this feature the Docs provided by QT is more than enough for me

    i use code blocks along with QT libraries to do the magic with C and it works great!.

    i need help from you guys.can you please tell me how to create a new slots and how to manipulate data with it.i have some very small basic knowledge on c++ so i can understand little bit.

    for example is this correct?
    Qt Code:
    1. int main(int argc, char* argv[])
    2. {
    3. QApplication app(argc, argv);
    4. QPushButton clickme("ClickeME");
    5. clickme.resize(75, 30);
    6. clickme.setFont(QFont("Times", 18, QFont::Bold));
    7. QObject::connect(&clickme, SIGNAL(clicked()), &app, SLOT(updatenewvalues()));
    8. clickme.show();
    9. return app.exec();
    10. }
    11.  
    12. void updatenewvalues()
    13. {
    14. /* some code here */
    15. }
    To copy to clipboard, switch view to plain text mode 

    what i want this program to do is initially the value in clickme is "clickme" no when i press clickme i want the value of "clickme" to change to "dontclickme"

    i have read the Docs from here
    http://doc.trolltech.com/4.7/signalsandslots.html
    but no help!
    Last edited by wenn32; 18th October 2010 at 03:09.

Similar Threads

  1. Signals and Slots
    By Maluko_Da_Tola in forum Newbie
    Replies: 3
    Last Post: 29th July 2010, 23:57
  2. regarding signals/slots
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 4th October 2007, 09:32
  3. Signals and slots
    By sylvarant in forum Newbie
    Replies: 4
    Last Post: 11th September 2007, 15:48
  4. help with signals and slots
    By superutsav in forum Qt Programming
    Replies: 3
    Last Post: 4th May 2006, 12:49
  5. Signals and Slots in dll
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 29th March 2006, 08:12

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.