From reading the docs, that really sounds like it should have done the trick. I'm now setting Qt::WA_OpaquePaintEvent in the constructor of my QWidget subclass. That makes the flicker happen in black, instead of in the default widget background color. It looks a tiny bit better, but it's still not right.
I've also split the work I was doing up into two methods now:
HWND hWnd = (HWND) winId();
HDC hDC = GetDC(hWnd);
_impl->vmrWc->RepaintVideo(hWnd, hDC);
}
RECT pos;
pos.top = 0;
pos.left = 0;
pos.bottom = height() - 1;
pos.right = width() - 1;
_impl->vmrWc->SetVideoPosition(NULL, &pos);
}
void VideoViewer::paintEvent(QPaintEvent*) {
HWND hWnd = (HWND) winId();
HDC hDC = GetDC(hWnd);
_impl->vmrWc->RepaintVideo(hWnd, hDC);
}
void VideoViewer::resizeEvent(QResizeEvent*) {
RECT pos;
pos.top = 0;
pos.left = 0;
pos.bottom = height() - 1;
pos.right = width() - 1;
_impl->vmrWc->SetVideoPosition(NULL, &pos);
}
To copy to clipboard, switch view to plain text mode
From reading the DirectShow docs, it seems like something is going on with the windows messages, and possibly causing DirectShow to think it needs to repaint more than it should?
This code is being ported from wxWidgets--things worked well there. I have a feeling it's got to be something minor and silly.
Bookmarks