Have you tried with a QVariantMap for your Q_PROPERTY instead? Will be dull to 
convert from QVAriant to list and string for each values, but will probably 
work.

Jérôme Godbout, B. Ing.

Software / Firmware Team Lead
O: (418) 682-3636 ext.: 114
C: (581) 777-0050
godbo...@dimonoff.com<mailto:godbo...@dimonoff.com>
[signature_487195805]<https://www.dimonoff.com/>
dimonoff.com<https://www.dimonoff.com/>
1015 Avenue Wilfrid-Pelletier,
Québec, QC G1W 0C4, 4e étage


From: Interest <interest-boun...@qt-project.org> on behalf of John Schneiderman 
<jschneider...@gog.com>
Date: Monday, April 12, 2021 at 9:17 AM
To: qt qt <interest@qt-project.org>
Subject: [Interest] Send Data to JavaScript
I'm attempting to send data to the JavaScript side of the QWebEngine
code. This data is being emitted via a signal. The registration is
connected correctly as other components work just fine, though they're
emitting only a single int or QString.

An example of what I'm attempting is below:

class Demo : QObject

{

     Q_OBJECT

public:

         Q_PROPERTY(
             QMap<QString, QStringList> mappings
                 MEMBER mappings_
                 NOTIFY mappingsChanged
         )

};


What I'm expecting is that mappings would be transformed on the
JavaScript side as:

mappings {

     "key" : ["abc", "def"]...

}

However, when I try to view the data in the emitted signal it's always
null. Any suggestions where I should look for more answers or perhaps
I'm going in an incorrect direction?

Thanks,


--
John Schneiderman
Senior Software Engineer
CDPR Squad
GOG.com
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to