You want to "pass a variable through a connection", but the "finished()" signal does not deliver any string data. For example, in order to send integer value, you would use:connect(reply, SIGNAL(finished()), this, SLOT(writefile(filename)));
SIGNAL( my_signal(int) )
So, if you want to send a string, you need to declare and use appropriate signal.
2) You dont use variable names when making connections, you need to use datatypes.accept a filename variable when that signal slot connection is made
This one is not correct:
connect( SIGNAL( a_signal( const QString& myString ), ... ), ...
but this is ok:
connect( SINGAL( a_signal( const QString& ), ... ), ...
Maybe read this first:
Signals and slots
Why are you using a slot that accepts std::strings ? Maybe better question would be, why are you using std::strings in qt-based app, where you have such lovely QString interface ?pass on to writefile(std::string)
-------
edit: Zlatomir was faster![]()
Bookmarks