Frage

Using the QT Bridge:

myWebView->page()->mainFrame()->addToJavaScriptWindowObject("MyObj", myObjInstance);

myObj has a slot which returns raw data from a table in QList format, but the Javascript side does not understand the data type and returns:

"Error: cannot call myFunction(): unknown type `QList<QVariantMap>' "

I know the Qt Bridge can pass Qlists and QVariantMaps individually, is there a way to send a list of maps?

War es hilfreich?

Lösung

Instead of passing QList, I'm just passing the output as a QVariantList. Reading up on the documentation, it appears that Qt will sort out the conversions for only the most basic raw types, and QVariantList will accommodate the table structure I'm aiming for.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top