Results 1 to 8 of 8

Thread: Disable resize events

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    12

    Default Re: Disable resize events

    My problem is when my application is in fullscreen mode my mainwindow can be resized by another application. If it not in fullscreen this work good.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Disable resize events

    What other application? What does WebKit has to do with it?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2009
    Posts
    12

    Default Re: Disable resize events

    I use webkit in my application, when i open a website there is javascript who resize my mainwindow. Here the javascript :
    Qt Code:
    1. <script language="javascript">
    2. function SetWindowSize(w,h) {
    3. var screenH = screen.height;
    4. var screenW = screen.width;
    5. if (window.navigator.appName=="Netscape") {
    6. if (window.navigator.userAgent.indexOf("Firefox") != -1) {
    7. window.resizeTo(w,h - 90);
    8. } else if(window.navigator.userAgent.indexOf("Netscape") != -1) {
    9. window.resizeTo(w,h - 112);
    10. } else {
    11. window.resizeTo(w,h - 112);
    12. }
    13. } else {
    14. window.resizeTo(w,h - 112);
    15. }
    16. window.moveTo((screenW-w)/2,(screenH-h)/2);
    17. }
    18.  
    19. </script>
    20.  
    21. <SCRIPT LANGUAGE = "JavaScript">
    22. var dom = document.getElementById?1:0;
    23. var NS4 = (document.layers && !dom )? 1:0;
    24.  
    25. // do for ns4 resize problem
    26. function MM_reloadPage(init) { //reloads the window if Nav4 resized
    27. if (init==true) with (navigator) {if (false) {
    28. document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    29. else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    30. }
    31. if(NS4)
    32. MM_reloadPage(true);
    33. </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 :
    Qt Code:
    1. QSize fixedSize(1920,1200);
    2. setMinimumSize(fixedSize);
    3. setMaximumSize(fixedSize);
    4. 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.

Similar Threads

  1. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03
  2. Double click resize window disable
    By MarkoSan in forum Qt Programming
    Replies: 3
    Last Post: 13th May 2008, 11:35
  3. Replies: 2
    Last Post: 22nd January 2008, 16:10
  4. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00
  5. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.