1 cmd窗口cd到moc.exe 2 键入命令:如 moc [你的Qt安装目录]\qtbase\src\widgets\widgets\qtextedit.h -o [你想要输出的目录]\moc_qtextedit.cpp