c++ - Force QWidget Child to have its own Window Handle -
i trying create small application using qt. want display in dock widget 3d interface using directx11
, other widgets in qmainwindow
have properties modify behavior of been displayed in dx11
.
the problem facing when add qdockwidget
qmainwindow
, dockwidgetcontents
function windowhandle
returns null
.
i using example get hwnd on windows qt5 (from wid) hwnd
. if function return null
go , hwnd
of qmainwindow
.
is there way force qwidget
have own window handle?
thanks advice!
yes. have several options that. see topic native widgets vs alien widgets in qwidget class documentation.
- use qt_use_native_windows=1 in environment.
- set qt::aa_nativewindows attribute on application. widgets native widgets.
- set qt::wa_nativewindow attribute on widgets: widget , of ancestors become native (unless qt::wa_dontcreatenativeancestors set).
- call qwidget::winid enforce native window (this implies 3).
- set qt::wa_paintonscreen attribute enforce native window (this implies 3).
Comments
Post a Comment