Ok... I managed to get this sorted out.
in my QWidget subclass, I had to override the QWidget::paintEngine method to return NULL. I also had to set the following widget properties:
setAttribute(Qt::WA_OpaquePaintEvent, true);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAutoFillBackground(false);
setAttribute(Qt::WA_OpaquePaintEvent, true);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAutoFillBackground(false);
To copy to clipboard, switch view to plain text mode
I also adjusted my calls to the IVMRWindowlessControl9 like the following:
HWND hWnd = (HWND) winId();
HDC hDC = GetDC(hWnd);
_impl->vmrWc->RepaintVideo(hWnd, hDC);
}
RECT pos;
pos.top = 0;
pos.left = 0;
pos.bottom = height();
pos.right = width();
_impl->vmrWc->SetVideoPosition(NULL, &pos);
}
void WindowsVideoViewer::paintEvent(QPaintEvent*) {
HWND hWnd = (HWND) winId();
HDC hDC = GetDC(hWnd);
_impl->vmrWc->RepaintVideo(hWnd, hDC);
}
void WindowsVideoViewer::resizeEvent(QResizeEvent*) {
RECT pos;
pos.top = 0;
pos.left = 0;
pos.bottom = height();
pos.right = width();
_impl->vmrWc->SetVideoPosition(NULL, &pos);
}
To copy to clipboard, switch view to plain text mode
Everything seems happy now.
Ok... I managed to get this sorted out.
in my QWidget subclass, I had to override the QWidget::paintEngine method to return NULL. I also had to set the following widget properties:
setAttribute(Qt::WA_OpaquePaintEvent, true);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAutoFillBackground(false);
setAttribute(Qt::WA_OpaquePaintEvent, true);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAutoFillBackground(false);
To copy to clipboard, switch view to plain text mode
I also adjusted my calls to the IVMRWindowlessControl9 like the following:
HWND hWnd = (HWND) winId();
HDC hDC = GetDC(hWnd);
_impl->vmrWc->RepaintVideo(hWnd, hDC);
}
RECT pos;
pos.top = 0;
pos.left = 0;
pos.bottom = height();
pos.right = width();
_impl->vmrWc->SetVideoPosition(NULL, &pos);
}
void WindowsVideoViewer::paintEvent(QPaintEvent*) {
HWND hWnd = (HWND) winId();
HDC hDC = GetDC(hWnd);
_impl->vmrWc->RepaintVideo(hWnd, hDC);
}
void WindowsVideoViewer::resizeEvent(QResizeEvent*) {
RECT pos;
pos.top = 0;
pos.left = 0;
pos.bottom = height();
pos.right = width();
_impl->vmrWc->SetVideoPosition(NULL, &pos);
}
To copy to clipboard, switch view to plain text mode
Everything seems happy now.
Added after 5 minutes:
ChrisW67's tips pointed me in the right direction, but the chunk of code that pushed it over the edge was in the Qt 4.8 source distribution at the location:
qt-everywhere-opensource-src-4.8.3/src/3rdparty/phonon/ds9
qt-everywhere-opensource-src-4.8.3/src/3rdparty/phonon/ds9
To copy to clipboard, switch view to plain text mode
Specifically, the VideoWidget class.
Bookmarks