#include "qmywidg.h"#include <QPushButton>#include <QLineEdit>#include <QTextEdit>#include <QLCDNumber>#include <QLayout>#include <QGroupBox>QMyWidg::QMyWidg(QWidget *parent) : QWidget(parent){ QVBoxLayout *main_layout = new QVBoxLayout; QPushButton *btn = new QPushButton("Click"); btn->setCheckable(true); main_layout->addWidget(btn); QVBoxLayout *second_layout = new QVBoxLayout; QLineEdit *le = new QLineEdit("Text"); QLCDNumber *lcdn = new QLCDNumber; QTextEdit *te = new QTextEdit; second_layout->addWidget(le); second_layout->addWidget(lcdn); second_layout->addWidget(te); QGroupBox *gbox = new QGroupBox; gbox->setLayout(second_layout); main_layout->addWidget(gbox); setLayout(main_layout); connect(btn,SIGNAL(toggled(bool)),gbox,SLOT(setVisible(bool)));}QMyWidg::~QMyWidg(){}