April 12, 2012

Chirieac Chirieac
Lab Rat
5 posts

QGraphicsWebView setRenderHints alternative

 

Hi,

I’m using QGraphicsWebView and the scaled images rendered into it are pixelated. If I use QWebView and call its setRenderHints function like this:

  1. setRenderHints(QPainter::SmoothPixmapTransform);

the images are rendered very nice.

How can I accomplish this with the QGraphicsWebView? Is there an alternative to set SmoothPixmapTransform ?

1 reply

April 12, 2012

Chirieac Chirieac
Lab Rat
5 posts

Sorry, my bad! I was using an older version of Qt when tested this.
I set the render hints like this in the constructor of the classes inherited from QGraphicsWebView and QGraphicsView:

  1. setRenderHint(QPainter::SmoothPixmapTransform);
  2. setRenderHint(QPainter::Antialiasing);
  3. setRenderHint(QPainter::TextAntialiasing);
  4. setRenderHint(QPainter::HighQualityAntialiasing);

but the scaled images still looks pixelated.
(The images are scaled from CSS by setting the width property).

Is there a way to make those images look nicer?

 
  ‹‹ Qt webkit fails to load external javascripts      Can’t load full html code from page ››

You must log in to post a reply. Not a member yet? Register here!