QTextEdit
-
-
hi
The editor seems to like it.
code looks like
<html><head/><body><p><span style=" font-size:8.25pt; font-weight:600;"> TEST</span></p></body></html> -
If you want in QTextEdit.
use
QTextEdit m_textedit = new QTextEdit;
m_textedit->append("\t Text");it will append tab space and then prints text
-
And if you want to have the text bold and increase font size
Qt have provided setStyleSheet methodYou can use it
m_textedit->setStyleSheet("font-size:8.25pt; font-weight:600;");
-
@Pradeep-Kumar So I need to setStyleSheet for every HTML tag, and what about other tags like inserting image? Don't think that It's good solution.
As I see QTextEdit can't work with both type of symbols, am I correct? -
@bulgakovk
Hi
It can work with tabs.
Just right click a textedit and use the editor.
You can then see the
HTML code directly. -
as specified by @VRonin
you can use  and if you want to insert image also you can use tags as well.
QTextDocumentFragment fragment; fragment = QTextDocumentFragment::fromHtml("<img src=':/new/prefix1/images/image.png'>"); m_textedit->textCursor().insertFragment(fragment);