报错
按如下源码所示修改了.pro文件后出现了如下图1错误
#-------------------------------------------------
#
# Project created by QtCreator 2024-01-29T09:24:31
#
#-------------------------------------------------
QT += core gui concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
OBJECTS_DIR = __build/obg
MOC_DIR = __build/moc
UI_DIR = __build/ui
RCC_DIR = __build/rcc
![](https://i-blog.csdnimg.cn/blog_migrate/20b0078736b681b06ae5a3e8fb4352af.png)
解决方案
.pro文件中加上UI_DIR路径即可
#-------------------------------------------------
#
# Project created by QtCreator 2024-01-29T09:24:31
#
#-------------------------------------------------
QT += core gui concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
OBJECTS_DIR = __build/obg
MOC_DIR = __build/moc
UI_DIR = __build/ui
RCC_DIR = __build/rcc
INCLUDEPATH += $$UI_DIR