'Is there any way to use Xephyr as a QT Widget?

I learned of the tool known as Xephyr recently, and was wondering if I could use it in a QT widget. What I am envisioning is an embedded Xephyr, or any X11 server really, instance running in a small corner of my Qt window. Is what I am asking for impossible?

I know about the X11 embed protocol, and that I can embed an application in my Qt window with it, but for experimental purposes I want to see if using a nested X server is possible.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source