PDA

View Full Version : how to adjust sizes of QTextBrowser?



Pan Wojtas
7th February 2006, 21:40
I'd like to make a QTextBrowser (as a separated window - not child), but it must display all it's contents without scrolling.
example code:

QTextBrowser *bro = new QTextBrowser(0);
bro->setText("<img src=\"image.jpg\" border=\"0\" /> and sample text");
bro->show();
As a result, QTextBrowser has always the same sizes, which doesn't fit it's contents.
What can I do to fit QTextBrowser exactly to it's contents?

bro->setFixedSize(bro->sizeHint());
doesn't work :(

Chicken Blood Machine
7th February 2006, 22:43
Why don't you try with a QLabel instead?

Pan Wojtas
7th February 2006, 23:25
Why don't you try with a QLabel instead?
I'd like to have links (and could open them with browsers) there.