[Qt-interest] How to get window handle from QWidget

Zeljko zeljko at holobit.net
Thu Jun 10 17:25:39 CEST 2010


Matthias Pospiech wrote:

> I have a camera library for windows which uses in its examples MFC. They
> have a function to automatically display
> the camera image to a window by passing the pointer of the camera image
> memory and the window handle to a function
> 
> is_RenderBitmap( m_hCam, m_lMemoryId, m_hWndDisplay, m_nRenderMode );
> 
> the handle is retrieved in MFC using
> m_hWndDisplay = GetDlgItem( IDC_DISPLAY )->m_hWnd; // set display window
> handle
> 
> Now I want to use this library in Qt. I now would like to know how to
> get the window handle (which I assume ever window
> in a windows application has) so that I can work with the RenderBitmap
> function.
> If this should not work/or work completely different I would as well
> like to know that.

QWidget::winId() gives you hwnd under ms windows, XID under X11, dunno wha't
handle name under mac.

zeljko




More information about the Qt-interest-old mailing list