[SOLVED] Autocomplete stopped in Qt Creator using SCons
Using Qt Creator 2.6.0, Qt 4.8.2
We used to use QMake and project files to build our project and enjoyed the great autocomplete features in Qt Creator. Now we have had to move to a SCons based build system.
Autocomplete has stopped working for all Qt types. in fact, lines like
are highlighted as
@QMainWindow: No such file or directory@
Its builds fine using our SCons system.
I understand that this is because Qt creator doesnt know where my Qt install is since I am not using qmake, but I have the kit setup and pointing to my Qt SDK so whats the big problem?
Is there a way I can 'remind' Qt Creator where to find Qt files?
Do you still have a .pro file that describes your project, and which modules it is using?
A pro file is archived, yes, but its not used at present. Since its a SCons build, we're just using the make style:
I don't believe I can use a pro file too can I? Just to describe which modules - QtCore, QtGui, QtTest and QtNetwork in our case
QtCreator needs a build system it supports to know which modules are included, and of course which files are in the project. I think SCons is not one of the supported build sytems. AFAIK, only qmake, cmake and QBS (experimental) are supported.
That makes it hard to work with Creator effectively in this case.
Creator gets the include paths from the build system. -So did cmake detect Qt properly?- Which kind of project (and thus build system) are you using now? Does that detect Qt properly? If you are using a generic project: Did you set the relevant header paths and macros in the generic project configuration files?
Andre: Actually there is autotools support as well, but that plugin is still marked as experimental.
[quote author="Tobias Hunger" date="1360915527"]Andre: Actually there is autotools support as well, but that plugin is still marked as experimental.[/quote]
One learns something new every day :-)
(not that I think autotools is a viable solution for a build system...)
Tobias, what did you mean by this ?
Did you set the relevant header paths and macros in the generic project configuration files?
Did you set up the generic project with the header paths and macros? There are files that creator reads to extract that information from. Check the documentation on generic projects for the details, I don't remember them right now.
Ok so solution was very easy. just add the Qt Include dirs to the myproject.includes file, eg:
It all works! Qt types recognised and autocomplete restored. I was helped by this old page: http://cisharp.blogspot.co.uk/2009/08/qt-creator-tipps.html
The process is also described in the docs as Tobias says, which I had read but misunderstood:
Still seems daft having to tell Qt Creator about the Qt installation in this way.
sipickles: How is Creator supposed to extract that kind of information from a build system it does not understand at all? You could have configure that system to use something completely different from what you put into your kits. You may or may not use Qt at all in your project.