Hi,
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" i
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
But how to tell the engine to make use of it when executing a property
assignment ?
You mark the type with Q_GADGET and QML_ANONYMOUS. Then moc and
qmltyperegistrar should pick it up automatically ... Provided you
actually use qmltyperegistrar, of course. If not, I recommend converting
to sta
Hi Uwe,
instead of using QQmlMetaType::registerCustomStringConverter() you
> can add a static create() function that takes a QJSValue as
argument to your class or have a ctor that takes QJSValue. Then
register the
type using QML_ANONYMOUS and it should be possible to create it from
any JavaScri
Hi Ulf,
thanks for the hints.
instead of using QQmlMetaType::registerCustomStringConverter() you > can add a static create() function that takes a QJSValue as argument
> to your class or have a ctor that takes QJSValue. Then register the >
type using QML_ANONYMOUS and it should be possible to
Hi,
instead of using QQmlMetaType::registerCustomStringConverter() you can
add a static create() function that takes a QJSValue as argument to your
class or have a ctor that takes QJSValue. Then register the type using
QML_ANONYMOUS and it should be possible to create it from any JavaScript
v
Hi,
when testing the Qt 6.2 rc I noticed that registering custom string
converters with
QQmlMetaType::registerCustomStringConverter() has been dropped.
( Yes, QQmlMetaType is from the private API where no compatibility
policies are made )
Actually I'm not interested in having a custom strin