Basiclayouts: Add scrolling to example
Adds scrolling to basic layouts example because the user interface in the example doesn't fit properly on smaller screen sizes. Fixes: QTCREATORBUG-27634 Change-Id: I61e6eac2b28e5b3ff0f984894fe38167b3f46a9c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Markku Nokkala <markku.nokkala@qt.io> (cherry picked from commit 89ce9a1c5a29e3f420931baa88c705856b99ac25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
fed79f4802
commit
ba33df8fcd
@ -36,9 +36,24 @@ Dialog::Dialog()
|
||||
mainLayout->addWidget(formGroupBox);
|
||||
mainLayout->addWidget(bigEditor);
|
||||
mainLayout->addWidget(buttonBox);
|
||||
//! [4] //! [5]
|
||||
setLayout(mainLayout);
|
||||
//! [4]
|
||||
QWidget *scrollAreaContent = new QWidget;
|
||||
scrollAreaContent->setLayout(mainLayout);
|
||||
|
||||
QScrollArea *scrollArea = new QScrollArea;
|
||||
scrollArea->setFrameShape(QFrame::NoFrame);
|
||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
scrollArea->setWidgetResizable(true);
|
||||
scrollArea->verticalScrollBar()->setStyleSheet("QScrollBar:vertical {width: 20px;}");
|
||||
|
||||
scrollArea->setWidget(scrollAreaContent);
|
||||
|
||||
QVBoxLayout *scrollLayout = new QVBoxLayout;
|
||||
scrollLayout->setContentsMargins(0,0,0,0);
|
||||
scrollLayout->addWidget(scrollArea);
|
||||
|
||||
//! [5]
|
||||
setLayout(scrollLayout);
|
||||
setWindowTitle(tr("Basic Layouts"));
|
||||
}
|
||||
//! [5]
|
||||
|
Loading…
x
Reference in New Issue
Block a user