[Development] Qt 6.2 QQmlMetaType incompatibility
Uwe Rathmann
Uwe.Rathmann at tigertal.de
Thu Oct 7 08:28:03 CEST 2021
Servus Ulf,
> What part of the docs do you mean here?
https://doc.qt.io/qt-6/qqmlengine.html#QML_ANONYMOUS
"Declares the enclosing type to be available, but anonymous in QML.
The type cannot be created or used as property type, but when passed
from C++, it is recognized."
Thought that "property type" is supposed to be the type of a property
being exposed to QML ?
I can file a bug report if you agree, that the docs are wrong - or at least
misleading ?
> You can very well have anonymous value types as C++-declared > properties of other types. It may be that we're still missing some >
bits and pieces for the creation from JS values to work. So far the >
approach is only used by the QtQuick value types. Some of those are >
indeed anonymous, but all of them happen to use the foreign/extended >
hack. It should also work without that hack, though. Feel free to > open
a bug report or submit a patch.
As QML_ANONYMOUS is only a macro for "Q_CLASSINFO("QML.Element",
"anonymous")"
I was trying to identify, where "QML.Element" gets processed and didn't
find something
beside code of the qmltyperegistrar tool.
I also read your additional reply as qmltyperegistrar being mandatory
for my use case.
As my QSkinny project is currently used in pure C++ projects only I have
to confess,
that I did not pay enough attention to the QML aspects and static type
registration
( https://www.qt.io/blog/qml-type-registration-in-qt-5.15 ) should of
course be the way to go.
Will do my homework.
Thanks,
Uwe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20211007/58e9a7c8/attachment.html>
More information about the Development
mailing list