in qt6 QJSValue call not work properly
Unsolved
Qt 6
-
Hi!
I'm trying to port the code from qt5._
i have codevoid JSModule::Event(std::string name, std::string data) { if (EventFunc.isCallable()) { QJSValueList args; args << QJSValue(QString::fromStdString(name)) << QJSValue(QString::fromStdString(data)); QJSValue result = EventFunc.call(args); if (result.isError()) { qWarning()<< result.toString(); } } }
function Event(name, data){ console.Log("name=" + name); }
writes to the console
Could not convert argument 0 at Event@:54 TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed.
help me please