There is a way to force an external window to become part of a widget, but the API isn't really meant to be used this way and there are multiple issues: https://bugreports.qt.io/browse/QTBUG-45275
Hi
Have a look at
http://doc.qt.io/qt-5.5/qtextobjectinterface.html#details
http://doc.qt.io/qt-5/qtextobjectinterface.html
and the "Text Object Example"
It seems possible to create your own widget to support such feature but
I have no tested it and do not know if object would receive events.
also docs says
"Copy and Paste operations ignore custom text objects."