Results 1 to 5 of 5

Thread: Shape-resizing dialogs doesn't work...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Shape-resizing dialogs doesn't work...

    Dear,

    I read the others post, I'm doing as is written in the book by Blanchette & Summerfield but it doesn't work!!!!!!!!!

    I explain better the situation:
    - I have a QDialog containing three GroupBox and three button. One GroupBox and two button are hidden (let's call them: "button1","button2" and "groupBox")
    - when the third button is clicked the hidden widgets are displayed.
    I attached here the GUI I have prepared with Qt Designer.

    The problems are:
    - if I do as written in the book:
    connect(button, SIGNAL(toggled(bool)), groupBox, SLOT(setVisible(bool)));
    connect(button, SIGNAL(toggled(bool)), button1 SLOT(setVisible(bool)));
    connect(button, SIGNAL(toggled(bool)), button2, SLOT(setVisible(bool)));
    nothing is displayed when I click the button that should display the hidden widgets. I solved this problem implementing my own slot that works as this:
    groupBox->setVisible(!OverviewGroupBox->isVisible());
    button1->setVisible(!OverviewGroupBox->isVisible());
    button2->setVisible(!OverviewGroupBox->isVisible());

    - the second problem is that when the Dialog is displayed for the first time (with the three widgets hidden) the size is not set at the minimum, I mean... there is lot of left space, here attached there is also a screeshot...

    To conclude here the code of the constructor of the dialog.
    {
    setupUi(this);
    button1->hide();
    button2->hide();
    groupBox->hide();

    layout()->setSizeConstraint(QLayout::SetFixedSize);
    connect(button, SIGNAL(clicked()), this, SLOT(myslot()));

    }

    I hope this is enough to understand the problem.
    Thanks in advance

    Annalisa
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Shape-resizing dialogs doesn't work...

    no one has any idea???

    I didn't solve the problem yet...

    could be something related with layouts?

    Thanks

    Annalisa

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Shape-resizing dialogs doesn't work...

    what do you want to get, extension dialog?

  4. #4
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Shape-resizing dialogs doesn't work...

    I'm just looking for a dialog that reshape correctly when some of its widgets are not displayed... not like in the attachment above where lot of space at the bottom of the dialog is left empty...

    Thanks

    Annalisa

  5. #5
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Shape-resizing dialogs doesn't work...

    you should set setSizeConstraint(QLayout::SetFixedSize) for top-level layout.
    see an example in QTDIR/examples/dialogs/extension/

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
  •  
Qt is a trademark of The Qt Company.