Wow thats ingenious, thank you very much
I have one last, pretty short question. Is it possible to use a PushButton of a Dialog to add "MyCustomFrame" into the "mainwindow"? How should the path in "dialog.cpp" look like? (With path i mean "ui->verticalLayout->addWidget(frame);").
Gratefully
Illidan
Added after 1 21 minutes:
Well i guess i shouldn't call something a last question. I tried your solution and it works very well if i insert "MyCustomFrame" into a "verticalLayout". Problem is, if i insert my widget more then once or twice it gets smaller and smaller because the space is not enough. So i wanted to insert my "MyCustomFrame" into a scrollArea. But then i just get the following errors:
void MainWindow::on_archiveExam_clicked()
{
MyCustomWidget *frame = new MyCustomWidget(this);
ui->scrollAreaWidgetContents_2->addWidget(frame);
}
void MainWindow::on_archiveExam_clicked()
{
MyCustomWidget *frame = new MyCustomWidget(this);
ui->scrollAreaWidgetContents_2->addWidget(frame);
}
To copy to clipboard, switch view to plain text mode
Gives me the error: "C2039: 'addWidget': Is not an element of 'QWidget' "
void MainWindow::on_archiveExam_clicked()
{
MyCustomWidget *frame = new MyCustomWidget(this);
ui->scrollArea->addWidget(frame);
}
void MainWindow::on_archiveExam_clicked()
{
MyCustomWidget *frame = new MyCustomWidget(this);
ui->scrollArea->addWidget(frame);
}
To copy to clipboard, switch view to plain text mode
Gives me the error: "C2039: 'addWidget': Is not an element of 'QScrollArea' "
Any advice that could help me?
Grateful
Illidan
Bookmarks