Results 1 to 2 of 2

Thread: Confused about Signals and Slots

  1. #1
    Join Date
    Sep 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4

    Default Confused about Signals and Slots

    Hey guys,

    I'm new to QT and I need some help with signals and slots.

    Basically, I'm writing a program that uses QTcpSocket and connects to a server. I can get the connection part, but I need the text on the QPushButton to change from "Connect" to "Disconnect" when they click it and back from "Disconnect" to "Connect" when they click it again (and on.. and on..).

    I can't figure out how to get the signals and slots to change appropriately.

    How can I go about setting this up in QT?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Confused about Signals and Slots

    connect(button,SIGNAL(clicked()),this,SLOT(process ButtonClick()));
    In the slot, you can check the text of the button and change it accordingly..

Similar Threads

  1. Signals & Slots!
    By qtoptus in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2010, 01:50
  2. regarding signals/slots
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 4th October 2007, 09:32
  3. Signals and Slots
    By merry in forum Qt Programming
    Replies: 4
    Last Post: 22nd February 2007, 08:11
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.