Results 1 to 7 of 7

Thread: QMainWindow Maximization Issue

  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question QMainWindow Maximization Issue

    Hi All,

    I m using Qt 4.2.2 on my Intel Mac.
    I Have a Issue with QMainWindow.

    I have a QMainWindow of size (849,625).
    I have toolBar item,two treewidget and 1 listWidget on the MainWindow.

    What I want is that when I Maximized the MainWindow the widget on the MainWindow should be arranged to the mainWindow size and also when I again make it size to first size they should arrange to that size.

    If anybody knows then plz help me.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QMainWindow Maximization Issue

    Hi,

    use Layouts and QMainWindow::setCentralWidget().

    Lykurg

  3. #3
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: QMainWindow Maximization Issue

    Thanks for Reply.

    But Actually I m using Designer to create the MainWindow.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QMainWindow Maximization Issue

    Quote Originally Posted by vishal.chauhan View Post
    But Actually I m using Designer to create the MainWindow.
    then use the designer to create layouts.

    Lykurg
    Attached Images Attached Images

  5. #5
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QMainWindow Maximization Issue

    Thanks for reply.

    I open the Object Inspector and set all the Widget as a central Widget.
    But when I maximized my window they are not maximized.

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QMainWindow Maximization Issue

    ok,

    when working with designer forget about the QMainWindow::setCentralWidget().

    1. put all things in the mainwidget you want.
    2. maybe arrange the items with layouts
    3. click on a free mainwidget pice to activate it, or select the item in the top of the object inspector
    4. then choose a layout on the designer toolbar and click it.

    And now if you resize the mainwindow the content also will be resized...


    Lykurg

  7. #7
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: QMainWindow Maximization Issue

    Thanks.

    now the size is maximized.
    But when I set the layouts then actually if I set the Grid layout then it is not taking the widget size and position as given by me It takes the iteself.
    and in other layouts it is not setting them as I want.

Similar Threads

  1. Q_OBJECT macro issue
    By kandalf in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2007, 19:28
  2. Replies: 5
    Last Post: 22nd September 2006, 08:04
  3. Dynamically Loading a QMainWindow?
    By natron in forum Newbie
    Replies: 10
    Last Post: 21st July 2006, 01:15
  4. Insert separate QToolBar into QMainWindow
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 10:37
  5. Replies: 18
    Last Post: 22nd February 2006, 20:51

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.