Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Vim clang complete How to get qt to autocomplete?

I've been searching around for a while but I can't find a source to where I can make vim c++ autocomplete qt classes, functions, etc.

Clang complete works using SFML and the standard c++ libraries, I don't understand why it doesn't work with qt?

Thanks.

like image 433
zero57 Avatar asked Feb 19 '23 07:02

zero57


1 Answers

You have to tell clang where to look for the Qt header files. This is done with the -I/path/to/headers flag. You can specific compiler flags for a specific project by adding them to a file named .clang_complete in your project's directory. Basically any compiler flags used to compile your code must be in your .clang_complete file. For example for Qt my .clang_complete file contains

-I/usr/local/include/QtCore
-I/usr/local/include/QtOpenGL
-I/usr/local/include/QtGui

clang_complete also includes a script to automatically generate .clang_complete files. clang_complete's help file describes how to use it. You can also type the command :help clang_complete in vim to access the help.

like image 193
David Brown Avatar answered Mar 03 '23 05:03

David Brown