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

找到 cmakelists.txt 打开,在如下位置添加就可以了。

set(PROJECT_SOURCES
        main.cpp
        mainwindow.cpp
        mainwindow.h
        mainwindow.ui
        dialog.h     //这是后来添加的对话框文件
        dialog.cpp  //
        dialog.ui    //

)

猜你喜欢

转载自blog.csdn.net/wangz76/article/details/124497522