QT Creator,对c ++ 11的语法检查 [英] QT Creator, syntax checking for c++11

查看:730
本文介绍了QT Creator,对c ++ 11的语法检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何关闭基于c ++ 11周期范围的运算符的错误突出显示(代码下面的红色波形)?

  int myint [] = {1,2,3,4,5}; 
for(auto x:myint){/ ** /}

悬停提示会显示意外标记



另一个问题 - 自动完成不会在中显示 unique_ptr




  • Qt Creator 2.4.0基于Qt 4.7.4 32 bit)建于2011年12月12日
    01:10:32


解决方案

如果你使用C ++ 11编写,你应该从使用QT Creator作为IDE改为使用Eclipse CDT。至少这是我如何解决这个问题。 QT Creator似乎没有任何方法来定制这种实时语法检查。

更新:我认为QtCreator已经改进了对较新版本的C ++的支持,因为这个答案给了,所以它不再是正确的。我无法删除它,因为它是一个接受的答案。


How to turn off error highlighting (red wave under the code) for c++11 cycle range-based operators like that?

int myint[] = {1,2,3,4,5};
for (auto x : myint){/**/}

Hover prompt shows "unexpected token :". The code compiles perfectly.

Another issue - the autocomplete doesn't show unique_ptr in std:: namespace, though compiles OK.

  • Qt Creator 2.4.0 Based on Qt 4.7.4 (32 bit) Built on Dec 12 2011 at 01:10:32

解决方案

If you're writing in C++11 you should change from using QT Creator as the IDE to using Eclipse CDT. At least this is how I solved this problem. QT Creator doesn't seem to have any way to customize this real-time syntax checking. Eclipse on the other hand is extensively customizable in this regard.

Update: I think that QtCreator has improved its support for newer versions of C++ since this answer was given, so it is no longer correct. I can't delete it as it is an accepted answer.

这篇关于QT Creator,对c ++ 11的语法检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆