0

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 not support these headers?

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
Maelstorm
  • 580
  • 2
  • 10
  • 29
  • 3
    What is your question? If you're just filing a bug then please do so in the appropriate place on the appropriate website. – Lightness Races in Orbit Jan 05 '13 at 22:33
  • I don't see any reason why the plugin should behave differently between Qt4 and Qt5. I would check if you maybe have to define more include paths to make Qt5 find all its header files. You could also check with calling `:Errors` if there are any additional errors preventing Syntastic to show line-based errors. – kongo2002 Jan 10 '13 at 18:43

0 Answers0