Group 布局

先上两个效果图:

Group 布局_第1张图片

接着当我们点击More的时候,就成了下图

Group 布局_第2张图片

  1. ui->groupBox_2->hide();
  2. ui->groupBox_3->hide();
  3. ui->groupBox_4->hide();
  4. this->layout()->setSizeConstraint(QLayout::SetFixedSize);
  5. QObject::connect(ui->pushButton_More,SIGNAL(toggled(bool)),
  6. ui->groupBox_2,SLOT(setVisible(bool)));
  7. QObject::connect(ui->pushButton_More,SIGNAL(toggled(bool)),
  8. ui->groupBox_3,SLOT(setVisible(bool)));
  9. QObject::connect(ui->pushButton_Right,SIGNAL(toggled(bool)),
  10. ui->groupBox_4,SLOT(setVisible(bool)));
 
 
 
 

你可能感兴趣的:(Signal)