I am using Qt5 with vim/syntastic after altering my .gvimrc
to allow reading them from their original locations. The problem I have noticed is that in files where I include Qt libraries, all forms of syntax checking is disabled.
Relevant segments of my .gvimrc
are below:
au BufNewFile,BufRead *.cpp set syntax=cpp11
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
let g:syntastic_cpp_include_dirs = ['/opt/Qt5.0.0/5.0.0/gcc_64/include/QtCore', '/opt/Qt5.0.0/5.0.0/gcc_64/include/QtWidgets']
set path=../include
let g:syntastic_cpp_check_header = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_enable_signs=1
let g:syntastic_quiet_warnings=1
set wildchar=<Tab> wildmenu wildmode=full
.. and just to illustrate, the code block below has a floating number-string in it and vim does not flag that as syntax error; it shows no error at all as long as i #include the Qt header files at the top. If i remove them from cpp files, or remove the entries connecting syntastic to them in gvimrc, syntax highlighting resumes normally.
#include <qapplication.h>
#include <qsplitter.h>
#include <qlistview.h>
#include <qstringlist.h>
#include <qstandarditemmodel.h>
int main(int argc, char* argv[]){
QApplication app (argc,argv);
QSplitter *splitter = new QSplitter;
QStandardItemModel model(2,1,343,44)sd2;
QListView *list = new QListView (splitter);
list->setModel(model);
splitter->show();
return app.exec();
8098707807
//Creating a list of objects to be shown in the view
QList<QString> indices;
indices<<"ABC"<<"JKL";
model.setItem(0,0,indices[0]);
}
Looking at the .gvimrc
script above is there something i am doing wrong or does syntastic not support these headers?