Results 1 to 3 of 3

Thread: Resize of main window without setFixedSize

  1. #1
    Join Date
    Jul 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Resize of main window without setFixedSize

    S.O.: Ubuntu 9.10
    Qt 4.6.2

    Hello,
    I have a problem about window resize after click of button that shows/hides widget in the main window.
    When I want to hide the window on click of button main window don't becomeagain little .

    I can' t use setFixedSize, setMaximumSize because I want resize (maximize/minimize with mouse) the window.
    I have tested resize method but it doesn' t work. In MainWindow:

    connect(myWidget, SIGNAL(buttonShowToggled(bool)),this, SLOT(showOtherWidget(bool)));

    void MainWindow::showOtherWidget(bool isVisible) {

    if(isVisible== true){
    otherWidget->show();
    resize( QSize(width()+50,height()));
    } else {
    otherWidget->hide();
    //rightLayout->removeWidget(otherWidget);
    resize( QSize(width()-50,height()));
    }
    }



    Could anybody please give me indications about solution or possibly indicate me examples ?

    Thanks in advance
    Ely

  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: Resize of main window without setFixedSize

    Hi, the trick is to use QLayout::setSizeConstraint() with QLayout::SetFixedSize. See the article [WIKI]Expanding dialog[/WIKI] in our wiki!

  3. #3
    Join Date
    Jul 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resize of main window without setFixedSize

    Thanks

    but i can' t use setFixedSize because I want resize (maximize/minimize with mouse) the window.

Similar Threads

  1. Resize main window after hiding an element
    By Swankee in forum Newbie
    Replies: 2
    Last Post: 22nd February 2012, 23:23
  2. main window resize question
    By schnitzel in forum Qt Programming
    Replies: 12
    Last Post: 29th May 2010, 09:31
  3. Replies: 9
    Last Post: 16th May 2010, 16:21
  4. Replies: 11
    Last Post: 11th August 2008, 09:14
  5. Replies: 15
    Last Post: 23rd March 2007, 16:16

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.