How can I automatically generate files like ui_xxx.h、moc_xxx.h form *.ui?

I want to create a panel of my own in slicer, I copy a file such as ui and corresponding ui_xxx.h, moc_xxx.cpp, and change its name, smoother can run properly; I edited the .ui file in Qt, how can I automatically generate files like ui_xxx.h, and how can the moc_xxx.cpp file be generated automatically? Thanks.
Like the following files, I think they are automatically generated???
fang1

If you add the .ui file to CMakeLists.txt (search for UI_SRCS) then the associated files will be generated during the build process.

Thank you very much. I wish you a happy life !!!

1 Like