You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, November 15th 2005, 2:55pm

QHttp ID

Hello I send yarious posts to a server. For this I use the following method which returns an id.
int post ( const QString & path, QIODevice * data, QIODevice * to = 0 )
Lets say I have three posts. So i defined three global int variables for the return value of the
post statement.

As signal I use void requestFinished ( int id, bool error ).
In the slot to the requestFinished signal i used the following code

if (variable1==id){.....}
if (variable2==id){.....}
if (variable3==id){.....}

So is this right what I am doing here or is there another way. to do it without defining global variables.

Thanks very much for your answers

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

2

Tuesday, November 15th 2005, 4:08pm

RE: QHttp ID

You can have class member variables or for example a map of some request descriptions to know what id corresponds to what request.