在用Qt做记事本的时候出现:QPrinter:no such file or directory 的错误,解决方法如下: 在.pro文件中添加下面一行代码: qtHaveModule(printsupport)