I created two widget one by command another by Qt form designer. The code as shown below. When i execute two separates forms displays....What changes do i need to do, so that one form displays inside another form as single widget?
fileopen.cpp
fileopen
::fileopen(QWidget *parent
) : ui(new Ui::fileopen),
{
connect(add, SIGNAL(clicked()), this, SLOT(addRow()));
m_layout->addWidget(add);
m_layout->setAlignment(Qt::AlignTop);
w->setLayout(m_layout);
w->show();
ui->setupUi(this);
}
fileopen::fileopen(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::fileopen),
m_layout( new QVBoxLayout() )
{
QPushButton* add = new QPushButton("Add");
connect(add, SIGNAL(clicked()), this, SLOT(addRow()));
m_layout->addWidget(add);
m_layout->setAlignment(Qt::AlignTop);
QWidget* w = new QWidget();
w->setLayout(m_layout);
w->show();
ui->setupUi(this);
}
To copy to clipboard, switch view to plain text mode
Bookmarks