简体   繁体   English

Qt qApp setFont()

[英]Qt qApp setFont()

I am trying to use the setFont() method to set the font for application wide change. 我正在尝试使用setFont()方法来设置应用程序范围更改的字体。 I tried the following: 我尝试了以下方法:

qApp->setFont();

However, setFont() is not a method of qApp. 但是,setFont()不是qApp的方法。 I am not sure how I can go about setting the font for throughout the application. 我不确定如何为整个应用程序设置字体。 Could anyone please advise on this? 有人可以为此提供建议吗?

Thanks. 谢谢。

Try this: 尝试这个:

//specify a new font.
QFont newFont("Courier", 8, QFont::Bold, true);
//set font of application
QApplication::setFont(newFont);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM