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?
Asked
Active
Viewed 1,418 times
1 Answers
0
You need to handle window.onresize()
event in javascript. Insert following code in your html...
<script text = "javascript">
window.onresize = function(event) {
var newWidth = window.innerWidth;
var newHeight = window.innerHeight;
// Code to adjust your contents..
}
</script>
Hope this helps.

Ammar
- 1,947
- 14
- 15
-
Thanks for your answer I just handled it by putting width and height as 100% instead of absolute value for my embedded flash content in my HTML doc. It solved my problem. – Ashish Mittal Jun 04 '12 at 08:05