QT6 “Files are not automatically added to the CMakeLists.txt file of the CMake project.”

 

Find cmakelists.txt and open it, just add it in the following location.

set(PROJECT_SOURCES
        main.cpp
        mainwindow.cpp
        mainwindow.h
        mainwindow.ui
        dialog.h //This is the dialog file added later
        dialog.cpp //
        dialog.ui //

)

Guess you like

Origin blog.csdn.net/wangz76/article/details/124497522