1. 程式人生 > >Qt 滾動視窗類

Qt 滾動視窗類

 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類實現視窗滾動,