[Interest] Send Data to JavaScript
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Mon Apr 12 15:35:38 CEST 2021
On 12/04/2021 15:17, John Schneiderman wrote:
>
> 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?
Are you sure about the transformation? Only certain data types are
supported for the C++ <-> QML data exchange, and I don't believe the one
you're using is:
https://doc.qt.io/qt-5/qtqml-cppintegration-data.html
In other words, you may need to change the datatype / transform it
somehow before giving it to QML. (Also do you want to just _read_ it
from QML or also write into it? The above QML syntax looks a bit sketchy...)
HTH,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210412/f6f11284/attachment.bin>
More information about the Interest
mailing list