Opening a form
I have a class additem. It was created by Qt and it generated additem.h, additem.cpp and additem .ui. I created an other form, review.ui. How can I add items to review.ui from additem.cpp?
Thank you for your help.
Did you make another widget with review.ui ? If not how are you using it ? What kind of items do you want to add to it ?
I want to use to review form after entering data. I will use it with labels. At this point I was not able to figure out how to use it or even open it from additem.cpp.
What did you mean by make an other widget with review.ui?
You can create widgets with Designer which will have a .ui and both .h and .cpp file which will be a "complete designer" widget or you can also have independent .ui files that you load by hand.
It's all explained here
As for your main problem of adding stuff. How is your application supposed to work ?
I want to get data from additem.cpp and display it in review.ui for final review.
Then you should rather transfer these data and let your
reviewwidget build itself based on them.
Using add file in Qt I crated a new review class (crated the review.ui, review.cpp and review.h). When I try to open review from additem.cpp
review *mReview; mReview->exec ();
it works fine until I click submit. At that time the program freezes. What did I do wrong?
(I also included review.h in additem.h:
You declare a pointer to a review object that your never initialize.
mReview = new review(this); mReview->show ();
solved the problem.