PDA

View Full Version : hwnd to qwidget setparent error



cic
27th August 2013, 08:23
i try to convert the hwnd to qwidget acc. this post:
http://www.qtcentre.org/threads/3713-Convert-Windows-quot-HWND-quot-to-QWidget*-pointer

e.g.



HWND hTable = tbl->winHWnd();

::SetParent(hTable, (HWND)winq->winId());

QWidget* qTable = QWidget::find(hTable);


but after ::SetParent() from win API still the QWidget::find() only returns me null.
I step into the debugger and find,

before ::SetParent() was called, the QWidgetPrivate::mapper contains 2 elements,
then after the mapper gained one more element but this element's value (the hwnd value?) is not the hTable!?

is there any notes for the issue?


-------------------------------------

sry, the problem has nothing to do with ::SetParent(),
the added element is from calling



winq->winId()

wysota
27th August 2013, 14:40
sry, the problem has nothing to do with ::SetParent(),
the added element is from calling



winq->winId()


Yes, and the problem is...?