Results 1 to 3 of 3

Thread: QWidget state set to maximized but not expanded to full monitor area

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default QWidget state set to maximized but not expanded to full monitor area

    My widget after WindowState set to maximized and called show(), doesn't expand to cover the entire monitor. Instead, expands to only a portion of the screen. Window buttons are showing minimize, restore down & close, which is perfectly fine. Please find the image for idea.maximized.JPG

    I have a scenario like this.
    TopWindow is a QWidget. MainWindow is a QMainWindow.
    MainWindow is added to TopWindow using QVBoxLayout. Note that MainWindow is the only widget added to TopWindow. Now when I set
    Qt Code:
    1. TopWindow->setWindowState( TopWindow->windowState() | Qt::WindowMaximized );
    2. TopWindow->show();
    To copy to clipboard, switch view to plain text mode 

    I checked the TopWindow state by printing debug statements. After creating, it doesn't have any state. So it returns QFlags<Qt::WindowState>(WindowNoState)
    After setting, the state to TopWindow->setWindowState( TopWindow->windowState() | Qt::WindowMaximized );
    And executing TopWindow->show(), the debug statement is printing QFlags<Qt::WindowState>(WindowMaximized) which is correct.

    I have no clue on why the TopWindow isn't expanding to full screen. Please help.
    Last edited by rawfool; 1st December 2016 at 14:49.

  2. #2
    Join Date
    May 2013
    Location
    Bialystok/Poland
    Posts
    13
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWidget state set to maximized but not expanded to full monitor area

    Can you post more of your GUI builder code, with visible initialization and connection between 'TopWindow' and 'MainWindow'

  3. #3
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QWidget state set to maximized but not expanded to full monitor area

    Thanks for the reply, RafalNiewinski

    I guess my issue replicates this bug - https://bugreports.qt.io/browse/QTBUG-16252
    Right now, I'm looking for a work around to bypass this issue.

Similar Threads

  1. Minimized qwdiget always restore to maximized state in Mac
    By jiayang98@qq.com in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2014, 08:21
  2. Replies: 2
    Last Post: 29th April 2014, 09:14
  3. Save and restore maximized state
    By Kwakkie in forum Newbie
    Replies: 7
    Last Post: 25th June 2012, 08:51
  4. Replies: 0
    Last Post: 31st May 2012, 10:33
  5. full screen on specified monitor
    By mgb_qt in forum Qt Programming
    Replies: 2
    Last Post: 3rd August 2010, 18:35

Tags for this Thread

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.