This is caused by the following line in the FFmpeg's pixfmt.h
:
#define PixelFormat AVPixelFormat
You can try the following trick then:
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}
#undef PixelFormat
#include <qt headers>