1 { 2 QScrollArea *scrollArea = new QScrollArea(this); 3 scrollArea->setFrameStyle(0); 4 scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); 5 scrollArea->setWidgetResizable(true);
7 QWidget* container = new QWidget(scrollArea); 8 scrollArea->setWidget(container); 9 container->setMinimumHeight(900); 10 }
Qt 界面中使用QScrollArea类实现窗口滚动,