PDA

View Full Version : Using QWidget as container



codeman
3rd September 2012, 10:10
Hello friends,

is there a possibility to embed w32 created windows in QWidget? I read something about QWinWidget for embedding qt things in mfc or like that.
But the interesting thing for me is the opposite way.

Yours,

high_flyer
3rd September 2012, 11:58
I would try QWidget::create().

codeman
3rd September 2012, 23:27
Hello high_flyer,
QWidget::create() is protected?! Is there an example already metioned?

I think I have to decribe it in more detail. When I get an handle from this:

hWnd = CreateWindow(ClsName,
WndName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);

How can I take this and put it into a QWidget??

Yours,

high_flyer
4th September 2012, 09:42
Do you know what subclassing is?

codeman
4th September 2012, 10:04
yes i know.

high_flyer
4th September 2012, 10:10
So where is the problem?

codeman
4th September 2012, 10:34
I ask me where I have to call the method create(). In the contructor of the widget? Or do I have to customize or call other methods too?

Yours,

high_flyer
4th September 2012, 13:21
This comment in the docs might help:

The QWidget constructor calls create(0,true,true) to create a window for this widget.