I need create a program which can show web cameras (hikvision IR ip66), they provide me with ocx and dll, and some API documents.
one API function is like this(in windows):
bool playVideo( HWND handle, ...)
and my 开发者_StackOverflow中文版code is like this:
widget = QWidget()
wid = widget.winId()
dll.playVideo(int(wid))
and failed. I don't know what is wrong, any ideas? or other better way to do this job in pyqt? (for example, use phonon?)
When creating the QWidget you need to pass the attribute:
Qt::WA_NativeWindows
QWidget(parent, Qt.WindowFlags(Qt.WA_NativeWindows))
Keep in mind that this will make all the parent widgets also Native unless you specify:
Qt::WA_DontCreateNativeAncestors
精彩评论