Results 1 to 2 of 2

Thread: Issues getting correct size of Widget on main window maximization

  1. #1
    Join Date
    Mar 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Issues getting correct size of Widget on main window maximization

    Hello everyone. I'm having a strange issue that I can't figure out and was hoping someone here might know what the problem is.

    I have a few Widgets wrapping OpenGL canvases which are initialized in the Main window Constructor using QQidget::CreateWindowContainer and then added to an HBox layout.

    When I modify the main window dimensions manually, the resize event is triggered on the Widgets, in which case width() and height() give the correct dimensions of the widgets and every works as expected. However, when the window is maximized via the maximize button, the event does not trigger for the Widgets.

    I tried calling the resize even handler for the Widgets from the main windows resize event handler. This works as far as ensuring that the Widgets resizeEvent method is called. However, calling width()/height() then gives the width/height of the main window instead of the Widgets. Calling width()/height() from the same method gives the Widgets dimensions when the event is triggered by manually drag adjusting the size of the window.

    Anyone have any idea what is going on here?

    I am working with QT 5.2 on Ubuntu 13.06 with the Gnome 3 desktop manager.

    Thanks in Advance.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Issues getting correct size of Widget on main window maximization

    If resizing the container widget is not resizing the contained widgets then the most likely cause is that the horizontal layout has not been applied to the container. We would need to see your setup code to be more specific.

Similar Threads

  1. Replies: 3
    Last Post: 28th August 2013, 12:53
  2. Main Window Size not Scaled Properly
    By alok9871 in forum Newbie
    Replies: 7
    Last Post: 13th January 2013, 21:18
  3. main window gets wider than screen size
    By shanchathuranga in forum Qt Programming
    Replies: 1
    Last Post: 16th March 2012, 14:45
  4. Replies: 3
    Last Post: 30th December 2010, 15:34
  5. Main Window size problem
    By frenk_castle in forum Newbie
    Replies: 2
    Last Post: 20th December 2009, 10:49

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.