Qt无法打开包含文件:'QPrinter' [英] Qt Cannot open include file: 'QPrinter'

查看:3110
本文介绍了Qt无法打开包含文件:'QPrinter'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Qt的新手。下载了SourceForge的Qt应用程序的源代码,并尝试构建并运行它。通过向.pro文件添加 QT + = 语句来解决一些类似的问题之后,我坚持这个:

I am new to Qt. Downloaded source code for a Qt application of SourceForge, and tried to build and run it. After working through a few similar problems by adding QT += statements to .pro files, I am stuck on this one:

试图在Qt Creator中构建时,我收到错误

On attempting to build in Qt Creator, I get errors saying


错误:C1083:无法打开包含文件:'QPrinter':没有这样的文件或目录

error: C1083: Cannot open include file: 'QPrinter': No such file or directory

我尝试将 QT + = printsupport 添加到.pro文件,清理和重建,但是会出现此错误

I tried adding QT += printsupport to the .pro file, cleaning, and rebuilding, but that gives this error


错误:依赖'.. \ .. \ .. \..\..\..\..\..\..\..\..\Qt\Qt5.1.1\5.1.1\msvc2012_64\ include \ QtPrintSupport \ qtprintsupportglobal.h'不存在。

Error: dependent '..\..\..\..\..\..\..\..\..\..\..\Qt\Qt5.1.1\5.1.1\msvc2012_64\include\QtPrintSupport\qtprintsupportglobal.h' does not exist."

当我去 C时: \ Qt \ Qt5.1.1 \5.1.1 \msvc2012_64 \include \QtPrintSupport ,qtprintsupportglobal.h就在那里!

When I go to C:\Qt\Qt5.1.1\5.1.1\msvc2012_64\include\QtPrintSupport, qtprintsupportglobal.h IS THERE!

推荐答案

您必须添加QP rinter支持你的项目.pro文件:

You have to add QPrinter Support to your project's .pro file:

QT += printsupport

这篇关于Qt无法打开包含文件:'QPrinter'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆