码迷,mamicode.com
首页 > 其他好文 > 详细

设置QTextEdit的行高和行间距

时间:2018-11-29 20:11:26      阅读:1915      评论:0      收藏:0      [点我收藏+]

标签:extc   block   www   sha   line   Fix   doc   https   edit   

设置QTextEdit的行高
    QTextCursor textCursor = ui->textEdit->textCursor();
    QTextBlockFormat textBlockFormat;
    textBlockFormat.setLineHeight(40, QTextBlockFormat::FixedHeight);//设置固定行高
    textCursor.setBlockFormat(textBlockFormat);
    ui->textEdit->setTextCursor(textCursor);

设置QTextEdit的行间距

      QTextCursor textCursor = ui->textEdit->textCursor();
    QTextBlockFormat textBlockFormat;
    textBlockFormat.setBottomMargin(10);
    textCursor.setBlockFormat(textBlockFormat);
    ui->textEdit->setTextCursor(textCursor);

参考文章:https://www.yuque.com/docs/share/149369ec-0834-4087-bcbb-72510d4df9b3

设置QTextEdit的行高和行间距

标签:extc   block   www   sha   line   Fix   doc   https   edit   

原文地址:http://blog.51cto.com/4754569/2323961

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!