indy
11th October 2007, 21:51
I am reading the book "C++ GUI programming with QT4" and I have a problem with the example of the Shape-Changing dialogs in chapter 2. I followed the tutorial by designing the GUI with designer and building the project in Eclipse. Everything compiles fine. The problem is with the constructor of the dialog box.
SortDialog::SortDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
secondaryGroupBox->hide();
tertiaryGroupBox->hide();
layout()->setSizeConstraint(QLayout::SetFixedSize);
setColoumnRange('A', 'Z');
}
When I add the line
layout()->setSizeConstraint(QLayout::SetFixedSize); the project compiles but when I try to run the executable I get Segmentation fault. Without that line the program runs ok but of course the dialog doesn't resize.
I am using Linux with KDE. Can anyone explain what is wrong please?
SortDialog::SortDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
secondaryGroupBox->hide();
tertiaryGroupBox->hide();
layout()->setSizeConstraint(QLayout::SetFixedSize);
setColoumnRange('A', 'Z');
}
When I add the line
layout()->setSizeConstraint(QLayout::SetFixedSize); the project compiles but when I try to run the executable I get Segmentation fault. Without that line the program runs ok but of course the dialog doesn't resize.
I am using Linux with KDE. Can anyone explain what is wrong please?