在 qt 设计器中指定生成的 "ui_" 文件的位置

Specify location of generated "ui_" file in qt designer

有什么方法可以在 Qt Creator/Designer 中指定保存自动生成的 "ui_" 文件的位置吗?

我已经建立了一个带有子目录的项目结构,但有这种类型的代码很奇怪:

#include some/subdir/myform.h
#include ui_myform.h

谢谢!

您应该能够在 .pro 的 UI_DIR 指令中指定它。 你会在这里找到更多相关信息:http://qt-project.org/doc/qt-4.8-snapshot/qmake-variable-reference.html#ui-dir