Actually, funnily enough, Qt.fontfamilies is an order of magnitude faster than custom property wrapping the result of ::families. Dunno why. 5s vs 500 ms for the sue case Still, checking on .lncludes(name) in javascript is seemingly also an order of magnitude slower than sending family name to c++ and prematurely exiting from there. 500 ms vs <50ms
On Mon, Oct 23, 2023 at 8:58 PM Ulf Hermann <ulf.herm...@qt.io> wrote: > > doesn't QtQuickGuiProvider do the exact same thing with > QfontDatabase::families? > > Yes, it does. It returns a QStringList. What I mean is that you don't > need a custom C++ base class for your singleton if all you want to do is > expose the font families in pre-wrapped form. The following is enough > for that: > > pragma Singleton > import QtQml > > QtObject { > // Qt5: > property var wrappedFontFamilies5: Qt.fontFamilies() > > // Qt6: > property list<string> wrappedFontFamilies6: Qt.fontFamilies() > } >
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest