Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [Solved] How to change the default font of QML?

    QML and Qt Quick
    1
    2
    10058
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      owenzhao last edited by

      I try to set by
      @ QmlApplicationViewer viewer;
      viewer.setFont(QFont("MHeiM-C-GB18030-S60"));
      viewer.setSource(QUrl(QLatin1String("qrc:/main.qml")));@

      But it doesn't work.

      1 Reply Last reply Reply Quote 0
      • O
        owenzhao last edited by

        OK. I use this in my main file and get what I want.

        @app->setFont(QFont("MHeiM-C-GB18030-S60"));@

        1 Reply Last reply Reply Quote 0
        • First post
          Last post