当前目录的子目录包含父目录的头文件应该是:#include "../test.h",如果想这样写#include "test.h",需要在pro中加入:INCLUDEPATH += $$PWD Qt4到Qt5 QtMsgHandler替换为QtMessageHandler