Results 1 to 8 of 8

Thread: QWizard fit

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QWizard fit

    I was using QWizard and added some pages that contain widget of different sizes and it seems that QWizard will adjust itself as the the widget inside it grows bigger but won't shrink if the next widget is smaller than the previous one.

    I want to have it tight fit on the QWizardPage size. Is there such a way to do it?

    like using QLayout::setSizeConstraint(QLayout::SetFixedSize) kinda thing...

    baray98

  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: QWizard fit

    So QLayout::setSizeConstraint(QLayout::SetFixedSize) does not work? Have you tried it for QWizardPage or QWizard itself?
    J-P Nurmi

  3. #3
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWizard fit

    jpn,

    QLayout::setSizeConstraint(QLayout::SetFixedSize) applied on the QWizardPage just makes the page "fixed size" but the QWizard remains unchanged.

    tried accessing the layout on QWizard with QWidget::layout() but this will return 0 so I can't tell wizard to wrap it up using QLayout::setSizeConstraint(QLayout::SetFixedSize)

    baray98

  4. #4
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard fit

    I have the same identical problem.
    Has anyone a solution to this problem?

    Thanks

  5. #5
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWizard fit

    There is no solution that I know at this point in time

  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: QWizard fit

    Do you really want the wizard dialog to automatically resize back and forth meanwhile the user switches between pages? I don't think that's a good idea, because the location of the next/cancel/whatever buttons would change all the time. Users are used to navigating in wizards so that they keep clicking for example the next button. With your approach one could easily click the cancel button by accident while the intention was to press next.
    J-P Nurmi

  7. #7
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWizard fit

    good point jpn.
    I agree it would be a good idea to set the wizard size to the size of its biggest page.
    Do you know how to do this? By default the wizard adapt to the current page size.

    My real problem is slightly different: I have a page in the wizard with a "more" button that changes the wizard page to show addition controls in the page.
    The problem is that when the "more" is clicked the wizard page is properly resized, but that does not cause the resize of the Wizard.

    In the wizard page constructor I set the wizardpage layout to fixed size

    Qt Code:
    1. ...
    2. layout()->setSizeConstraint(QLayout::SetFixedSize);
    3. ...
    To copy to clipboard, switch view to plain text mode 

    then when the "more" button is clicked I call a slot hiding/showing a button group with additional controls

    Qt Code:
    1. ...
    2. gbAdvancedOptions->setVisible(yes);
    3. ...
    To copy to clipboard, switch view to plain text mode 

    As I said before, the wizard page is properly resized, but the wizard is not, so I can not see the additional controls. I have to resize the wizard manually to see them.
    I tried the fallowing solution, but it is not working

    Qt Code:
    1. ...
    2. gbAdvancedOptions->setVisible(yes);
    3. wizard()->adjustSize();
    4. ...
    To copy to clipboard, switch view to plain text mode 

    Do you have any other suggestion?
    Thanks in advance for your help

  8. #8
    Join Date
    Nov 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWizard fit

    Call adjustSize() member of all pages.
    Get biggest size (biggestSize) resulting sizes
    and setFixedSize(biggestSize);
    Now all pages have the same size.

Similar Threads

  1. QWizard signal problem
    By oguzy in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2008, 10:43
  2. QWizard, QComboBox and registerField() issue
    By RThaden in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2008, 12:18
  3. How to disable NextButton in QWizard ?
    By litroncn in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2008, 07:05
  4. Create QWizard UI
    By jd in forum Qt Tools
    Replies: 1
    Last Post: 17th March 2008, 12:36
  5. QWizard and banner pixmap
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 7th January 2008, 10:28

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.