Home > Back-end >  Qt to recompile the UI file, before will be automatically generated ui_ *. H file cover, the content
Qt to recompile the UI file, before will be automatically generated ui_ *. H file cover, the content

Time:10-20

Reason:
Because of fully using the code interface efficiency is lower, and make use of Qt Designer interface, although can raise efficiency, but some things on the surface of the lower boundary effect and interaction not good full support, so want to use Qt Designer draw the interface of the control and the layout, and some special effect and interaction in making the UI files generated ui_ *. H file, and then drawn through code realization,

Question:
UI files automatically generated ui_ *. H file, will at the next compile UI file are covered, so once there is interface of control or to modify the layout of compiling the UI file, before adding the code will be lost, so want to ask, what is good working method, can solve this problem?

CodePudding user response:

Search "pre-populated event command line"

CodePudding user response:

UI. H generally does not need to be modified... Well, I haven't changed.

CodePudding user response:

reference 1st floor zhao4zhong1 response:
search "pre-populated event command line"

Hello, how do I use pre-populated event mechanism to solve ui_ in qt designer *. H file covered this problem?

CodePudding user response:

reference u012412292 reply: 3/f
Quote: refer to 1st floor zhao4zhong1 response:

Search "pre-populated event command line"

Hello, how do I use pre-populated event mechanism to solve ui_ in qt designer *. H file covered this problem?

In your "pre-populated event command line" fill in your batch or the code of the generated exe program is compiled, according to the command line parameter copy or rename or merge the old ui_ *. H file to the new ui_ *. H file,

CodePudding user response:

No matter what you want to do, should not be to change ui_ * h, because it is based on the UI files automatically generated,
Do you have the design of the MainWindow class, for example, there will be three file MainWindow. H MainWindow. CPP MainWindow. UI
If you want to use the code rewrite what, should go to the MainWindow. CPP

CodePudding user response:

Thank you, is I'm not familiar with qt designer workflow reasons leading to the emergence of the problem, is now familiar with its working process and method of use, this problem does not exist, thank you

CodePudding user response:

How do you solve, can you tell me? I also met the same problem, but I don't know how to solve

CodePudding user response:

The building Lord, how are you,
Can use inheritance method, to avoid the problem of covered,
Basic UI by mapping the UI files, custom and individuality demand, through inheritance,
If the original poster is the use of qt5, should not have this problem,

CodePudding user response:

Suggested to add controls to write their own source file Riga, don't add the UI files

CodePudding user response:

Hello, to you to ask you this question, now encountered this problem, don't know how to solve, the development environment is vs2010 + qt5, hope you can give a direction,

CodePudding user response:

So the automatically generated files are tips you can't change the words in your code,
So these files could not be modified,
If you do need to modify these, use of header files or macro definition to modify,

CodePudding user response:

Since ui_ * h cannot be modified, so you should not have to add something in the file;

I met is the case, on the qt is not too familiar with;

~ so solid foundation is very important

CodePudding user response:

Change. The UI files, intermediate file does not need to be modified
  • Related