Results 1 to 5 of 5

Thread: Maximize window and resize contents - howto?

  1. #1
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Maximize window and resize contents - howto?

    Hello!

    I know that it is possible to have a unmaximized window and when maximized its contents to be resized as well so as to fit the screen.

    But I don't have a tip, can you give one?
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  2. #2
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Maximize window and resize contents - howto?

    The easiest way is to create your user interface in Qt Designer

    Remember to place all the components in layouts, not forgetting about a layout for the main widget
    Last edited by Rachol; 28th June 2011 at 08:22.

  3. #3
    Join Date
    Mar 2011
    Location
    Russia, Lipetsk
    Posts
    17
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Maximize window and resize contents - howto?

    If I understand correctly:
    You may maximize window, using next function of QMainWindow

    Qt Code:
    1. Maximized()
    To copy to clipboard, switch view to plain text mode 

    For resize contents You must use layout on your form.

  4. #4
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Maximize window and resize contents - howto?

    That's right. However to maximize your window you must use following

    Qt Code:
    1. void QWidget::showMaximized () [slot]
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Mar 2011
    Location
    Russia, Lipetsk
    Posts
    17
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Maximize window and resize contents - howto?

    Quote Originally Posted by Rachol View Post
    That's right. However to maximize your window you must use following

    Qt Code:
    1. void QWidget::showMaximized () [slot]
    To copy to clipboard, switch view to plain text mode 
    Yes, I was not right. Use Myself

    Qt Code:
    1. MainWindow w;
    2. w.show();
    3. w.showMaximized();
    4. return a.exec();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. maximize grid with maximize window
    By bibhukalyana in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2011, 08:16
  2. Replies: 1
    Last Post: 1st May 2010, 23:03
  3. 'resize/maximize' button not visible
    By sindhumol_s in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2009, 02:15
  4. Maximize Window button of Manin Window
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 08:20
  5. Resize QTreeWidget columns to contents
    By FaS in forum Qt Programming
    Replies: 9
    Last Post: 2nd July 2006, 20:48

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.