0

I'm developing a Windows app using Qt 6.9 and QML, and want to use the FluentWinUI3 style. So I followed the page, adding import QtQuick.Controls.FluentWinUI3 on top of my MainWindow.qml file.

However, this style uses Segoe UI as theme font, which has no support for CJK characters. The Config.qml of this style is full of statements like:

readonly property QtObject button: QtObject { // and many other objects
    readonly property QtObject checked: QtObject { // and many other status
        readonly property QtObject label: QtObject {
            ...
            readonly property string fontFamily: "Segoe UI"
            ...
        }
    }
}

How can I override the defualt font style globally?

I have tried to use QGuiApplication::setFont(), and only if I don't import FluentWinUI3 does it take effect.

I know I can change font for a particular component by setting its font.family property like

Button {
    text: "测试"
    font.family: "Source Han Sans SC"
}

But I don't want to do this for every item, it takes too much effort. Using FontLoader seems similar as changing font one by one.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.