2017-11-18 202 views
0

有什麼方法可以用QGraphicsWebView或QWebView來改變縱橫比嗎? 問題是LCD屏幕(800x480)具有非方形像素,因此網頁顯示不正確,例如,圈子變成橢圓形。 該軟件在Linux中與Xorg一起使用,但是,圖形驅動程序沒有設置寬高比的選項,這是一個非常簡單的幀緩衝區。屏幕縱橫比和QGraphicsWebView或QWebView

感謝您的想法!

+0

得到了Qt的論壇的人很好的建議: https://開頭論壇.qt.io /主題/ 85209 /屏幕縱橫比和 - qwebview –

回答

0

我通過複製康斯坦丁託卡列夫在forum.qt.io提供了答案:

There are at least two ways to do this: 
In user style sheet set transform: scaleX(...) (or scaleY) for html 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 

原: https://forum.qt.io/topic/85209/screen-aspect-ratio-and-qwebview