I have a QT application that is developed by QML. Now I receive a requirement that I need to embed a x11 window into the QML UI and other team will do something on the x11 window. So is there any solution to embed a x11 window on QML UI and we need to make the x11 window align with parent UI(QML) while parent UI is resizing or moving. I googled around , few solutions about it ,can anyone help me?
Asked
Active
Viewed 521 times
2
-
QWidget::createWindowContainer? – n. m. could be an AI Mar 26 '18 at 08:38
-
any more detail? – letaoz Mar 26 '18 at 08:44
-
Sorry not quite familiar with the details. I only know this allows tou to embed a QWindow in a QWidget. You can then extract a native handle from QWindow. – n. m. could be an AI Mar 26 '18 at 08:47
-
1The [documentation](http://doc.qt.io/qt-5/qwidget.html#createWindowContainer) tells you what you need to know. It does rely on you having the id of the `X11` window you want to embed but, since you know the team writing the `X11` code that shouldn't be too difficult to arrange. – G.M. Mar 26 '18 at 09:23
-
currently I can get a QWidget* and QWindow* by using x11 window id, so how can I embed this QWidget and QWindow into my qml layout? – letaoz Mar 27 '18 at 05:13
-
I'm not sure you can embed using qml based on [posts I've found](https://stackoverflow.com/questions/13014415/qt5-embed-qwidget-object-in-qml). The general consensus is that it should be the other way around -- embed one or more qml components into a `QWidget` based interface. I don't know the specifics of the problem you're trying to solve but it sounds as if you might be able to achieve the desired results with a fairly simple `QWidget` based GUI with both qml *and* x11 (via `QWidget::createWindowContainer`) components embedded in it. – G.M. Mar 27 '18 at 09:51