Results 1 to 5 of 5

Thread: How to maximize window to full screen ?

  1. #1
    Join Date
    Oct 2012
    Posts
    6
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default How to maximize window to full screen ?

    I am using Qt4.83 with Mac OSX 10.8 and windows 7.

    I have to fix the problem of maximizing the window to full screen when the user clicks on "Maximize" button on menu bar.


    I wanted to fix it within "mainwindow.ui" (rather than "ui_mainwindow.h" , only because it is generated code and all the changes made here will be lost in recompile). I tried playing around with the property "maximumSize" for main window.I tried to remove this property, set the values to "0" etc. - but nothing works on Mac OSX 10.8. Even I tried with generated file "ui_mainwindow.h" by commenting out "MainWindow->setMaximumSize()" but it did not work. I mean, the effect was, the main window simply disappeared and nothing visible on the screen.


    However, I found that for Windows (windows 7 and XP), if I commented out "MainWindow->setMaximumSize()" , it worked as desired.

    My question is - how can I maximize the main window to full screen for Mac OSX and Windows , preferably using mainwindow.ui and not from "ui_mainwindow.h"?

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to maximize window to full screen ?

    just do it in code.

    QWidget::showMaximized
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Nov 2012
    Posts
    47
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How to maximize window to full screen ?

    this->setWindowState(Qt::WindowMaximized) or
    MainWindow->setWindowState(Qt::WindowMaximized)

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to maximize window to full screen ?

    or widget->showMaximized()
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Jun 2011
    Location
    Poland
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to maximize window to full screen ?

    If you want to show window in full screeen mode use: widget.showFullScreen().

Similar Threads

  1. what Function use for Maximize the screen in QML?
    By chong_kimkeang in forum Newbie
    Replies: 2
    Last Post: 19th November 2012, 07:11
  2. maximize grid with maximize window
    By bibhukalyana in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2011, 08:16
  3. Set full screen a dialog box
    By fantom in forum Qt Programming
    Replies: 3
    Last Post: 8th March 2011, 11:54
  4. How to set my mobile app as full screen
    By dineshkumar in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 3rd February 2011, 16:40
  5. how to display a window full screen??
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 8th May 2006, 12:07

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.