Qlabel Setting Line Spacing

Source: Internet
Author: User

Qlabel supports HTML, so you can set the line spacing of text in line Qlabel with the following code:

1 QString text;2Text.append ("<p style= ' line-height:150% ' >"). Append (tr ("Room Number:"). Append (M_roomid). Append ("</p>")3. Append ("<p style= ' line-height:150% ' >"). Append (tr ("Exam Content:"). Append ("</p>")4. Append ("\ n"). Append ("<p style= ' line-height:150% ' >"). Append (M_text). Append ("</p>");//<p style= ' line-height:150% ' > "Content" </p>5 6Ui->label->setText (text);7Ui->label->setwordwrap (true);//Wrap Line Settings

You can also set other effects in the label, such as fonts, font colors, and so on, in the HTML language.

Qlabel Setting Line Spacing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.