I'm learning both Qt 5 and C++ with this book (have previous experience with C, Java, Swift).
Got stuck on p23 where, after creating two .ui forms (mainwindow.ui, task.ui) they give the following instruction: "Open the MainWindow.ui file and edit it to get the following result:," and show a pic with mainwindow.ui now having the tasksLayout (which uses task.ui) QVBoxLayout added as a child.
They give zero explanation of how to do this. I tried dropping a QVBoxLayout in place, renamed it to tasksLayout, and tried a build, but got the error: "allocation of incomplete type 'Ui::Task', ui(new Ui::Task)"
Coming from Xcode, it seems odd to me to design 2 graphic forms, but have no way to drag/drop one on to the other.
So I assume the technique here is to load the subform dynamically in code, as I believe this code does:
ui->tasksLayout->addWidget(task);
If anyone's gotten thru Chap 1 ok, would appreciate info on how to do this properly.
Aucun commentaire:
Enregistrer un commentaire