[Qt-interest] is it possible to get a non-changing winId?

Ross Bencina rossb-lists at audiomulch.com
Wed Jun 3 07:21:21 CEST 2009


Hi!

The docs for QWidget::winId() say:
"""Note: We recommend that you do not store this value as it is likely to 
change at run-time."""

I am on MS Windows, and trying to use a QWidget to host a 3rd-party plugin 
which needs a parent HWND. This has been working mostly but one plugin 
author is reporting that the HWND which I get from QWidget::winId()  is 
becoming invalid (so I guess this is in line with the Qt documentation).

My question is: is there any way to stop Qt reallocating the HWND and get it 
to keep the same HWND for the entire life of the QWidget? Is there any other 
way I can integrate a standard windows handle into Qt? Would WA_NativeWindow 
help?

Thanks!

Ross. 




More information about the Qt-interest-old mailing list