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. Qt widget update is slow since loading qt font is very slow.
Forum Updated to NodeBB v4.3 + New Features

Qt widget update is slow since loading qt font is very slow.

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 920 Views 2 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.
  • JoeCFDJ Offline
    JoeCFDJ Offline
    JoeCFD
    wrote on last edited by
    #1

    It looks like loading some specific font with Qt 5.9.5 can be very slow if a lot of fonts are installed in Ubuntu. This causes slow update of qt widgets. Sure, I can uninstall some useless fonts to make things faster. Any other ways to speed it up? Thanks for help!

    JoeCFDJ SGaistS 2 Replies Last reply
    0
    • JoeCFDJ JoeCFD

      It looks like loading some specific font with Qt 5.9.5 can be very slow if a lot of fonts are installed in Ubuntu. This causes slow update of qt widgets. Sure, I can uninstall some useless fonts to make things faster. Any other ways to speed it up? Thanks for help!

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      @JoeCFD I can add the font to QFontDatabase, but it does not make things faster either.

      1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        It looks like loading some specific font with Qt 5.9.5 can be very slow if a lot of fonts are installed in Ubuntu. This causes slow update of qt widgets. Sure, I can uninstall some useless fonts to make things faster. Any other ways to speed it up? Thanks for help!

        SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        @JoeCFD said in Qt widget update is slow since loading qt font is very slow.:

        It looks like loading some specific font with Qt 5.9.5 can be very slow if a lot of fonts are installed in Ubuntu.

        Can you be more precise ?

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

        JoeCFDJ 1 Reply Last reply
        1
        • SGaistS SGaist

          Hi,

          @JoeCFD said in Qt widget update is slow since loading qt font is very slow.:

          It looks like loading some specific font with Qt 5.9.5 can be very slow if a lot of fonts are installed in Ubuntu.

          Can you be more precise ?

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #4

          @SGaist Some default installation of Ubuntu can have quite some fonts or some users may install a lot of fonts on purpose. In one of my qt apps some labels use font(Open Sans Regular) and it is not installed. It takes long for them to be visible after they are created. The app is traced and it turns out that it runs about 7000 execution lines to find the font(in vain). I added this font to QFontDatabase in the app and no help.

          On another machine I removed most useless fonts and keep only a few. The app is happy now. Why is Qt so slow at finding some font? I googled a bit and it seems a problem around Qt 5.9.1 ish. I am using 5.9.5.

          1 Reply Last reply
          0
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @JoeCFD said in Qt widget update is slow since loading qt font is very slow.:

            Why is Qt so slow at finding some font?

            You tell Qt to use a font, it tries to use it but can't find it. The next time the label needs to be rendered the same starts over again. So make sure the font exits before trying to use it.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            JoeCFDJ 1 Reply Last reply
            2
            • Christian EhrlicherC Christian Ehrlicher

              @JoeCFD said in Qt widget update is slow since loading qt font is very slow.:

              Why is Qt so slow at finding some font?

              You tell Qt to use a font, it tries to use it but can't find it. The next time the label needs to be rendered the same starts over again. So make sure the font exits before trying to use it.

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #6

              @Christian-Ehrlicher Qt is still slow after the font is added to QFontDatabase in my app. I would think it is qt bug in 5.9.5. My solution to uninstall most fonts is not ideal. I posted the problem here to let other people know they might come across the same issue.

              JonBJ 1 Reply Last reply
              0
              • Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @JoeCFD said in Qt widget update is slow since loading qt font is very slow.:

                Qt is still slow after the font is added to QFontDatabase in my app.

                Please check if the font is really found - I would guess not.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                0
                • JoeCFDJ JoeCFD

                  @Christian-Ehrlicher Qt is still slow after the font is added to QFontDatabase in my app. I would think it is qt bug in 5.9.5. My solution to uninstall most fonts is not ideal. I posted the problem here to let other people know they might come across the same issue.

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @JoeCFD
                  You might run your program under strace, to see whether slowness comes from perhaps trying to access files or not.

                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi
                    Just as a note. Im using Qt 5.9.1 in Mint linux and have tons of font installed to use with inkscape and
                    i never saw this effect in Qt.
                    Could it be a broken font file of sorts ?

                    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