문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top