views:

1434

answers:

2

With wxWidgets I use the following code:

HWND main_window = ...
...
wxWindow *w = new wxWindow();
wxWindow *window = w->CreateWindowFromHWND(0, (WXHWND) main_window);

How do I do the same thing in Qt? The HWND is the handle of the window I want as the parent window for the new QtWidget.

+3  A: 

Have you tried the QWinWidget class from the Qt/MFC Migration Framework?

ChrisN
+4  A: 

Use the create method of QWidget.

HWND main_window = ...
...
QWidget *w = new QWidget();
w->create((WinId)main_window);
sep