Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opening a form

Opening a form

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 1.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gabor53
    wrote on last edited by
    #1

    Hi,

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      G 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        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 ?

        G Offline
        G Offline
        gabor53
        wrote on last edited by
        #3

        @SGaist
        Hi,
        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?
        Thanks

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          G 1 Reply Last reply
          0
          • SGaistS SGaist

            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 ?

            G Offline
            G Offline
            gabor53
            wrote on last edited by
            #5

            @SGaist
            I want to get data from additem.cpp and display it in review.ui for final review.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Then you should rather transfer these data and let your review widget build itself based on them.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              G 1 Reply Last reply
              0
              • SGaistS SGaist

                Then you should rather transfer these data and let your review widget build itself based on them.

                G Offline
                G Offline
                gabor53
                wrote on last edited by
                #7

                @SGaist

                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:

                #include "review.h"
                

                )

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You declare a pointer to a review object that your never initialize.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  G 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    You declare a pointer to a review object that your never initialize.

                    G Offline
                    G Offline
                    gabor53
                    wrote on last edited by
                    #9

                    @SGaist

                    Thank you.

                        mReview = new review(this);
                        mReview->show ();
                    

                    solved the problem.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved