0

I have custom text browser class derived from QTextBrowser class. Also I have QTextDocument in it with formatted html text and several resource images. QTextBrowser has zoom in/zoom out option that make font of document larger or smaller.But the size of all images remains the same. How can I also change size of all images in QTextDocument while performing zoom in/zoom out?

Vasyl
  • 404
  • 1
  • 6
  • 19
  • As the docs say, QTextEdit zoom methods do not change the size of any images. Using `QWebView` would be a better choice, it zooms images with the rest of the content. `webView->setHtml(textDocument.toHtml())`. – svlasov Feb 25 '15 at 10:31
  • Can I set QTextDocument into QWebView? I did not find such possibility. – Vasyl Feb 27 '15 at 10:25
  • You can, read the last line of my comment. – svlasov Feb 27 '15 at 10:27
  • Thanks a lot for the tip! Tell me also please, how can I attach images to my view. When I use QTextDocument with QTextBrowser I add all required images and dynamically generated css as resources into my QTextDocument and all html content are displayed properly. When I use QTextDocument with QWebView I do the same thing but no images displayed in my web view. What do I do wrong? – Vasyl Mar 03 '15 at 09:41

0 Answers0