[SOLVED] Autocomplete stopped in Qt Creator using SCons
-
wrote on 14 Feb 2013, 12:57 last edited by
Using Qt Creator 2.6.0, Qt 4.8.2
Hi,
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
@#include <QMainWindow>@
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?
Thanks
Simon
-
wrote on 14 Feb 2013, 13:13 last edited by
Do you still have a .pro file that describes your project, and which modules it is using?
-
wrote on 14 Feb 2013, 20:22 last edited by
Hi Andre,
A pro file is archived, yes, but its not used at present. Since its a SCons build, we're just using the make style:
*.files
*.includes
*.configI 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
-
wrote on 15 Feb 2013, 07:51 last edited by
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.
-
wrote on 15 Feb 2013, 08:01 last edited by
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?
-
wrote on 15 Feb 2013, 08:05 last edited by
Andre: Actually there is autotools support as well, but that plugin is still marked as experimental.
-
wrote on 15 Feb 2013, 08:06 last edited by
[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...)
-
wrote on 15 Feb 2013, 13:29 last edited by
Tobias, what did you mean by this ?
Did you set the relevant header paths and macros in the generic project configuration files?
-
wrote on 15 Feb 2013, 20:01 last edited by
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.
-
wrote on 15 Feb 2013, 23:12 last edited by
Ok so solution was very easy. just add the Qt Include dirs to the myproject.includes file, eg:
@C:/Qt/4.8.3/include/QtCore
C:/Qt/4.8.3/include/QtGui
C:/Qt/4.8.3/include/QtTest
@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:
http://doc.qt.digia.com/qtcreator-snapshot/creator-project-generic.html#specifying-include-paths
Thanks
-
wrote on 16 Feb 2013, 10:30 last edited by
Still seems daft having to tell Qt Creator about the Qt installation in this way.
-
wrote on 21 Feb 2013, 12:20 last edited by
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.
1/12