Results 1 to 5 of 5

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

Threaded 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

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.