Hi All,

I want to set line height for QPlainTextEdit, here is my code, but it doesn't 
work, the line height is always same as the font height.
btw: If I change QPlainTextEdit to QTextEdit, then it works.
my env: Qt 5.6.2 mingw version, Win 10 64 bit

#include"dialog.h"
#include"ui_dialog.h"


Dialog::Dialog(QWidget*parent):
QDialog(parent),
ui(newUi::Dialog)
{
ui->setupUi(this);


ui->edit->setPlainText("ABC\nDEF");
//ui->edit->setText("ABC\nDEF");
QTextCursortc=ui->edit->textCursor();
QTextBlockFormatfmt=tc.blockFormat();
fmt.setLineHeight(80,QTextBlockFormat::FixedHeight);
tc.select(QTextCursor::Document);
tc.setBlockFormat(fmt);
}


Dialog::~Dialog()
{
deleteui;
}


Best regards
Nus

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to