Unsolved 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. 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!
-
@JoeCFD I can add the font to QFontDatabase, but it does not make things faster either.
-
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 ?
-
@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.
-
@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.
-
@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.
-
@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.
-
@JoeCFD
You might run your program understrace
, to see whether slowness comes from perhaps trying to access files or not. -
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 ?