How to stretch/shrink HTML Page to fit in QWebView window
问题 I am using QWebView to render a html page using setHTML method. In the html page body section I am mentioning width and height for the html page, if we are changing the width and hegiht of the QWebView window at run time by calling setGeometry(x,y,w,h), then how to make the html page adjust itself to fit the content fully in streched QWebView window? 回答1: You need to handle window.onresize() event in javascript. Insert following code in your html... <script text = "javascript"> window