Results 1 to 8 of 8

Thread: Open a QMainWindow in full screen mode?

  1. #1
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Open a QMainWindow in full screen mode?

    I have a simple QmainWindow and I want it to get open in full screen mode, just like any other program in my computer (Firefox, IE, etc...)

    How?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Open a QMainWindow in full screen mode?

    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Open a QMainWindow in full screen mode?

    Actually I solve that... the problem I have now is that a QTextBRowser is inside the QMainWindow, but I cannot show the QTextBRowser in the full window.

    How to I make, so the QTextBroser will occupy the whole Main Window?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Open a QMainWindow in full screen mode?

    As it says in the QWidget::showFullScreen() docs:
    Calling this function only affects windows.
    You would have to reparent the text browser as a top level widget for the time you want it to be shown full screen.
    J-P Nurmi

  5. #5
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Open a QMainWindow in full screen mode?

    I don't want the text browser to be full screen, I just want it to occupy as much as the main window as possible.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Open a QMainWindow in full screen mode?

    So what's the problem? The text browser will get automatically resized if it's set directly as the central widget or if it's in a layout. You can optionally hide toolbars, status bar and such when in full screen mode if you want to. If the text browser is in a layout, you can also reduce the amount of margins to zero.
    J-P Nurmi

  7. #7
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Open a QMainWindow in full screen mode?

    Server::Server()
    {
    setFont(QFont("Verdana", 11));
    showMaximized();
    textBrowser = new QTextBrowser(this);
    textBrowser->show();
    show();
    }

    That code shows the QTextBrowser, but it is only a small square (5"x5") in the screen. While the main window is full screen.

    The text browser should be as big as possible.

    What is wrong ?

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Open a QMainWindow in full screen mode?

    Set the text browser as main window's central widget: QMainWindow::setCentralWidget().
    J-P Nurmi

Similar Threads

  1. Starting application in full screen
    By safknw in forum Qt Programming
    Replies: 3
    Last Post: 12th May 2006, 18:02
  2. how to display a window full screen??
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 8th May 2006, 12:07
  3. how to make the form full screen
    By shrikarcse in forum Qt Tools
    Replies: 1
    Last Post: 24th April 2006, 15:30

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.