Well, then call connectToHost() in the start slot and disconnectFromHost() in the stop slot.
Cheers,
_
Well, then call connectToHost() in the start slot and disconnectFromHost() in the stop slot.
Cheers,
_
I can't do this because I have an other function do something over Qtcpsocket also in my program
I am afraid I don't understand.
How are you expecting a client socket to work if you don't let it connect to the server?
Cheers,
_
my mean I can't disconnectFromHost()
Ah.
If you connect/disconnect in other places, then your start/stop slot could just set/unset a member variable (e.g. setting a bool member to true on start and to false on stop).
The slot that deals with incoming data then just need to check that value before adding text to the text edit, etc.
Cheers,
_
Bookmarks