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 919 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.
  • J Offline
    J Offline
    JoeCFD
    wrote on 28 May 2020, 15:04 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!

    J S 2 Replies Last reply 28 May 2020, 15:44
    0
    • J JoeCFD
      28 May 2020, 15:04

      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!

      J Offline
      J Offline
      JoeCFD
      wrote on 28 May 2020, 15:44 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
      • J JoeCFD
        28 May 2020, 15:04

        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!

        S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 28 May 2020, 18:03 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

        J 1 Reply Last reply 28 May 2020, 19:12
        1
        • S SGaist
          28 May 2020, 18:03

          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 ?

          J Offline
          J Offline
          JoeCFD
          wrote on 28 May 2020, 19:12 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
          • C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 28 May 2020, 19:30 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

            J 1 Reply Last reply 28 May 2020, 19:33
            2
            • C Christian Ehrlicher
              28 May 2020, 19:30

              @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.

              J Offline
              J Offline
              JoeCFD
              wrote on 28 May 2020, 19:33 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.

              J 1 Reply Last reply 29 May 2020, 19:41
              0
              • C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 29 May 2020, 19:30 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
                • J JoeCFD
                  28 May 2020, 19:33

                  @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.

                  J Offline
                  J Offline
                  JonB
                  wrote on 29 May 2020, 19:41 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
                  • M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 29 May 2020, 20:59 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

                    1/9

                    28 May 2020, 15:04

                    • Login

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