Hello have collided with QScrollArea problem. I have 5 QPushButton's on my form, what should I do if I want to place more than 5 button's on my layout, how can I use QScrollArea, so that I can scroll layout down and see other buttons. I tried to do this:
QScrollArea* scroll = new QScrollArea();
QWidget* w = new QWidget();
scroll->setWidget(w);
But scrollbar did not appeared. Please can you show how can I solve this issue. Thanks in advance
Qt.jpg
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
this->setFixedSize(640,360);
setAttribute(Qt::WA_LockPortraitOrientation,true);
layout=new QVBoxLayout;
btn1=new QPushButton("1");
btn2=new QPushButton("2");
btn3=new QPushButton("3");
btn4=new QPushButton("4");
btn5=new QPushButton("5");
layout->addWidget(btn1);
layout->addWidget(btn2);
layout->addWidget(btn3);
layout->addWidget(btn4);
layout->addWidget(btn5);
this->setLayout(layout);
}
Bookmarks