开发者

Is it possible to draw pyqt widget by other dlls?

开发者 https://www.devze.com 2023-02-20 16:29 出处:网络
I need create a program which can show web cameras (hikvision IR ip66), they provide me with ocx and dll, and some API documents.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消