Re: [Development] Qt 6.2 QQmlMetaType incompatibility

2021-10-06 Thread Ulf Hermann
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

Re: [Development] Qt 6.2 QQmlMetaType incompatibility

2021-10-06 Thread Uwe Rathmann
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

Re: [Development] Qt 6.2 QQmlMetaType incompatibility

2021-10-06 Thread Ulf Hermann
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

Re: [Development] Qt 6.2 QQmlMetaType incompatibility

2021-10-06 Thread Ulf Hermann
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

Re: [Development] Qt 6.2 QQmlMetaType incompatibility

2021-10-06 Thread Uwe Rathmann
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

Re: [Development] Qt 6.2 QQmlMetaType incompatibility

2021-09-27 Thread Ulf Hermann
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

[Development] Qt 6.2 QQmlMetaType incompatibility

2021-09-24 Thread Uwe Rathmann
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