Results 1 to 10 of 10

Thread: auto-resize trouble

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default auto-resize trouble

    Hi all,

    I'am pretty new QT user. I really work hard to learn as fast as I can. I have a problem that I couldn't fix. I have a main frame which houses some other frames. I want to resize those inner windows whenever I resize the main window but I couldn't do this although I played with the size related properties of the frames.

    Anyone who know the solution or who have an idea please response as soon as possible.

    Regards, Zeki.

  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: auto-resize trouble

    J-P Nurmi

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: auto-resize trouble

    You mean the mainwindow layout?

  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: auto-resize trouble

    Each level must have a layout installed if you want the whole widget tree to be resized whenever the window is resized.
    J-P Nurmi

  5. #5
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: auto-resize trouble

    So I need to set a layout for each level...Are the layouts should be the same type?(i.e. horizantal layout)

  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: auto-resize trouble

    It's up to you how you want to lay out the child widgets.
    J-P Nurmi

  7. #7
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: auto-resize trouble

    OkI just want to be sure.
    Finally, changing the size policy(i.e. preffered to fixed or making hor.strecth = 1) of a widget could effect this resizing issue?

  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: auto-resize trouble

    QSizePolicy::Fixed means that
    Quote Originally Posted by docs
    The QWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button).
    J-P Nurmi

  9. #9
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: auto-resize trouble

    That was a good answer. Thanks a lot.

    Cheers.

  10. #10
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: auto-resize trouble

    I actually tried the following way;

    I set the widget size policy to expanding, but I didn't give a lay out for each level. So it seems that where I screwed it up.

Similar Threads

  1. Replies: 11
    Last Post: 11th August 2008, 09:14
  2. Auto resize QLabel
    By munna in forum Newbie
    Replies: 12
    Last Post: 6th August 2008, 13:39
  3. Auto resize Widget to maximum avail. space
    By pospiech in forum Qt Programming
    Replies: 16
    Last Post: 15th April 2008, 14:47
  4. QTextEdit auto resize
    By bunjee in forum Qt Programming
    Replies: 4
    Last Post: 26th October 2007, 19:59
  5. How to get a QDockWidget to auto resize?
    By bitChanger in forum Qt Programming
    Replies: 4
    Last Post: 6th January 2006, 16:10

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.