Skip to content
  • QFontDialog causing FileFormatException

    Unsolved General and Desktop qfontdialog
    3
    0 Votes
    3 Posts
    430 Views
    C
    @CJha I also run in this problem and debugged a little. The reason is in my case a dynamic loaded otf-font (with QFontDatabase::addApplicationFont). When this font-family is used in a QFont and with setFont to a widget - strangely not with all widgets, but e.g. QTableWidget is one that triggers it always - this exception is thrown, or better, is shown in the output window. Nevertheless, everything is working as expected, the loaded font is used in the widget and the exception doesn't break the application. You also cannot catch it with "try" (it doesn't branch into the catch-path), so I think it is more a kind of warning. And even stranger: when you install the font and use it from system instead loading it from a file, there is no such exception, so I expect the font loading engine doesn't like something in the font file. I tested around and all font files I downloaded from the net force this behaviour.