mvbhavsar
26th October 2020, 10:05
Hi,
I want to get data returned by Javascript into QT variable. Javascript is getting called successfully and also able to print output using qDebug(). However, I want to process the output and hence needs to be stored in one variable. But it is giving error either no viable overload '=' or variable 'v_data' cannot be implicitly captured in a lambda with no capture-default specified
I have below code
QString CodeMirror::text() const
{
QString v_data;
page()->runJavaScript("editor.getValue()",[this](const QVariant &v){
v_data = v.toString();
});
return v_data;
}
Please help me to resolve the same
Cheers
13565
I want to get data returned by Javascript into QT variable. Javascript is getting called successfully and also able to print output using qDebug(). However, I want to process the output and hence needs to be stored in one variable. But it is giving error either no viable overload '=' or variable 'v_data' cannot be implicitly captured in a lambda with no capture-default specified
I have below code
QString CodeMirror::text() const
{
QString v_data;
page()->runJavaScript("editor.getValue()",[this](const QVariant &v){
v_data = v.toString();
});
return v_data;
}
Please help me to resolve the same
Cheers
13565