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. How to remove manually created form and replace with QTDesigner creatted one.
Forum Updated to NodeBB v4.3 + New Features

How to remove manually created form and replace with QTDesigner creatted one.

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 3 Posters 2.7k Views 1 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.
  • A Anonymous_Banned275

    @Christian-Ehrlicher How does that ANSWERS the question as posted NOW?

    When the question gets answered ,
    please elaborate how QTCreator and QTDesigner DO NOT RELATE.

    ( Using QTCreator I can build a dialog project whose form can be edited in QTDesigner...)

    Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #4

    @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

    Using QTCreator I can build a dialog project whose form can be edited in QTDesigner

    Correct, QtCreator has also a built-in designer mode. But that doesn't matter for your question. It doesn't matter if you create the ui-file within the QtCreator built-in designer or the external QtDesigner. Both create exact the same ui file and the workflow how to use it is also exactly the same as explained to you in the other thread already.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    1 Reply Last reply
    1
    • A Anonymous_Banned275

      @Christian-Ehrlicher How does that ANSWERS the question as posted NOW?

      When the question gets answered ,
      please elaborate how QTCreator and QTDesigner DO NOT RELATE.

      ( Using QTCreator I can build a dialog project whose form can be edited in QTDesigner...)

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #5

      @AnneRanch
      Let's see if this helps:

      • Qt Designer only uses the form.ui file. It does not know or care about any other file. It does not care about Qt Creator. The .ui file is a textual (XML) description of everything you have designed in Designer. Designer can read that and recreate what you had visually when it was saved; when you make changes in Designer and save everything goes into the .ui file.

      • When you build your project from Creator, (if the .ui has changed) it runs executable uic on the .ui file. That also only looks at the .ui file. From the XML in it uic generates a file named ui_form.h, situated in the build output directory (where the .o files are) not your source files directory. That .h file is C++ code for everything in the .ui file. The actual .ui file is not needed after this point, it is not read/required at runtime for your project/executable.

      • In your form.cpp file --- original generated together with form.h from Creator when you told it to add the Form into your project, but from then onward never updated by Creator, only by you --- there is a #include "ui_form.h" line to read in the .h code file generated from the .ui by uic and a call to ui->setup(this). That uses the generated code to implement what you designed via the appropriate C++ Qt library calls at runtime. The compilation does not know or care where the ui_form.h came from --- .ui file run through uic or not --- so long as that file contains all the C++ code required.

      So, you can generate the ui_form.h from the original .ui Designer file via uic; but note that you cannot regenerate the original .ui file from the generated ui_form.h, it's a one-way process only. Which is why you don't want to lose the .ui file, if you want to keep going back and making changes. You can lose the ui_form.h file any time, because you can always re-run uic on the .ui file. Finally note that you should never change the .ui_form.h file itself, because it will be overwritten and any alterations you made lost, the next time the build runs uic. You may look at the code in ui_form.h to understand how uic is turning your .ui file into C++ code if you wish, but do not try to change it.

      In your case, if you have a .ui file you should be able to get back into viewing/editing it in Designer. Provided its content is "legal" (per the XML format it understands) and you have not manually put stuff into it that it does not understand/deal with. If you do not have a .ui file you will not be able to generate one and will not be able to get into Designer on the form.

      A 1 Reply Last reply
      1
      • JonBJ JonB

        @AnneRanch
        Let's see if this helps:

        • Qt Designer only uses the form.ui file. It does not know or care about any other file. It does not care about Qt Creator. The .ui file is a textual (XML) description of everything you have designed in Designer. Designer can read that and recreate what you had visually when it was saved; when you make changes in Designer and save everything goes into the .ui file.

        • When you build your project from Creator, (if the .ui has changed) it runs executable uic on the .ui file. That also only looks at the .ui file. From the XML in it uic generates a file named ui_form.h, situated in the build output directory (where the .o files are) not your source files directory. That .h file is C++ code for everything in the .ui file. The actual .ui file is not needed after this point, it is not read/required at runtime for your project/executable.

        • In your form.cpp file --- original generated together with form.h from Creator when you told it to add the Form into your project, but from then onward never updated by Creator, only by you --- there is a #include "ui_form.h" line to read in the .h code file generated from the .ui by uic and a call to ui->setup(this). That uses the generated code to implement what you designed via the appropriate C++ Qt library calls at runtime. The compilation does not know or care where the ui_form.h came from --- .ui file run through uic or not --- so long as that file contains all the C++ code required.

        So, you can generate the ui_form.h from the original .ui Designer file via uic; but note that you cannot regenerate the original .ui file from the generated ui_form.h, it's a one-way process only. Which is why you don't want to lose the .ui file, if you want to keep going back and making changes. You can lose the ui_form.h file any time, because you can always re-run uic on the .ui file. Finally note that you should never change the .ui_form.h file itself, because it will be overwritten and any alterations you made lost, the next time the build runs uic. You may look at the code in ui_form.h to understand how uic is turning your .ui file into C++ code if you wish, but do not try to change it.

        In your case, if you have a .ui file you should be able to get back into viewing/editing it in Designer. Provided its content is "legal" (per the XML format it understands) and you have not manually put stuff into it that it does not understand/deal with. If you do not have a .ui file you will not be able to generate one and will not be able to get into Designer on the form.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #6

        @JonB Thanks very much , your post is indeed very helpful. Let me digest it and hopefully I can then ask more intelligent questions.
        At his point is am still not sure how using QTDesigner to build actual C code
        differs from starting with QTCreator and ending up with same C code and be able to edit the "form" in QTDesigner.
        Thanks

        JonBJ 1 Reply Last reply
        0
        • A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #7

          Ok , allow me to start a discussion from coder , me , view.
          I can access "Form" file xxx .ui file , in creator.
          That gets me to QTDesigner and I can edit the form. At that point I have no knowledge how my editing gets implemented - sort of "under the hood" .
          I exit the QTDesigner and go back to QTCreator only to find out that simple change of text of button text did not take.

          So - it is "one way street " and now is time to trace "under the hood" to find out why...keeping in focus it works OK when QTCreator build the xxxx.ui file.

          Starting where ?

          JonBJ 1 Reply Last reply
          0
          • A Anonymous_Banned275

            @JonB Thanks very much , your post is indeed very helpful. Let me digest it and hopefully I can then ask more intelligent questions.
            At his point is am still not sure how using QTDesigner to build actual C code
            differs from starting with QTCreator and ending up with same C code and be able to edit the "form" in QTDesigner.
            Thanks

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #8

            @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

            At his point is am still not sure how using QTDesigner to build actual C code

            Truly, Qt Designer does not build any code at all. Qt Designer only reads & writes a .ui (XML) file. That's it: no more and no less. No code at all. When you design from scratch and save, Designer saves your design into a .ui file. When you later read that .ui file into Designer, it reconstructs the visual design from that file.

            Qt Creator, OTOH, does lots of things. These include:

            • Embed Designer in one of its windows, so that you can design forms. That, as stated above, writes & reads a .ui file.

            • When you build, Creator calls on make. If the .ui file read/written by Designer has been changed, run uic on the .ui file to generate ui....h file from it. That is C++ code. But it's not produced by Designer (or even by Creator); it's produced by uic executable (supplied with Qt).

            • After generating ui....h file from .ui (or using the last left around if .ui has not been updated), then make calls on gcc to compile all source files necessary (there will be #include "ui_form.h" in form.cpp, so this step will #include the C++ code generated from uic on .ui files), and finally to link all object/library files into an executable.

            Of course, Creator does much more. For example, it includes a window for the text editor with C++ knowledge, a window for running gdb debugger if you want it, and other things. Creator is largely a big, complex "shell", pulling all these bits together into a single IDE, so that you can do more or less anything you want from within Creator without having to manually run up separate programs/tools manually/explicitly.

            A 1 Reply Last reply
            1
            • A Anonymous_Banned275

              Ok , allow me to start a discussion from coder , me , view.
              I can access "Form" file xxx .ui file , in creator.
              That gets me to QTDesigner and I can edit the form. At that point I have no knowledge how my editing gets implemented - sort of "under the hood" .
              I exit the QTDesigner and go back to QTCreator only to find out that simple change of text of button text did not take.

              So - it is "one way street " and now is time to trace "under the hood" to find out why...keeping in focus it works OK when QTCreator build the xxxx.ui file.

              Starting where ?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #9

              @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

              That gets me to QTDesigner and I can edit the form. At that point I have no knowledge how my editing gets implemented - sort of "under the hood" .

              Designer reads the .ui file, and saves back to it if you make changes and save.

              I exit the QTDesigner and go back to QTCreator

              You should not be "exiting" the Designer or "go back to" Creator. You should be in Creator the whole time, never leaving it. Designer is available as a window inside Creator, which gets opened for you when you double click on a form. It's a window like many other windows in Creator, e.g. the C++ text editor is also a window there. You should be swapping between the Designer window and the Editor window all from within Creator.

              only to find out that simple change of text of button text did not take.

              Then something is wrong. When you say "change of text of button text did not take." you might mean you see that in one of two places. Can you be very specific:

              1. You are looking at the button in Designer. You have not compiled or run your application after making a change. Is this where you do not see your edit?

              2. You have compiled and run your application. In your running application you do not see your edit. Is this what you mean?

              Obviously if #1 is true then #2 is (likely to be) true. But #2 might be true without #1 being true. So I'm sure you fall foul in #2, but is #1 bad fro you too? You made a change in Designer, saved; at a later date you are looking at in Designer and you do not visually see the change? Or do you always see your change visually in Designer but it does not "take" into the running application code?

              Returning to earlier:

              I exit the QTDesigner and go back to QTCreator

              We really need to know exactly what you mean by this. If you are really running just Qt Designer as a separate thing you do, outside of Creator, that's wrong, and might cause problems if they do not have the exact same path to the .ui file.

              A 1 Reply Last reply
              0
              • JonBJ JonB

                @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                At his point is am still not sure how using QTDesigner to build actual C code

                Truly, Qt Designer does not build any code at all. Qt Designer only reads & writes a .ui (XML) file. That's it: no more and no less. No code at all. When you design from scratch and save, Designer saves your design into a .ui file. When you later read that .ui file into Designer, it reconstructs the visual design from that file.

                Qt Creator, OTOH, does lots of things. These include:

                • Embed Designer in one of its windows, so that you can design forms. That, as stated above, writes & reads a .ui file.

                • When you build, Creator calls on make. If the .ui file read/written by Designer has been changed, run uic on the .ui file to generate ui....h file from it. That is C++ code. But it's not produced by Designer (or even by Creator); it's produced by uic executable (supplied with Qt).

                • After generating ui....h file from .ui (or using the last left around if .ui has not been updated), then make calls on gcc to compile all source files necessary (there will be #include "ui_form.h" in form.cpp, so this step will #include the C++ code generated from uic on .ui files), and finally to link all object/library files into an executable.

                Of course, Creator does much more. For example, it includes a window for the text editor with C++ knowledge, a window for running gdb debugger if you want it, and other things. Creator is largely a big, complex "shell", pulling all these bits together into a single IDE, so that you can do more or less anything you want from within Creator without having to manually run up separate programs/tools manually/explicitly.

                A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by
                #10

                @JonB Next step ( before I read your last post )

                I am working with "device"

                Who "reads" the 'device.ui' ?
                More precisely -0 how do I know it was actually read ?

                I find this description little misleading -
                The term "form " is introduced , but actually
                ui-device.h FILE , not form , is generated by reading the "device.ui"

                Form generated from reading UI file 'device.ui'

                So if (?) "device.ui" is read - why my change in the actual l form did not take?

                JonBJ 1 Reply Last reply
                0
                • A Anonymous_Banned275

                  @JonB Next step ( before I read your last post )

                  I am working with "device"

                  Who "reads" the 'device.ui' ?
                  More precisely -0 how do I know it was actually read ?

                  I find this description little misleading -
                  The term "form " is introduced , but actually
                  ui-device.h FILE , not form , is generated by reading the "device.ui"

                  Form generated from reading UI file 'device.ui'

                  So if (?) "device.ui" is read - why my change in the actual l form did not take?

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #11

                  @AnneRanch
                  When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                  • The Designer file for the form (visual widgets) will be banana.ui.
                  • When uic banana.ui gets run it will produce a file named ui_banana.h.
                  • You will also have files banana.cpp and banana.h, which you can edit for your own code.
                  • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                  So if (?) "device.ui" is read - why my change in the actual l form did not take?

                  Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                  A 2 Replies Last reply
                  0
                  • JonBJ JonB

                    @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                    That gets me to QTDesigner and I can edit the form. At that point I have no knowledge how my editing gets implemented - sort of "under the hood" .

                    Designer reads the .ui file, and saves back to it if you make changes and save.

                    I exit the QTDesigner and go back to QTCreator

                    You should not be "exiting" the Designer or "go back to" Creator. You should be in Creator the whole time, never leaving it. Designer is available as a window inside Creator, which gets opened for you when you double click on a form. It's a window like many other windows in Creator, e.g. the C++ text editor is also a window there. You should be swapping between the Designer window and the Editor window all from within Creator.

                    only to find out that simple change of text of button text did not take.

                    Then something is wrong. When you say "change of text of button text did not take." you might mean you see that in one of two places. Can you be very specific:

                    1. You are looking at the button in Designer. You have not compiled or run your application after making a change. Is this where you do not see your edit?

                    2. You have compiled and run your application. In your running application you do not see your edit. Is this what you mean?

                    Obviously if #1 is true then #2 is (likely to be) true. But #2 might be true without #1 being true. So I'm sure you fall foul in #2, but is #1 bad fro you too? You made a change in Designer, saved; at a later date you are looking at in Designer and you do not visually see the change? Or do you always see your change visually in Designer but it does not "take" into the running application code?

                    Returning to earlier:

                    I exit the QTDesigner and go back to QTCreator

                    We really need to know exactly what you mean by this. If you are really running just Qt Designer as a separate thing you do, outside of Creator, that's wrong, and might cause problems if they do not have the exact same path to the .ui file.

                    A Offline
                    A Offline
                    Anonymous_Banned275
                    wrote on last edited by
                    #12

                    @JonB said in How to remove manually created form and replace with QTDesigner creatted one.:

                    @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                    That gets me to QTDesigner and I can edit the form. At that point I have no knowledge how my editing gets implemented - sort of "under the hood" .

                    Designer reads the .ui file, and saves back to it if you make changes and save.

                    I exit the QTDesigner and go back to QTCreator

                    You should not be "exiting" the Designer or "go back to" Creator. You should be in Creator the whole time, never leaving it. Designer is available as a window inside Creator, which gets opened for you when you double click on a form. It's a window like many other windows in Creator, e.g. the C++ text editor is also a window there. You should be swapping between the Designer window and the Editor window all from within Creator.

                    only to find out that simple change of text of button text did not take.

                    Then something is wrong. When you say "change of text of button text did not take." you might mean you see that in one of two places. Can you be very specific:

                    1. You are looking at the button in Designer. You have not compiled or run your application after making a change. Is this where you do not see your edit?

                    2. You have compiled and run your application. In your running application you do not see your edit. Is this what you mean?

                    Obviously if #1 is true then #2 is (likely to be) true. But #2 might be true without #1 being true. So I'm sure you fall foul in #2, but is #1 bad fro you too? You made a change in Designer, saved; at a later date you are looking at in Designer and you do not visually see the change? Or do you always see your change visually in Designer but it does not "take" into the running application code?

                    Returning to earlier:

                    I exit the QTDesigner and go back to QTCreator

                    We really need to know exactly what you mean by this. If you are really running just Qt Designer as a separate thing you do, outside of Creator, that's wrong, and might cause problems if they do not have the exact same path to the .ui file.

                    Please give me some credit - just because I do not spell / say I complied it does not mean I did not. Most of the time QT works as expected and compiles automatically after change is made.

                    JonBJ 1 Reply Last reply
                    0
                    • A Anonymous_Banned275

                      @JonB said in How to remove manually created form and replace with QTDesigner creatted one.:

                      @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                      That gets me to QTDesigner and I can edit the form. At that point I have no knowledge how my editing gets implemented - sort of "under the hood" .

                      Designer reads the .ui file, and saves back to it if you make changes and save.

                      I exit the QTDesigner and go back to QTCreator

                      You should not be "exiting" the Designer or "go back to" Creator. You should be in Creator the whole time, never leaving it. Designer is available as a window inside Creator, which gets opened for you when you double click on a form. It's a window like many other windows in Creator, e.g. the C++ text editor is also a window there. You should be swapping between the Designer window and the Editor window all from within Creator.

                      only to find out that simple change of text of button text did not take.

                      Then something is wrong. When you say "change of text of button text did not take." you might mean you see that in one of two places. Can you be very specific:

                      1. You are looking at the button in Designer. You have not compiled or run your application after making a change. Is this where you do not see your edit?

                      2. You have compiled and run your application. In your running application you do not see your edit. Is this what you mean?

                      Obviously if #1 is true then #2 is (likely to be) true. But #2 might be true without #1 being true. So I'm sure you fall foul in #2, but is #1 bad fro you too? You made a change in Designer, saved; at a later date you are looking at in Designer and you do not visually see the change? Or do you always see your change visually in Designer but it does not "take" into the running application code?

                      Returning to earlier:

                      I exit the QTDesigner and go back to QTCreator

                      We really need to know exactly what you mean by this. If you are really running just Qt Designer as a separate thing you do, outside of Creator, that's wrong, and might cause problems if they do not have the exact same path to the .ui file.

                      Please give me some credit - just because I do not spell / say I complied it does not mean I did not. Most of the time QT works as expected and compiles automatically after change is made.

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by JonB
                      #13

                      @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                      Please give me some credit - just because I do not spell / say I complied it does not mean I did not.

                      I have no idea what you mean. All I have done is try to explain things. I have not "failed to give you credit" for anything at any stage. If you're not happy with the explanation we can leave it, but I'm not going to be told I have not given you credit or been anything other than helpful and polite.

                      You haven't answered the question I gave you about #1 versus #2, so I am non the wiser as to where your phrasing of "why my change in the actual l form did not take?" refers to. Nor what your "I exit the QTDesigner and go back to QTCreator" means --- I can't tell whether you are in Creator the whole time and use Designer in one of its windows, or whether you go outside Creator and run up a separate Designer instance.

                      1 Reply Last reply
                      1
                      • A Offline
                        A Offline
                        Anonymous_Banned275
                        wrote on last edited by Anonymous_Banned275
                        #14

                        Here is the screenshot of QTDesigner
                        9649aa1a-a9cd-44af-8d8b-5df872f357b9-image.png

                        Here is the app run

                        fce6c9c9-a0b3-426b-8402-52129cfebcaf-image.png

                        Please note the button text in lower right corner .

                        How do I find WHICH whatever file (device ??? ) is run ?

                        1 Reply Last reply
                        0
                        • JonBJ JonB

                          @AnneRanch
                          When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                          • The Designer file for the form (visual widgets) will be banana.ui.
                          • When uic banana.ui gets run it will produce a file named ui_banana.h.
                          • You will also have files banana.cpp and banana.h, which you can edit for your own code.
                          • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                          So if (?) "device.ui" is read - why my change in the actual l form did not take?

                          Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                          A Offline
                          A Offline
                          Anonymous_Banned275
                          wrote on last edited by
                          #15

                          @JonB said in How to remove manually created form and replace with QTDesigner creatted one.:

                          @AnneRanch
                          When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                          • The Designer file for the form (visual widgets) will be banana.ui.
                          • When uic banana.ui gets run it will produce a file named ui_banana.h.
                          1. How do I verify
                            a. If `uic " runs at all ?
                            is there verbatim output available ?
                            (can i read the date of creation of NEW ui_deviice.h - where ?)
                            b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?
                          • You will also have files banana.cpp and banana.h, which you can edit for your own code.

                          That would defeat the GUI of QTDesigner....

                          • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                          That looks as an answer to above "date of creation " question.

                          So if (?) "device.ui" is read - why my change in the actual l form did not take?

                          Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                          PLEASE ..... get real....

                          Christian EhrlicherC JonBJ 2 Replies Last reply
                          0
                          • A Anonymous_Banned275

                            @JonB said in How to remove manually created form and replace with QTDesigner creatted one.:

                            @AnneRanch
                            When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                            • The Designer file for the form (visual widgets) will be banana.ui.
                            • When uic banana.ui gets run it will produce a file named ui_banana.h.
                            1. How do I verify
                              a. If `uic " runs at all ?
                              is there verbatim output available ?
                              (can i read the date of creation of NEW ui_deviice.h - where ?)
                              b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?
                            • You will also have files banana.cpp and banana.h, which you can edit for your own code.

                            That would defeat the GUI of QTDesigner....

                            • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                            That looks as an answer to above "date of creation " question.

                            So if (?) "device.ui" is read - why my change in the actual l form did not take?

                            Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                            PLEASE ..... get real....

                            Christian EhrlicherC Offline
                            Christian EhrlicherC Offline
                            Christian Ehrlicher
                            Lifetime Qt Champion
                            wrote on last edited by
                            #16

                            @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                            (can i read the date of creation of NEW ui_deviice.h - where ?)

                            man ls is your friend. Or a simple file manager which is able to show the creation date (so I would say all of them).

                            b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?

                            There is only one in a build directory, otherwise you should clear you build dir and start over. Also the generated file must not be in your source dir - maybe you copied it by accident in there.

                            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                            Visit the Qt Academy at https://academy.qt.io/catalog

                            A 1 Reply Last reply
                            1
                            • A Anonymous_Banned275

                              @JonB said in How to remove manually created form and replace with QTDesigner creatted one.:

                              @AnneRanch
                              When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                              • The Designer file for the form (visual widgets) will be banana.ui.
                              • When uic banana.ui gets run it will produce a file named ui_banana.h.
                              1. How do I verify
                                a. If `uic " runs at all ?
                                is there verbatim output available ?
                                (can i read the date of creation of NEW ui_deviice.h - where ?)
                                b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?
                              • You will also have files banana.cpp and banana.h, which you can edit for your own code.

                              That would defeat the GUI of QTDesigner....

                              • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                              That looks as an answer to above "date of creation " question.

                              So if (?) "device.ui" is read - why my change in the actual l form did not take?

                              Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                              PLEASE ..... get real....

                              JonBJ Offline
                              JonBJ Offline
                              JonB
                              wrote on last edited by JonB
                              #17

                              @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                              That would defeat the GUI of QTDesigner....

                              Told you what there is. You're wrong if you think/believe otherwise.

                              b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?

                              Hence your issue, as suspected.

                              PLEASE ..... get real....

                              Pardon? You're not wishing to be insulting again are you?

                              1 Reply Last reply
                              2
                              • Christian EhrlicherC Christian Ehrlicher

                                @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                                (can i read the date of creation of NEW ui_deviice.h - where ?)

                                man ls is your friend. Or a simple file manager which is able to show the creation date (so I would say all of them).

                                b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?

                                There is only one in a build directory, otherwise you should clear you build dir and start over. Also the generated file must not be in your source dir - maybe you copied it by accident in there.

                                A Offline
                                A Offline
                                Anonymous_Banned275
                                wrote on last edited by
                                #18

                                @Christian-Ehrlicher said in How to remove manually created form and replace with QTDesigner creatted one.:

                                @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                                (can i read the date of creation of NEW ui_deviice.h - where ?)

                                man ls is your friend. Or a simple file manager which is able to show the creation date (so I would say all of them).

                                QTCreator does same

                                b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?

                                There is only one in a build directory, otherwise you should clear you build dir and start over. Also the generated file must not be in your source dir - maybe you copied it by accident in there.
                                '
                                it is source directory and I did not put it there .

                                It is same as when I use QTCreator to build dialog project and it works / updates just fine.

                                All good points...'

                                Now let's answer this - used as a troubleshooting aid
                                I added "go to slot " by pressing the button on the form in question
                                it works as expected

                                my conclusion
                                the form was saved / updated/ complied /uic and processed correctly

                                so WHY same is not happening when text of the button is changed ?

                                what is the difference ?

                                1 Reply Last reply
                                0
                                • JonBJ JonB

                                  @AnneRanch
                                  When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                                  • The Designer file for the form (visual widgets) will be banana.ui.
                                  • When uic banana.ui gets run it will produce a file named ui_banana.h.
                                  • You will also have files banana.cpp and banana.h, which you can edit for your own code.
                                  • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                                  So if (?) "device.ui" is read - why my change in the actual l form did not take?

                                  Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                                  A Offline
                                  A Offline
                                  Anonymous_Banned275
                                  wrote on last edited by Anonymous_Banned275
                                  #19

                                  @JonB said in How to remove manually created form and replace with QTDesigner creatted one.:

                                  @AnneRanch
                                  When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                                  • The Designer file for the form (visual widgets) will be banana.ui.
                                  • When uic banana.ui gets run it will produce a file named ui_banana.h.

                                  I have deleted existing references ( include ) to my ui_device .h .
                                  Run "clear" AND "rebuild" .

                                  It failed with multiple errors .....

                                  If file "ui_device.h " is "produced" - where is it ?
                                  It seems logical the compiler has to be made aware of it - using "include ".
                                  Is there any other way to make sure it is being created ?

                                  • You will also have files banana.cpp and banana.h, which you can edit for your own code.
                                  • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                                  So if (?) "device.ui" is read - why my change in the actual l form did not take?

                                  Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                                  JonBJ 1 Reply Last reply
                                  0
                                  • A Anonymous_Banned275

                                    @JonB said in How to remove manually created form and replace with QTDesigner creatted one.:

                                    @AnneRanch
                                    When you create a form in Designer (that's the word it uses for a "visual widget you design") you might call it form or device or banana. Let's say it's banana. Then:

                                    • The Designer file for the form (visual widgets) will be banana.ui.
                                    • When uic banana.ui gets run it will produce a file named ui_banana.h.

                                    I have deleted existing references ( include ) to my ui_device .h .
                                    Run "clear" AND "rebuild" .

                                    It failed with multiple errors .....

                                    If file "ui_device.h " is "produced" - where is it ?
                                    It seems logical the compiler has to be made aware of it - using "include ".
                                    Is there any other way to make sure it is being created ?

                                    • You will also have files banana.cpp and banana.h, which you can edit for your own code.
                                    • banana.cpp will have a #include "ui_banana.h" line and a #include "banana.h" line.

                                    So if (?) "device.ui" is read - why my change in the actual l form did not take?

                                    Maybe when you answer questions in my previous post about what you might mean by "I exit the QTDesigner and go back to QTCreator only to find out ..." we may know.

                                    JonBJ Offline
                                    JonBJ Offline
                                    JonB
                                    wrote on last edited by JonB
                                    #20

                                    @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                                    If file "ui_device.h " is "produced" - where is it ?

                                    Your ui_device.h should be being produced in the "build output directory", for which ever configuration *debug, release, ...) you are building for. Cannot say for sure where yours is, depends on your configuration settings. I often put mine in a difference place. If you are using the default I think you go to the parent of the directory containing your source files and look for a directory named something like build-projectname-debug.... Your compiler's .o files are there, as is your executable.

                                    If you have a ui_....h file in the same directory as your source files (where the ....ui file is), that is bad, try deleting it.

                                    Do not delete your .ui files though till you are sure what is going on! Keep a backup copy.

                                    I have deleted existing references ( include ) to my ui_device .h .

                                    If you remove the #include "ui_device.h" line from your device.cpp file it will not compile. ui_device.h holds the C++ generated from the .ui, and your device.cpp will likely be making lots of references to its content.

                                    1 Reply Last reply
                                    1
                                    • A Offline
                                      A Offline
                                      Anonymous_Banned275
                                      wrote on last edited by Anonymous_Banned275
                                      #21

                                      The discussion will not resolve the issue by repeating the same...

                                      Now let's answer this riddle

                                      • used as a troubleshooting aid-

                                      I added "go to slot " function in QTDesigner (file) activated by "pressing the button" on the form in question. It shows in QTCreator in all usual places without any additional need for verification of any of the files involved.

                                      it works as expected

                                      my conclusion
                                      the file / form was saved / updated/ complied /uic etc. and processed correctly

                                      so WHY same is not happening when text of the button is changed ?

                                      what is the difference ?

                                      ADDENDUM (APR 30)
                                      AFTER a source files are renamed and project is saved / rebuild , then the
                                      "created " ui_device.h file STILL refers to the original "device.ui" which no longer exist.

                                      ecfd4509-3a54-4fc8-92e9-865a5136ba88-image.png

                                      807cd831-54df-4ccb-a4c5-ce4a72f3f4c4-image.png

                                      speculation:

                                      either uic is bogus or the original file is still used ( most likely ).

                                      JonBJ 1 Reply Last reply
                                      0
                                      • Christian EhrlicherC Offline
                                        Christian EhrlicherC Offline
                                        Christian Ehrlicher
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #22

                                        As already said - you most likely have another generated file somewhere in your compiler search path - you're doing a lot of strange things so this is the most likely version.
                                        Remove all occurrences of ui_*.h and compile your application. Then this file is re-generated and used by the compiler.
                                        Neither QtCreator nor the compiler can do anything against your strange way copying data around...

                                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                        Visit the Qt Academy at https://academy.qt.io/catalog

                                        1 Reply Last reply
                                        1
                                        • A Anonymous_Banned275

                                          The discussion will not resolve the issue by repeating the same...

                                          Now let's answer this riddle

                                          • used as a troubleshooting aid-

                                          I added "go to slot " function in QTDesigner (file) activated by "pressing the button" on the form in question. It shows in QTCreator in all usual places without any additional need for verification of any of the files involved.

                                          it works as expected

                                          my conclusion
                                          the file / form was saved / updated/ complied /uic etc. and processed correctly

                                          so WHY same is not happening when text of the button is changed ?

                                          what is the difference ?

                                          ADDENDUM (APR 30)
                                          AFTER a source files are renamed and project is saved / rebuild , then the
                                          "created " ui_device.h file STILL refers to the original "device.ui" which no longer exist.

                                          ecfd4509-3a54-4fc8-92e9-865a5136ba88-image.png

                                          807cd831-54df-4ccb-a4c5-ce4a72f3f4c4-image.png

                                          speculation:

                                          either uic is bogus or the original file is still used ( most likely ).

                                          JonBJ Offline
                                          JonBJ Offline
                                          JonB
                                          wrote on last edited by JonB
                                          #23

                                          @AnneRanch said in How to remove manually created form and replace with QTDesigner creatted one.:

                                          The discussion will not resolve the issue by repeating the same...

                                          The discussion will not be resolved by not acting on what we try to tell you repeatedly!

                                          What have you done about:

                                          If you have a ui_....h file in the same directory as your source files (where the ....ui file is), that is bad, try deleting it.

                                          ?

                                          b. It appears that there are at lest TWO "device.ui" - therefore which one is being run - by "uic" ?

                                          There cannot be two files named device.ui in the same directory. So they must presumably be in different directories.

                                          • If you want to know which one where is being written to by Designer, make a change in Designer, save, and look at the file modification time on each of the .ui files.

                                          • If you want to know which one is being read by uic, temporarily rename/move the .ui files one at a time, which one causes the build to complain?

                                          • If you want to know where/when uic is putting the ui_....h file it generates from the .ui, remove all ui_....h files from source and build output directories, rebuild, and see where it appears.

                                          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