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
){
setupUi(this);
secondaryGroupBox->hide();
tertiaryGroupBox->hide();
layout
()->setSizeConstraint
(QLayout::SetFixedSize);
setColoumnRange('A', 'Z');
}
SortDialog::SortDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
secondaryGroupBox->hide();
tertiaryGroupBox->hide();
layout()->setSizeConstraint(QLayout::SetFixedSize);
setColoumnRange('A', 'Z');
}
To copy to clipboard, switch view to plain text mode
When I add the line
layout
()->setSizeConstraint
(QLayout::SetFixedSize);
layout()->setSizeConstraint(QLayout::SetFixedSize);
To copy to clipboard, switch view to plain text mode
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?
Bookmarks