QtCreator and ClangCodeModel plugin










3















I just installed QtCreator 4.7.2, which comes with ClangCodeModel plugin by default on. After my CMake project was parsed I saw much better highlighting of keywords in the code and also awesome intellisense handling of auto declared variables.



The downside was that the ClangCodeModel plugin was buggy, and gave me errors and warnings in parts of code that didn't make sense, especially the ones in 3rd party library header files. So I was forced to turn it off.



I'm wondering if Clang can be configured in QtCreator, so that minimal checks can happen. I played with these settings, but nothing made a difference:



enter image description here



1) Has anyone been able to configure this plugin in QtCreator so that it can work better? I am mostly concerned about intellisense. I can open the same CMake project in Visual Studio and I have much better intellisense there, but I prefer using Qt Creator.



2) If #1 is not possible because the plugin has bugs, what are the other means of improving intellisense in Qt Creator with CMake projects?










share|improve this question

















  • 1





    QtCreator 4.8 (currently the beta) comes with support for the language-server-protocol. This might be a good alternative

    – Felix
    Nov 18 '18 at 0:26











  • Probably those settings only apply to the visual output in the edit pane. I can see the warnings disappear when I apply "level0 checks" for instance. When I select "almost everything" option they re-appear instantly.

    – Frederik De Ruyck
    Nov 19 '18 at 16:40















3















I just installed QtCreator 4.7.2, which comes with ClangCodeModel plugin by default on. After my CMake project was parsed I saw much better highlighting of keywords in the code and also awesome intellisense handling of auto declared variables.



The downside was that the ClangCodeModel plugin was buggy, and gave me errors and warnings in parts of code that didn't make sense, especially the ones in 3rd party library header files. So I was forced to turn it off.



I'm wondering if Clang can be configured in QtCreator, so that minimal checks can happen. I played with these settings, but nothing made a difference:



enter image description here



1) Has anyone been able to configure this plugin in QtCreator so that it can work better? I am mostly concerned about intellisense. I can open the same CMake project in Visual Studio and I have much better intellisense there, but I prefer using Qt Creator.



2) If #1 is not possible because the plugin has bugs, what are the other means of improving intellisense in Qt Creator with CMake projects?










share|improve this question

















  • 1





    QtCreator 4.8 (currently the beta) comes with support for the language-server-protocol. This might be a good alternative

    – Felix
    Nov 18 '18 at 0:26











  • Probably those settings only apply to the visual output in the edit pane. I can see the warnings disappear when I apply "level0 checks" for instance. When I select "almost everything" option they re-appear instantly.

    – Frederik De Ruyck
    Nov 19 '18 at 16:40













3












3








3


1






I just installed QtCreator 4.7.2, which comes with ClangCodeModel plugin by default on. After my CMake project was parsed I saw much better highlighting of keywords in the code and also awesome intellisense handling of auto declared variables.



The downside was that the ClangCodeModel plugin was buggy, and gave me errors and warnings in parts of code that didn't make sense, especially the ones in 3rd party library header files. So I was forced to turn it off.



I'm wondering if Clang can be configured in QtCreator, so that minimal checks can happen. I played with these settings, but nothing made a difference:



enter image description here



1) Has anyone been able to configure this plugin in QtCreator so that it can work better? I am mostly concerned about intellisense. I can open the same CMake project in Visual Studio and I have much better intellisense there, but I prefer using Qt Creator.



2) If #1 is not possible because the plugin has bugs, what are the other means of improving intellisense in Qt Creator with CMake projects?










share|improve this question














I just installed QtCreator 4.7.2, which comes with ClangCodeModel plugin by default on. After my CMake project was parsed I saw much better highlighting of keywords in the code and also awesome intellisense handling of auto declared variables.



The downside was that the ClangCodeModel plugin was buggy, and gave me errors and warnings in parts of code that didn't make sense, especially the ones in 3rd party library header files. So I was forced to turn it off.



I'm wondering if Clang can be configured in QtCreator, so that minimal checks can happen. I played with these settings, but nothing made a difference:



enter image description here



1) Has anyone been able to configure this plugin in QtCreator so that it can work better? I am mostly concerned about intellisense. I can open the same CMake project in Visual Studio and I have much better intellisense there, but I prefer using Qt Creator.



2) If #1 is not possible because the plugin has bugs, what are the other means of improving intellisense in Qt Creator with CMake projects?







c++ qt clang qt-creator llvm-clang






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 17:08









armanaliarmanali

1,4351431




1,4351431







  • 1





    QtCreator 4.8 (currently the beta) comes with support for the language-server-protocol. This might be a good alternative

    – Felix
    Nov 18 '18 at 0:26











  • Probably those settings only apply to the visual output in the edit pane. I can see the warnings disappear when I apply "level0 checks" for instance. When I select "almost everything" option they re-appear instantly.

    – Frederik De Ruyck
    Nov 19 '18 at 16:40












  • 1





    QtCreator 4.8 (currently the beta) comes with support for the language-server-protocol. This might be a good alternative

    – Felix
    Nov 18 '18 at 0:26











  • Probably those settings only apply to the visual output in the edit pane. I can see the warnings disappear when I apply "level0 checks" for instance. When I select "almost everything" option they re-appear instantly.

    – Frederik De Ruyck
    Nov 19 '18 at 16:40







1




1





QtCreator 4.8 (currently the beta) comes with support for the language-server-protocol. This might be a good alternative

– Felix
Nov 18 '18 at 0:26





QtCreator 4.8 (currently the beta) comes with support for the language-server-protocol. This might be a good alternative

– Felix
Nov 18 '18 at 0:26













Probably those settings only apply to the visual output in the edit pane. I can see the warnings disappear when I apply "level0 checks" for instance. When I select "almost everything" option they re-appear instantly.

– Frederik De Ruyck
Nov 19 '18 at 16:40





Probably those settings only apply to the visual output in the edit pane. I can see the warnings disappear when I apply "level0 checks" for instance. When I select "almost everything" option they re-appear instantly.

– Frederik De Ruyck
Nov 19 '18 at 16:40












1 Answer
1






active

oldest

votes


















2





+50









The screenshot you took is from the "Analyzer" settings.
The Analyzer performs on-demand checks like running static analysis, clang-tidy, callgrind, etc.



To configure the Code Model, you should go to "C++ > Code Model":



enter image description here



You also have the possibility to override this settings on a per-project basis:



enter image description here



In both cases you can, by clicking on Manage..., create your own configuration with whatever flags you want:



enter image description here






share|improve this answer

























  • I tried it. Still getting the same bugs. Which option should I go with?

    – armanali
    Nov 26 '18 at 18:37











  • @armanali I have updated my answer. I am not sure you can have clang ignore 3rd-party headers though. You could also try Qt Creator 4.8, the release candidate was published last week and is available in the Qt Online Installer.

    – Benjamin T
    Nov 26 '18 at 18:56










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305428%2fqtcreator-and-clangcodemodel-plugin%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2





+50









The screenshot you took is from the "Analyzer" settings.
The Analyzer performs on-demand checks like running static analysis, clang-tidy, callgrind, etc.



To configure the Code Model, you should go to "C++ > Code Model":



enter image description here



You also have the possibility to override this settings on a per-project basis:



enter image description here



In both cases you can, by clicking on Manage..., create your own configuration with whatever flags you want:



enter image description here






share|improve this answer

























  • I tried it. Still getting the same bugs. Which option should I go with?

    – armanali
    Nov 26 '18 at 18:37











  • @armanali I have updated my answer. I am not sure you can have clang ignore 3rd-party headers though. You could also try Qt Creator 4.8, the release candidate was published last week and is available in the Qt Online Installer.

    – Benjamin T
    Nov 26 '18 at 18:56















2





+50









The screenshot you took is from the "Analyzer" settings.
The Analyzer performs on-demand checks like running static analysis, clang-tidy, callgrind, etc.



To configure the Code Model, you should go to "C++ > Code Model":



enter image description here



You also have the possibility to override this settings on a per-project basis:



enter image description here



In both cases you can, by clicking on Manage..., create your own configuration with whatever flags you want:



enter image description here






share|improve this answer

























  • I tried it. Still getting the same bugs. Which option should I go with?

    – armanali
    Nov 26 '18 at 18:37











  • @armanali I have updated my answer. I am not sure you can have clang ignore 3rd-party headers though. You could also try Qt Creator 4.8, the release candidate was published last week and is available in the Qt Online Installer.

    – Benjamin T
    Nov 26 '18 at 18:56













2





+50







2





+50



2




+50





The screenshot you took is from the "Analyzer" settings.
The Analyzer performs on-demand checks like running static analysis, clang-tidy, callgrind, etc.



To configure the Code Model, you should go to "C++ > Code Model":



enter image description here



You also have the possibility to override this settings on a per-project basis:



enter image description here



In both cases you can, by clicking on Manage..., create your own configuration with whatever flags you want:



enter image description here






share|improve this answer















The screenshot you took is from the "Analyzer" settings.
The Analyzer performs on-demand checks like running static analysis, clang-tidy, callgrind, etc.



To configure the Code Model, you should go to "C++ > Code Model":



enter image description here



You also have the possibility to override this settings on a per-project basis:



enter image description here



In both cases you can, by clicking on Manage..., create your own configuration with whatever flags you want:



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 26 '18 at 18:56

























answered Nov 22 '18 at 11:21









Benjamin TBenjamin T

5,1881127




5,1881127












  • I tried it. Still getting the same bugs. Which option should I go with?

    – armanali
    Nov 26 '18 at 18:37











  • @armanali I have updated my answer. I am not sure you can have clang ignore 3rd-party headers though. You could also try Qt Creator 4.8, the release candidate was published last week and is available in the Qt Online Installer.

    – Benjamin T
    Nov 26 '18 at 18:56

















  • I tried it. Still getting the same bugs. Which option should I go with?

    – armanali
    Nov 26 '18 at 18:37











  • @armanali I have updated my answer. I am not sure you can have clang ignore 3rd-party headers though. You could also try Qt Creator 4.8, the release candidate was published last week and is available in the Qt Online Installer.

    – Benjamin T
    Nov 26 '18 at 18:56
















I tried it. Still getting the same bugs. Which option should I go with?

– armanali
Nov 26 '18 at 18:37





I tried it. Still getting the same bugs. Which option should I go with?

– armanali
Nov 26 '18 at 18:37













@armanali I have updated my answer. I am not sure you can have clang ignore 3rd-party headers though. You could also try Qt Creator 4.8, the release candidate was published last week and is available in the Qt Online Installer.

– Benjamin T
Nov 26 '18 at 18:56





@armanali I have updated my answer. I am not sure you can have clang ignore 3rd-party headers though. You could also try Qt Creator 4.8, the release candidate was published last week and is available in the Qt Online Installer.

– Benjamin T
Nov 26 '18 at 18:56



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305428%2fqtcreator-and-clangcodemodel-plugin%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto