[solved] C++11 functor not changing variable declared outside
-
Hi,
i try to assign a value to a variable inside a functor.
Inside the functor the value seems ok, but outside the value is not changed, any ideas?My code looks like this:
@
double lat = 0.0;
double lon = 0.0;m_webView->page()->runJavaScript("document.documentElement.contentEditable = true"); m_webView->page()->runJavaScript("document.getElementById(\"markerLat\").value", [&](const QVariant &result) { lat = result.toDouble(); qDebug() << " lat in functor=" << lat; // HERE lat IS OK! } ); // HERE LAT IS NOT SET, BUT WHY? qDebug() << " lat outside functor=" << lat;
@
Greetings
Nando -
The javascript is ran asynchronously ?