How to set QT paths in Eclipse without using a “Qt project”?

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 installing it as a general Makefile project from existing code, I cannot find any option in the project properties where I can set the Qt paths. The QT menu seems to disappear from the project property if the project is specified differently from the Qt Project.

I set the Qt enable path (for example / include / QtGui /) in the "C ++ General → Paths and Symbols" option, but the included ones (for example, #include) are still marked as "unresolved" Eclipse.

Could you help me configure Qt paths correctly?

UPDATE

I finished setting up the project as a “GUI Project GUI”, and then deleted all the files that the Qt plugin created for me, and then added all my C ++ include paths to the build configuration.

This worked, but, unfortunately, the “Qt Gui Project” lacks interesting functions that you can find in the standard “C ++” CDT project, like importing configurations from other projects, etc.

so I would still like to hear from you if you have any hints at setting up a clean C ++ project that uses Qt classes.

+2
source share
3 answers

Well, Qt includes the path you supply, which looks suspicious to me. Do you really have a directory in your root called include? Most do not.

Also, usually QtGui is in the Qt include directory, where you have others like QtCore, etc.

But as far as settings in Eclipse are concerned, you are on the right track.

+2
source

I gave the Qt include path as / usr / include / qt 4 and the bin path as / usr / bin and it works fine

+1
source

You can do just that by following these instructions:

With this method, you don't have to screw in using Eclipse, including the paths to the QT headers or the paths of the Eclipse library for QT binaries. In addition, you do not have to rely on the legacy Eclipse integration plugin, which I assume you are currently using.

Essentially, you create a pair of creators that invoke qmake. From this, Eclipse can resolve included library paths and symbols and binaries for linking in one (or two) clean steps.

+1
source

All Articles