I use webkit in my application, when i open a website there is javascript who resize my mainwindow. Here the javascript :
<script language="javascript">
function SetWindowSize(w,h) {
var screenH = screen.height;
var screenW = screen.width;
if (window.navigator.appName=="Netscape") {
if (window.navigator.userAgent.indexOf("Firefox") != -1) {
window.resizeTo(w,h - 90);
} else if(window.navigator.userAgent.indexOf("Netscape") != -1) {
window.resizeTo(w,h - 112);
} else {
window.resizeTo(w,h - 112);
}
} else {
window.resizeTo(w,h - 112);
}
window.moveTo((screenW-w)/2,(screenH-h)/2);
}
</script>
<SCRIPT LANGUAGE = "JavaScript">
var dom = document.getElementById?1:0;
var NS4 = (document.layers && !dom )? 1:0;
// do for ns4 resize problem
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if (false) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
if(NS4)
MM_reloadPage(true);
</SCRIPT>
<script language="javascript">
function SetWindowSize(w,h) {
var screenH = screen.height;
var screenW = screen.width;
if (window.navigator.appName=="Netscape") {
if (window.navigator.userAgent.indexOf("Firefox") != -1) {
window.resizeTo(w,h - 90);
} else if(window.navigator.userAgent.indexOf("Netscape") != -1) {
window.resizeTo(w,h - 112);
} else {
window.resizeTo(w,h - 112);
}
} else {
window.resizeTo(w,h - 112);
}
window.moveTo((screenW-w)/2,(screenH-h)/2);
}
</script>
<SCRIPT LANGUAGE = "JavaScript">
var dom = document.getElementById?1:0;
var NS4 = (document.layers && !dom )? 1:0;
// do for ns4 resize problem
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if (false) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
if(NS4)
MM_reloadPage(true);
</SCRIPT>
To copy to clipboard, switch view to plain text mode
I can setup my windows to avoid resizing if my application is not in full screen by using that code :
QSize fixedSize
(1920,
1200);
setMinimumSize(fixedSize);
setMaximumSize(fixedSize);
QSize fixedSize(1920,1200);
setMinimumSize(fixedSize);
setMaximumSize(fixedSize);
setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
To copy to clipboard, switch view to plain text mode
But this don't work in fullscreen mode.
I want to disable resizing from that javascript.
Bookmarks