On 10/23/23 11:41, NIkolai Marchenko wrote:
Qt 5.15.2

I've encountered a strange behaviour while trying to pass the output of 
QFontDatabase::families() into qml via Q_PROPERTY of a singleton class.
Essentially - I have a ton of qml items accessing this property in their 
initialization and every one of them is doing an .includes search on it.

What happened is it has produced an absolutely massive slowdown and after 
perfing what's happening there it seems like qml engine is repeatedly 
recreating this stringlist inside the engine and garbage collecting it on every 
access instead of keeping it around. Is there something that can be done about 
it and what is even happening there?


Sounds to me, you are looking for a QStringListModel.

Cheers,
Frank
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to