0

I could not find the sample code about passing qmap to javascript in qt.

what I did ?

I have connected a QObject to the javascript, and could able to emit the signal from qt app, which is captured by javascript.

emit mydata(mapVariable);

In JavaScript: in the alert I am trying to print like:

function myslot(mapVar) {
    alert (" map variable " + mapVar);
 }

Problem:

It is not printing anything. That shows fundamentally I am making a big blunder here. Kindly suggest me how to resolve this issue?..

1
  • What exactly do you plan to do with a QMap in JS? Commented Mar 21, 2013 at 13:04

1 Answer 1

2

Well,

I found the solution, The QVariantMap is the data structure which can be passed to the java script, and can be treated as a JSON in the java script side.

Sign up to request clarification or add additional context in comments.

1 Comment

At least for me passing a QVariantMap to Javascript does not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.