using settext() and sethtml() to display output in text browser at same time
Hello,
I am newbie in qt.
I want to ask that how I can display output text and a link in html in text browser when I use settext() and setHtml();
Re: using settext() and sethtml() to display output in text browser at same time
You mean somehting like this?
Code:
QString plainText
("some plain\ntext");
QString html
= QString("<pre>%1</pre><a href='%2'>%2</a>").
arg(plainText
).
arg(url
);
ui->textBrowser->setHtml(html);
Re: using settext() and sethtml() to display output in text browser at same time
Yeah, it is the solution for my question. Thank you so much !!
But may I can change font of plaintext ??
Re: using settext() and sethtml() to display output in text browser at same time
Use this link to the Qt documentation to find the answers to your questions. You'll have to research the HTML4 documentation if you don't know how to use these HTML tags.