简体   繁体   中英

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

I want to make 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 depend on the button..

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

Please answer this ASAP,, thank you very much!! :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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