PDA

View Full Version : Qt Creator How to ignore the warnings but only show errors in QtCreator Issues after build?



jiapei100
17th April 2014, 03:17
Hi, all:


One naive question:

I'm using QtCreator 3.0.1. I'm wondering if there is a way for QtCreator to show errors (in red) only, and have those warnings ignored?


Cheers
Pei

ChrisW67
17th April 2014, 07:40
Ignoring warnings is generally not a good idea: they exist for a reason.

Qt Creator's Issues Pane has a tool button to hide warnings.

stampede
17th April 2014, 08:25
Best way to get rid of them is to fix them :)
But if you can't do that (warnings come from third-party sources), another option is to use preprocessor directives to selectively disable warnings, like:


// for gcc
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits"
#pragma GCC diagnostic ignored "-Wreorder"

#include <dshow.h>
#include <dvdmedia.h>

#pragma GCC diagnostic pop