#include<QtGui/QApplication>#include<QLabel>#include<QImage>#include<QScrollArea>#include<QHBoxLayout>void ScrollArea_test::Init(){ root_widget_ = new QWidget(this);setCentralWidget(root_widget_);QVBoxLayout* root_layout = new QVBoxLayout(root_widget_);setLayout(root_layout);QWidget* widget = new QWidget();QVBoxLayout* layout = new QVBoxLayout(widget);setLayout(layout);QPushButton* btn_1 = new QPushButton();btn_1->setText("zhangsan");btn_1->setFixedSize(600,600);QPushButton* btn_2 = new QPushButton();btn_2->setText("zhangsan");btn_2->setFixedSize(600,600);layout->addWidget(btn_1);layout->addWidget(btn_2);QScrollArea* scrol = new QScrollArea();scrol->setWidget(widget);scrol->setWidgetResizable(1);scrol->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);scrol->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);root_layout->addWidget(scrol);QPushButton* btn_3 = new QPushButton();btn_3->setText("lisi");btn_3->setFixedSize(100,100);root_layout->addWidget(btn_3);}