Can't hide group box in Qt

Saturday, July 12, 2014

I'm learning GUI programming with qt. I have a problem with Shape-Changing Dialogs. Like this: enter image description here

To do so, I added some signal-slot, like connect(ui->pbMore,SIGNAL(toggled(bool)),ui->gbSecond,SLOT(setShown(bool))); but it ain't work. I tried setVisible(bool) or set the connection on the GUI but no luck either.

This is an example from the book C++ GUI Programming with Qt 4, Second Edition. They do the same way with me. So what's my mistake?