tags:

views:

45

answers:

1

Hi all! I want to render the video from my webcam into QWidget. I've set QWidget, as a parent to IVideoWindow. Here is the code:

m_iVideoWindow->put_Owner((OAHWND)widget_->winId());
m_iVideoWindow->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN);
m_iVideoWindow->put_Left(0);
m_iVideoWindow->put_Top(0);
widget_->setChild(m_iVideoWindow);

Also i've reimplemented QWidget's resize event, and so when it's resizing it also resizes the IVideoWindow. Everything works good, when the widget is not set to the QLayout. When is - it becomes blank. That is the problem.

A: 

I think when Qt draws its widgets, it doesn't redraw them unless it knows they need to be updated. I'm also unsure as to whether it passes on whatever redraw stuff windows requires, to the window you've assigned as a child of the widget.

When I embed my own windows in a Qt widget, I use http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinmigrate/, but that may not solve your problem, as I still have to use a QTimer to force an update of my window.

badgerr