[Qt-creator] Have Locate... provide all files in a CMake project

Ziller Eike Eike.Ziller at theqtcompany.com
Fri Jan 9 13:38:47 CET 2015


> On Jan 9, 2015, at 12:57 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> 
> Hi,
> 
> I'm working with qtcreator on a cmake-based project that has plenty of conditionally-included source files in the CMakeLists.txt. That is various files are only included when building on mac or win32. Hence these files do not end up in the generated codeblocks project file.
> 
> It seems QtCreator bases its 'files in project' locator solely on this list of files from the codeblocks file and I'm wondering wether there's an easy way to make it consider all files that are part of the git repository or at least all files in directories it has in the projects tree.
> 
> Even though I don't want to and cannot edit these files since I cannot compile them I regularly read them to check certain things and having to switch to another machine just for that would be quite annoying. Similarly annoying is to have to use the normal file-open dialog to open these after having opened another file in that directory and that does not work at all if a whole subdir is disabled on my platform in cmake.

Since we do not parse the cmake files ourselves, Qt Creator only knows about the files in the project that are used by the configuration that you use to run cmake to generate the codeblocks project file.

Please note that the base directory for the “Files in File System (f)” locator filter is the directory of the current editor. That is something that I use very often.

You can also create your own filter that provides all files from some directory tree(s)
http://doc.qt.io/qtcreator/creator-editor-locator.html#creating-locator-filters
though these use a static list of directories and are saved globally. (Possibly it would make sense to have them optionally saved in the session instead.)

A filter that provides access to all included files from all C++ files in your projects, even if they are not listed in any project, is also in the works
(https://codereview.qt-project.org/101408) but that will not solve your problem for files that belong to a different configuration.

Br, Eike
-- 
Eike Ziller, Senior Software Engineer - Digia, Qt
 
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list