Re: [Interest] qt_add_qml_module() RESOURCES vs qt_add_resources()

2024-02-16 Thread Mike Trahearn via Interest
My second advice is more for Ulf - despite your best efforts to educate people in how QML modules have changed the way we should think about our QML organisation since Qt 5, people still have trouble grasping these points: a) what is a QML module anyway? You say wht? Yes, people are still on

Re: [Interest] qt_add_qml_module() RESOURCES vs qt_add_resources()

2024-02-16 Thread Mike Trahearn via Interest
I have been watching the progression of this... Ulf is right. I've had this out with him many times inw writing and in person due to our out "strange non conforming" repository setup. However in our case, we do not reak any of the proper QML Module boundaries so once we apply the various allowed

Re: [Interest] controlling QML singleton lifetime from C++

2024-02-16 Thread Stefan Seefeld
Hi Ulf, thanks for the prompt reply ! So for avoidance of doubt: none of the objects for which the `QJSEngine::CppOwnership` flag is set will actually be deleted, right ? Rather, only any QML references will be cleared, so the next access will have to call my `create()` function again. If that's

Re: [Interest] qt_add_qml_module() RESOURCES vs qt_add_resources()

2024-02-16 Thread Ulf Hermann via Interest
Hi Ekke, not really sure what I'll have to do - will read again tomorrow and trying to understand ;-) BTW: this is the (qml) structure of my apps: qml/Main.qml     pages/MyPage.qml /xxx.qml     popups/MyPopup.qml     ... In QML these are 3 Modules: * A module called "qml" with

Re: [Interest] controlling QML singleton lifetime from C++

2024-02-16 Thread Ulf Hermann via Interest
Hi Stefan, I'd like to be able to replace that singleton instance over the course of the application's workflow, but I couldn't find any indication in the docs for whether that's allowed, or whether that might lead to undefined behaviour. There is QQmlEngine::clearSingletons(), but it's not

[Interest] controlling QML singleton lifetime from C++

2024-02-16 Thread Stefan Seefeld
Hello, as per the Qt documentation ( https://doc.qt.io/qt-6/qqmlengine.html#QML_SINGLETON), I'm using a static `create()` function to inject an existing C++ object as singleton into the QML runtime. I'd like to be able to replace that singleton instance over the course of the application's workfl