1

Topic: Visual Studio and Warnings - whether a bug it?

The question will be not about Qt, and about that as the Studio works with levels of warnings.
The elementary project on VS-2015 and Qt 5.6 is applied. It almost that project which is generated by default. The project without warnings gathers at level of warnings/Level3. But we admit  and we expose/Level4, we pass in configuration Release and we receive one million  on the code most Qt. The task to ungear these warnings only for code Qt, but not for ours is put.
I here everywhere compile a file qtwarnings.cpp. Was so in a file qtwarnings.h and there was a heap of warnings:

#include <QtWidgets/QMainWindow>
#include "ui_qtwarnings.h"

Let's make so:

#pragma warning (push, 3)
#include <QtWidgets/QMainWindow>
#pragma warning (pop)
#pragma warning (push, 3)
#include "ui_qtwarnings.h"
#pragma warning (pop)

Warnings remained. Why? After all earlier at the third level gathered without warnings.
Let's make so:

#pragma warning (push, 3)
#include <QtWidgets/QMainWindow>
#include "ui_qtwarnings.h"
#pragma warning (pop)

Warnings disappeared. But why?! After all same too most that was in the previous variant!
Now we make so:

#pragma warning (push, 0)
#include <QtWidgets/QMainWindow>
#pragma warning (pop)
#pragma warning (push, 0)
#include "ui_qtwarnings.h"
#pragma warning (pop)

Warnings disappeared. We ungeared them were twice, but when we exposed them in the third level of the warning twice. Though if at project level to expose the third level of warnings initially is not present.
Now we make so:

#pragma warning (push, 0)
#include <QtWidgets/QMainWindow>
#pragma warning (pop)
#pragma warning (push, 3)
#include "ui_qtwarnings.h"
#pragma warning (pop)

And in the answer we catch the warning:

warning C4251: ' QVariant:: d ': struct ' QVariant:: Private ' needs to have dll-interface to be used by clients of class ' QVariant'

But C4251 is a warning of the first level, and we work on the third!
PS: Well where logic and how so can be? The project archive is applied.

2

Re: Visual Studio and Warnings - whether a bug it?

Forgot project archive.