Posts made by FKosmale
RE: Whether returned object from Qt.createComponent needs to be destroyed?
RE: QML Settings errors
That was new for me. I had not used app.setOrganizationName/Domain ect. Why are they needed please?
It is used to configure where QSettings where it should persist its data: (see the "Basic usage" section in https://doc.qt.io/qt-5/qsettings.html#details).
Another question is: thus far I've used QtQuickControls in QML apps but never had to set the line QT += quickcontrols2 in the .pro file
You probbaly never accessed any QQC2 functionality from the C++ side before, did you? If you only use it at run time (by using it in your QML files) it should work as long as the necessary files are actually installed.
RE: QThread for QQuickPaintedItem
I'd strongly warn against moving an item which is owned by the QML engine into another thread, as this would thread affinity issues with the internal QQmlData for the object, which is managed by the engine.
Instead, I'd recommend that your MyQQuickPaintedItemWithTimeConsumingMethods has a worker object as a member or that it spawns a worker function in another thread (for intance via QtConcurrent::run).
The expensive method in your class would then just call the corresponding method of the worker, and it would forward the worker's done signal to your classes users.
If the data you work on is cheap to copy, I would just copy it for ease of programming; if the data is expensive to copy, you'll have to pass references to the worker and protect your data with locks.