开发者

How to set font Bold, Italic, and Underlined in Qt?

开发者 https://www.devze.com 2023-01-03 19:27 出处:网络
I want to ma开发者_Python百科ke a program that\'s like a simple text editor using Qt 4.6.2. When the user block any text in a TextEdit and click on a button, the text will be bold/italic/underlined de

I want to ma开发者_Python百科ke a program that's like a simple text editor using Qt 4.6.2.

When the user block any text in a TextEdit and click on a button, the text will be bold/italic/underlined depending on the button..

I'm a beginner in Qt Programming, so if Possible, can you insert the programming code in Qt to do that?


See setFontWeight for bold, setFontItalic for italic and setFontUnderline for underline. These methods set the corresponding attribute of the selected text.

0

精彩评论

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