Results 1 to 3 of 3

Thread: hide() and auto resizing

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default hide() and auto resizing

    Hi,

    I am having some trouble getting some controls to resize correctly.
    These have been built in QT designer.

    I have attached 3 images.

    Image 1 - When the small << button on the leftmost group control
    is pressed I hide() the "Control" text label contained
    in that group box as well as the underlying group box.

    The result is shown in image 2.
    I would like the grey group box containing the button
    to shrink horizontally to the minimum width I have specified
    but it's width does not change. If I hide the control altogether
    the other control boxes do slide over to the left which is what I want.

    The grey groupbox's hSizeType is Preferred and it has a minimumSize width
    of 30.

    Once the text is hidden, I would think the control would automatically
    resize down but that doesn't happen.

    Can someone explain why/how?

    Also as shown in image 3 when the other Control box buttons are pressed
    I hide their bottom group component. I would like the Control boxes
    underneath to keep their size but move up to occupy the now empty vertical
    space.

    Any suggestions?

    Thank you!

    Mark



    This is windows and QT 4.3

    Any suggestions?

    Many Thanks,
    Mark
    Attached Images Attached Images

  2. #2
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: hide() and auto resizing

    Hi,

    Could you attach your code I would play with on machine I try to help you.
    There are still some people who do not need code to solve the problem

    Maverick
    Last edited by maverick_pol; 25th August 2007 at 12:41.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  3. #3
    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: hide() and auto resizing

    To get a layout strictly follow size hint changes:
    Qt Code:
    1. layout->setSizeConstraint(QLayout::SetFixedSize);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Replies: 6
    Last Post: 18th August 2006, 17:50

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.