Qt Creator is not indexing header files in docker container
-
Hi all;
I wanted to make a setup with new docker plugin. My target system using ubuntu 18.04 with qt5 and host system is ubuntu 21.04. So instead of using vm I wanted to try docker plugin. Qt creator that I'm using is 7.0.2 and it can use docker container (container includes: cmake 3.16.3, gcc, qt4 and qt5, etc.) without problem. But Creator IDE is not indexing .h files (QT and non-QT) so developing code ise very messy and difficult. in IDE, I tried to set sysroot from docker container but it didn't work. Is there any ideas or what I'm missing?
Thanks
-
Hi,
The Docker plugin in Qt Creator 7.0.2 is already quite old and still very experimental, so indexing is not expected to work at all. While in 9.0 the indexing is still not quite ready to use, you can already get some indexing to work by installing clangd in the docker and selecting it in the project settings. ( Projects => Project Settings => Clangd, underneath where you can edit the Build & Run configuration ). You do have to create the path manually though, as the file chooser does not support remote paths there yet. The path then needs to look similar to: "docker://qt-linux-llvm:latest/usr/bin/clangd".
This at least allows you to jump to definitions inside your project. Qt Creator 10.0 will probably streamline this a lot more.