Re: send & recuve via socket
Is all the code in a .cpp file?
If so, you explicitly need to add the following line to the end of your .cpp file, clean the project, run qmake again and rebuild the project.
I'm assuming the .cpp file is called main.cpp
Code:
#include "main.moc"
Easier would be to put the class definition in a header file, then moc will be invoked automatically.
Re: send & recuve via socket
I wrote it in main.cpp.
what is te meaning of moc at "main.moc"
is my way correct for connecting to the serve?
Re: send & recuve via socket
Quote:
Originally Posted by
nima
I wrote it in main.cpp.
what is te meaning of moc at "main.moc"
It's the meta object compiler. It makes it possible to use Qt signals and slots, among other things.
Quote:
is my way correct for connecting to the serve?
Your slot connection is not correct.
The slot is not part of the app.
You also need to create an object based on Qconnect.
Might I suggest your first learn c++?
Re: send & recuve via socket
tbscope speaks the truth: Please learn how to write a basic Qt application before trying to do socket programming - if you structure your program correctly and actually create an instance of the class that contains your slot, you would have a much better chance of your code doing what you want.
(This should really be in the newbie forum, too)