Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] How to change the default font of QML?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 10.4k Views
  • 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 Offline
    O Offline
    owenzhao
    wrote on last edited by
    #1

    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
    0
    • O Offline
      O Offline
      owenzhao
      wrote on last edited by
      #2

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

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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved