Unsolved How to create Qt widgets inside existing native window?
-
I want to use Qt to develop audio plugins (VST2/VST3/AudioUnit) (actually I'm using JUCE). The plugins would have native window handles created by hosts, and how can I create QWidgets inside it?
I found there's
QWindow::fromWinId
that creates a QWindow wrapper, andQWidget::createWindowContainer
that creates a QWidget. However it sayscreateWindowContainer
is used for embedding an alien native window inside Qt widget hierarchy, which is in reverse of what I want (embedding Qt widget hierarchy inside existing native window). -
@jiandingzhe
I could be wrong(!), but I cannot imagine that can be done. The functions you mention allow Qt to take ownership of and show a native window. But (surely?) that window is then opaque to Qt, a native window cannot somehow have Qt widgets on it and I presume you cannot do such a thing. -
Hi,
If you need to provide a native handle to the core application, you should check QWidget::winId.
I think it should provide what you need. You would only need to call it on the widget that you need to pass to the application. -
@SGaist Nope. The application pass a handle to me.
-
@JonB So it seems the only way is to firstly add the widget to desktop, then manage its native handle to be transient for the parent window from the host.
-
This post is deleted!