Results 1 to 7 of 7

Thread: Tabs/Dialog with hidden/extendable content

  1. #1
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Tabs/Dialog with hidden/extendable content

    Inspired by "Expanding Dialog" example I've tried to do something similar, however:
    - my hidden content is within a tab.
    - the tab should resize vertically (maintain horizontal width)
    - the dialog should resize accordingly.

    The UI file is here: http://dentharg.pl/photoqueue.ui.

    The code within constructor:

    ui.setupUi(this);
    ui.grpSourceDestination->hide();
    ui.tabMain->layout()->setSizeConstraint(QLayout::SetFixedSize);
    layout()->setSizeConstraint(QLayout::SetFixedSize());

    but of course doesn't work as expected.

    Is it at all possible to do such resizable tabwidget/dialog?

    Thanks!

  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: Tabs/Dialog with hidden/extendable content

    "grpSourceDestination" is missing a top level layout (the grid layout is floating).
    J-P Nurmi

  3. #3
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tabs/Dialog with hidden/extendable content

    I'm not certain what exactly do you mean, the tabMain which contains grpSourceDestination has grid layout.

  4. #4
    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: Tabs/Dialog with hidden/extendable content

    Quote Originally Posted by dentharg View Post
    I'm not certain what exactly do you mean, the tabMain which contains grpSourceDestination has grid layout.
    But grpSourceDestination itself doesn't have a layout installed. There's a floating grid layout which contains sourceDirectory, destinationDirectory etc.
    J-P Nurmi

  5. #5
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tabs/Dialog with hidden/extendable content

    When I added a grid layout to grpSourceDestination all of the sizes went with smoke. The contents of the tabMain are now not even at full width.

    I've put whole code at http://dentharg.pl/pq.tar.bz2

    Forgive my ignorance but this is my very first attempt at QT4.
    The idea is that grpSourceDestination is not visible until More button is pressed. The tabMain should be small and whole dialog too. And both of them should expand when More is pressed.

    Thanks!

  6. #6
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tabs/Dialog with hidden/extendable content

    Ok. Managed to do it. It was truly enough to add layouts to all elements, and remove size constraints from tabMain and leave it only on dialog.

    However I wish it was possible to have horizontal width extendable freely (set size constraint only in vertical).

  7. #7
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tabs/Dialog with hidden/extendable content

    Managed to achieve what I wanted.

    To conclude: layouts are powerful!

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.