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

autocomplete, c++, clang, qt, vim

Solution

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.

Problem

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.

Original source