PDA

View Full Version : Insert line to textedit



wirasto
18th December 2009, 16:36
How to insert line into textedit ? So far I use this code



QTextCursor cursor(ui->textEdit->textCursor());
cursor.insertHtml("<hr>");


But, hr can't be styled with <hr style="height:2px;color:red;">. I look qt have a class with name QTextLine. But I don't know and haven't a sample how to use that class for insert line into textedit :(

wysota
18th December 2009, 16:59
QTextLine is for representing a line of text, not a graphical object. You can insert a frame, a table or an image with a horizontal line using QTextCursor API.