Originally Posted by
kars
First of all I'm totally new in QT... my boss got a program (sourcecode) based on Qt 4.7.4 and asked me to change parts of that sourcecode. I'm actually a borland c++ programmer.
Curious, the latest released Qt is 4.7.3. It's unlikely to have a bearing on this problem though.
My questions are:
1) When I just use the connect() function I can't compile. Has something changed the last 1 1/2 years? I'm getting "Invalid conversion from QNetWorkReply* to SOCKET... I' tried QObject::connect function and it compiles correctly.
The standard socket connect(), declared in sys/socket.h, and QObject::connect() are two different beasts. If you are using the Qt classes to do this transfer then you should not need the low-level socket code at all, i.e. remove "#include <sys/socket.h>'
2) The application is running without a gui and somewhere I read that a Q(Core)Application is needed to work with QEventloop and QTimer... is that correct and how should I implement that?
If the application code you started with was complete then it should already have that. Look for main() and it will probably look like:
int main(int argc, char *argv[])
{
// some object creation
return app.exec(); // the event loop
}
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
// some object creation
return app.exec(); // the event loop
}
To copy to clipboard, switch view to plain text mode
Well, these questions sound pretty stupid but I just can't figure it out how the sourcecode should look like. Any help would be apprechiated.
The docs for Qt a pretty good. You could start by looking at Network Examples
Bookmarks