Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qss font-family not working
Forum Updated to NodeBB v4.3 + New Features

qss font-family not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • MegamouseM Offline
    MegamouseM Offline
    Megamouse
    wrote on last edited by Megamouse
    #1

    Hi,

    After updating to Qt 5.13 I can't use the fonts I added with QApplication::addApplicationFont in my stylesheet anymore.
    Previously I could do something like:

    QWidget {
        font-family: some-font, Arial;
    }
    

    and it would use "some-font".
    Now in Qt 5.13 it falls back to Arial in this case.
    The return value of QApplication::addApplicationFont is greater than -1 and I can query the family just fine.

    Any idea what's wrong?

    1 Reply Last reply
    0
    • MegamouseM Offline
      MegamouseM Offline
      Megamouse
      wrote on last edited by
      #2

      It's really weird because if I remove the fallback to Arial then it at least uses the proper family. Although it's still not the exact look as it was before.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Looks like it could be a regression. Did you already check the bug report system ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        MegamouseM 1 Reply Last reply
        1
        • SGaistS SGaist

          Hi,

          Looks like it could be a regression. Did you already check the bug report system ?

          MegamouseM Offline
          MegamouseM Offline
          Megamouse
          wrote on last edited by Megamouse
          #4

          @sgaist I created a bug ticket.

          Btw. is there an alternative to qss files and how difficult would it be to implement.
          This would need to support custom styles that can be loaded by users just like qss files

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Please post the link to the report so other users may find it more easily.

            Well, you would have to implement your own QStyle sub-class and write a parser that would translate your custom styling language in something that you can paint the way you want it.

            You can take a look at the internal QStylesheetStyle class that does that for Qt's style sheet system.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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