Results 1 to 3 of 3

Thread: Hide and Show problem in master layout

  1. #1
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Hide and Show problem in master layout



    Fig.1 in the attached picture shows screen show of my dialog in Qt Designer.
    When “Hide processor” button is clicked the hide/show of a top GroupBox processed as:
    Qt Code:
    1. if (ui.gbGeneration->isVisible())
    2. {
    3. ui.btnShowHide->setText("Show processor");
    4. ui.btnShowHide->setArrowType (Qt::ArrowType::DownArrow);
    5. ui. gbGeneration ->hide();
    6. }
    7. else
    8. {
    9. ui.btnShowHide->setText("Hide processor");
    10. ui.btnShowHide->setArrowType (Qt::ArrowType::UpArrow);
    11. ui. gbGeneration ->show();
    12. }
    To copy to clipboard, switch view to plain text mode 

    Prior to clicking “Hide Processor” button the dialog capture in run-time is shown on Fig.2. After hiding the group box the result capture is shown on Fig.3

    My question: how to change dialog layout in such a way that the result of “hiding” will look like as shown on Fig.4?

    Oh, and one more thing – this dialog is shown in QMdiSubWindow when window is maximized.
    Any help will be greatly appreciated, 3.5 hours had been lost already 
    Last edited by jpn; 16th July 2009 at 19:46.

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Hide and Show problem in master layout

    What are the size policies of your dialog?
    I'm a rebel in the S.D.G.

  3. #3
    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: Hide and Show problem in master layout

    Standard answer: use
    Qt Code:
    1. layout()->setSizeConstraint(QLayout::SetFixedSize);
    To copy to clipboard, switch view to plain text mode 
    inside you c-tor. (An example is on the wiki!)

Similar Threads

  1. Replies: 10
    Last Post: 20th April 2015, 22:24
  2. Hide and Show QMenu
    By febil in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2009, 09:31
  3. hide from taskbar but show to ALT-TAB
    By musikit in forum Qt Programming
    Replies: 0
    Last Post: 15th August 2008, 16:14
  4. Move and resize with layout
    By waediowa in forum Qt Programming
    Replies: 0
    Last Post: 14th May 2008, 08:16
  5. Show or hide a form
    By Gayathri in forum Newbie
    Replies: 11
    Last Post: 17th November 2006, 12:39

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.