Oh, I see, yeah, that makes sense. Just singleton a wrapper, The question though is whether this would be a singleton per qmlengine. If it will, then that's a nogo as the list of loaded fonts needs to exist once regardless of how much engines are running
On Mon, Oct 23, 2023 at 5:51 PM Ulf Hermann <ulf.herm...@qt.io> wrote: > > How is instantiating a new c++ instance each time faster than > > referencing a c++ side singleton?? > > This is not what I meant. I mean: > > // singletonbase.h > class SingletonBase : public QObject > { > Q_OBJECT > QML_ELEMENT > // Not a singleton! > Q_PROPERTY( ... ) > public: > Q_INVOKABLE ... > }; > > // Singleton.qml > pragma Singleton > import TheModuleThatHasSingletonBase > > SingletonBase { > property var fontFamilies: find.the.font.families > ... > } >
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest