Results 1 to 2 of 2

Thread: Widgets resize: bug or feature

  1. #1
    Join Date
    Jul 2011
    Posts
    1
    Qt products
    Platforms
    MacOS X Unix/X11 Windows

    Exclamation Widgets resize: bug or feature

    Hi,

    I have 2 widgest placed in the QVBoxLayout. The first widget has a sizePolicy like this: [Prefered, Fixed, 0, 2]. The second widget has a sizePolicy like this: [Prefered, Expanding, 0, 0].
    It works great: the widget on the top has a constant size and the widget on the bottom is changing its size when window gets resized.
    I want to make a widget on the top to increase its height and the widget on the bottom to decrease its height when some event happens. I've used QParallelAnimationGroup to do this. And it works well too. But when I resize the window both widgets takes its initial size. Is it possible to make them to keep there new size?

    I'm using a PyQt4 if it matters.

    Thank you in advance.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Widgets resize: bug or feature

    Set the new sizePolicy (after animation)

    TopWidget: [Fixed, Fixed, 0, 0]
    BottomWidget: [Fixed, Fixed, 0, 0]

Similar Threads

  1. Replies: 1
    Last Post: 9th May 2011, 20:45
  2. Replies: 6
    Last Post: 1st September 2010, 16:11
  3. Layout, widgets and resize questions
    By Carlsberg in forum Qt Programming
    Replies: 2
    Last Post: 26th June 2009, 12:49
  4. Qidget height resize if child widgets invisible
    By visor_ua in forum Qt Programming
    Replies: 1
    Last Post: 27th April 2008, 11:27
  5. Replies: 2
    Last Post: 22nd January 2008, 16:10

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.