whites11
24th April 2010, 11:24
hi.
my need is to pass data between a method that calls an async request and the slot that is connected to the relative signal.
an example to make this clear:
void foo()
{
QString str1 = "str1";
connect(requestManager, SIGNAL(requestFinished()), this SLOT(slot2()));
this->requestManager->startRequest(); //emits requestFinished()
}
void slot2()
{
//here i need str1 from foo
}
requestManager is an unmodifiable class.
one way is to save str1 as a member of the class, but i'm wondering if there is a better way to do this.
thanks in advance for any answer
my need is to pass data between a method that calls an async request and the slot that is connected to the relative signal.
an example to make this clear:
void foo()
{
QString str1 = "str1";
connect(requestManager, SIGNAL(requestFinished()), this SLOT(slot2()));
this->requestManager->startRequest(); //emits requestFinished()
}
void slot2()
{
//here i need str1 from foo
}
requestManager is an unmodifiable class.
one way is to save str1 as a member of the class, but i'm wondering if there is a better way to do this.
thanks in advance for any answer