View Full Version : Using QWidget as container
codeman
3rd September 2012, 09: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, 10:58
I would try QWidget::create().
codeman
3rd September 2012, 22: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, 08:42
Do you know what subclassing is?
codeman
4th September 2012, 09:04
yes i know.
high_flyer
4th September 2012, 09:10
So where is the problem?
codeman
4th September 2012, 09: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, 12:21
This comment in the docs might help:
The QWidget constructor calls create(0,true,true) to create a window for this widget.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.