开发者

Is there a way to retrieve the Writing System for a given Language in Qt?

I recently upgraded an existing Qt application to utilize QTranslator for deployment in multiple countries. The previous programmer defined all the fonts in style sheets, but it seems that not all languages are supported by the designated font-family and this is causing QLabels to lose their styling. My solution is to dynamically determine a suitable font (we're not at the stage where we might need custom fonts)开发者_运维百科.

Is there a way to use the the result of QLocale::language() to generate a QFontDatabase::WritingSystem so I can run QFontDatabase::families() and query the results for an appropriate font?


I cannot find a built-in function for Qt 4.7, but you can create an associative array linking languages from QLocale::language() to QFontDatabase::WritingSystem values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜