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.

Qt Code:
  1. SortDialog::SortDialog(QWidget *parent)
  2. : QDialog(parent)
  3. {
  4. setupUi(this);
  5.  
  6. secondaryGroupBox->hide();
  7. tertiaryGroupBox->hide();
  8. layout()->setSizeConstraint(QLayout::SetFixedSize);
  9. setColoumnRange('A', 'Z');
  10. }
To copy to clipboard, switch view to plain text mode 
When I add the line
Qt Code:
  1. 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?