<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Auto-wrapping non-QObject types when passing to QML]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">Is it possible to automatically convert between two <strong>non-QObject</strong> user-defined types (one is C++-friendly, other is QML-friendly) when passing them to/from QML, similar to how QVector, QList etc. are wrapped and unwrapped as Array-like JavaScript objects?</p>
<p dir="auto">Thanks,<br />
Igor</p>
]]></description><link>https://forum.qt.io/topic/128752/auto-wrapping-non-qobject-types-when-passing-to-qml</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 22:37:28 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/128752.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Jul 2021 07:19:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Auto-wrapping non-QObject types when passing to QML on Thu, 19 Aug 2021 17:01:50 GMT]]></title><description><![CDATA[<p dir="auto">Have you looked at this <a href="https://doc.qt.io/qt-5/qtqml-cppintegration-data.html" target="_blank" rel="noopener noreferrer nofollow ugc">page</a>?</p>
]]></description><link>https://forum.qt.io/post/676694</link><guid isPermaLink="true">https://forum.qt.io/post/676694</guid><dc:creator><![CDATA[fcarney]]></dc:creator><pubDate>Thu, 19 Aug 2021 17:01:50 GMT</pubDate></item><item><title><![CDATA[Reply to Auto-wrapping non-QObject types when passing to QML on Mon, 09 Aug 2021 09:29:47 GMT]]></title><description><![CDATA[<p dir="auto">I am 99% sure this is not possible.</p>
<p dir="auto">For a type to be usable in QML it's members, how to access them, etc. needs to be made available to the QML engine.<br />
This happens through the QT Meta Object System.</p>
<blockquote>
<p dir="auto">To provide some C++ data or functionality to QML, it must be made available from a QObject-derived class.</p>
</blockquote>
<p dir="auto"><a href="https://doc.qt.io/qt-5/qtqml-cppintegration-overview.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qtqml-cppintegration-overview.html</a></p>
<p dir="auto">You could probably implement a set of macros which combine conventions of your codbase with QT macros to create wrapper types around your types which also derive from QObject.</p>
]]></description><link>https://forum.qt.io/post/674948</link><guid isPermaLink="true">https://forum.qt.io/post/674948</guid><dc:creator><![CDATA[ckielwein]]></dc:creator><pubDate>Mon, 09 Aug 2021 09:29:47 GMT</pubDate></item></channel></rss>