如何在Eclipse中设置QT路径,而不使用“Qt项目”? [英] How to set QT paths in Eclipse without using the "Qt project"?

查看:190
本文介绍了如何在Eclipse中设置QT路径,而不使用“Qt项目”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个混合的C ++ / Qt / Python项目在Eclipse中管理,我想设置Qt路径,而不将我的项目设置为Qt项目。



使用CDT并将其设置为常规Makefile project from existing code,我在项目属性中找不到任何选项,我可以在其中设置Qt路径。
如果项目设置为非Qt项目,菜单QT似乎从项目属性中消失。



我设置了Qt包含路径(例如/ include / QtGui /)在C ++ General - > Paths& Symbols选项中,但是include包括(例如#include)仍然被Eclipse标记为未解析。



您能帮我以正确的方式设置Qt路径吗?



UPDATE



我最终将项目设置为Qt GUI项目,然后删除Qt插件为我创建的所有文件,然后在构建配置中添加所有我的C ++包含路径。



它工作,但不幸的是,Qt Gui项目缺乏很好的功能,你可以在标准CDTC ++项目中找到从其他项目导入配置,等等...

所以我仍然想听听你的意见,如果你有提示设置一个干净的C ++项目,使用Qt类。

解决方案

很好,你提供的Qt包含路径看起来怀疑我。你真的有一个目录在你的根名为'include'??大多数不会。



此外,通常QtGui在内的Qt包含目录,你有其他人像QtCore等。 / p>

但是就Eclipse中的设置而言,你是在正确的路径。


I have a mixed C++/Qt/Python project managed in Eclipse, and I would like to set the Qt paths without setting my project as a "Qt Project".

Using CDT and setting it as general "Makefile project from existing code", I cannot find any option in the project properties, where I can set the Qt paths. The menu "QT" seems to disappear from the project Properties if the project is set as other than "Qt Project".

I set the Qt include path (e.g. /include/QtGui/) in the "C++ General --> Paths & Symbols" option, but the includes (e.g. #include ) are still marked as "unresolved" by Eclipse.

Could you help me setting the Qt paths in the right way?

UPDATE

I ended up setting the project as "Qt GUI Project", then removing all files the Qt plugin created for me, and then adding all my C++ include paths in the build configuration.

It worked, but unfortunately the "Qt Gui Project" lacks of nice features you can find in the standard CDT "C++ project" as importing configurations from other projects, and so on...

so I still would like to hear from you, if you have hints to set a clean C++ project which makes use of Qt classes.

解决方案

Well, the Qt include path you're supplying looks suspect to me. Do you really have a directory on your root called 'include'?? Most don't.

Also, usually QtGui is within the Qt include directory, where you've got others like QtCore and such.

But as far as settings in Eclipse go, you're on the right path.

这篇关于如何在Eclipse中设置QT路径,而不使用“Qt项目”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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