Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946
[SOLVED]Global Fontloader
-
I'm hoping there's a quick and obvious answer to this one that I'm somehow missing:
I have a font, loaded from file using a Fontloader object, that I use in several different QML files. At the moment, there's a Fontloader object in each file - is there any way to declare a single, global Fontloader, and assign the loaded font to objects across multiple files?
-
@Monomix You can do it using setFont for
QGuiApplication
.QGuiApplication app(argc, argv); app.setFont(QFont("xkcd")); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec();
-
Put it in a Singleton?
-
Thanks for the suggestions! I ended up going with a singleton, in the same way as described here:
http://stackoverflow.com/questions/27692914/where-to-put-qt-qml-non-visual-application-components