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.

  1. use qt_use_native_windows=1 in environment.
  2. set qt::aa_nativewindows attribute on application. widgets native widgets.
  3. set qt::wa_nativewindow attribute on widgets: widget , of ancestors become native (unless qt::wa_dontcreatenativeancestors set).
  4. call qwidget::winid enforce native window (this implies 3).
  5. set qt::wa_paintonscreen attribute enforce native window (this implies 3).

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -