[Interest] QML/C++ interaction in Qt6

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Mon Sep 14 16:43:56 CEST 2020


Il 14/09/20 15:54, Jérôme Godbout ha scritto:
> //
> 
> how does the Person class is link to the People name exactly?!?
> 

QML_IMPORT_NAME does the link.

The "equivalent" of registering a QML_ELEMENT class, using the syntax of 
old registrations is something like

>   qmlRegisterType<CLASS_WITH_QML_ELEMENT>("QML_IMPORT_NAME", QML_IMPORT_MAJOR_VERSION, QML_IMPORT_MINOR_VERSION, "CLASS_WITH_QML_ELEMENT")

In your case that translates to

>   qmlRegisterType<Person>("People", 1, 0, "Person")

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: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200914/0808ba45/attachment.bin>


More information about the Interest mailing list