eclipse 如何用Eclipse CDT开发QT项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26084388/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How develop QT project with Eclipse CDT?
提问by cyberpunker
The QT's Eclipse——integration plugin has been invalid.
QT的Eclipse——集成插件已经失效。
Is there any method that we can just build a project involved QT within the Eclipse CDT?
有没有什么方法可以让我们在 Eclipse CDT 中构建一个涉及 QT 的项目?
Like , I got the QT's library and header files and the moc , then if I just design the GUI with code , I can directly debug and compile the QT project in the Eclipse CDT .
比如,我拿到了QT的库和头文件以及moc,那么如果我只是用代码设计GUI,我可以直接在Eclipse CDT中调试和编译QT项目。
Is there any solution ? I see the NetBeans can do this ,but it seems just support to QT4 but not to QT5
有什么解决办法吗?我看到 NetBeans 可以做到这一点,但似乎只支持 QT4 而不是 QT5
thanks .
谢谢 。
回答by Max Go
You can just add Qt headers and libs directories as global Eclipse paths for C++ includesdirectories and for libraries.
您可以将 Qt 头文件和库目录添加为 C++包含目录和库的全局 Eclipse 路径。
For Qt 5 it's folders include
and lib
in the root Qt installation folder.
对于 Qt 5,它是文件夹include
和lib
Qt 安装根文件夹。
[Updated] Because to generate correct makefiles from .pro file you need to run qmake everytime, I suggest to look into the direction of custom build commands.
[更新] 因为要从 .pro 文件生成正确的 makefile,您需要每次运行 qmake,我建议查看自定义构建命令的方向。
Also hereit's not recommended to try to do this directly.
同样,这里不建议尝试直接执行此操作。