hi,
just to continue my previous thread from here [qt-project.org]
after I inserted the .ui form in the TabWidget, I would like to have the form scrollable, meaning if the
MainWindog is resized to have the scroll bars available on the bottom and right side.
for this i tried to implement in my form addA.cpp the following code:
#include <QScrollArea>
#include <QMainWindow>
addA::addA(QWidget *parent) :
QDialog(parent),
ui(new Ui::addA)
{
ui->setupUi(this);
QScrollArea * scrollArea = new QScrollArea();
QMainWindow::setCentralWidget(scrollArea);
scrollArea->setWidget(addA);
}
this code didn’t work to make my addA.ui form scrollable.
than i tried in my mainwindow.cpp the following code:
QTabWidget *tabWidget = new QTabWidget;
addA *nA = new addA();
tabWidget->addTab (nA, tr("Test"));
QScrollArea * scrollArea = new QScrollArea();
scrollArea->setWidget(tabWidget);
setCentralWidget(tabWidget);
what i’m doing wrong?
↧