Screen aspect ratio and QWebView
-
wrote on 20 Nov 2017, 20:32 last edited by
Is there any way to change the aspect ratio in QGraphicsWebView or QWebView?
The problem is that the LCD screen (800x480) has non-square pixels, thus the web pages are displayed incorrectly, e.g. circles become ovals. In other words, the screen DPI is different for X and Y. Basically I need to scale/zoom only one dimension.
The software is used in Linux with Xorg, however, the graphics driver doesn't have an option to set the aspect ratio, it's a very simple framebuffer.
Currently I'm using Qt 5.7.1.
Thanks for ideas! -
wrote on 20 Nov 2017, 21:47 last edited by
There are at least two ways to do this:
- In user style sheet set
transform: scaleX(...)
(orscaleY
) forhtml
element. Use prefixed version-webkit-tranform
if you don't use QtWebKit 5.212 - Use
QGraphicsView::scale
with different values for x and y (if using QGraphicsWebView)
Note that performance may decrease because of scaling
- In user style sheet set
-
There are at least two ways to do this:
- In user style sheet set
transform: scaleX(...)
(orscaleY
) forhtml
element. Use prefixed version-webkit-tranform
if you don't use QtWebKit 5.212 - Use
QGraphicsView::scale
with different values for x and y (if using QGraphicsWebView)
Note that performance may decrease because of scaling
wrote on 21 Nov 2017, 19:05 last edited by@Konstantin-Tokarev , thanks!
QGraphicsView::scale() works great. - In user style sheet set
2/3