Discussion:
QTvcp 4/5 opinions wanted
(too old to reply)
s***@btinternet.com
2017-04-21 16:24:58 UTC
Permalink
Raw Message
Chris

Revisiting the problems with X11 and Qt5, prompted me to look again at
embedding.

I have now managed, in C++, to embed native X11 windows into Qt5.8 widgets.

I adapted the qxtglobalshortcut5 repo
(https://github.com/ddqd/qxtglobalshortcut5)
into https://github.com/ArcEye/qxtwindow, to make it a library,

This was to use the window listing mechanism and the findWindow()
function which uses that.
This is all based upon the now defunct Qxt project, which I used
extensively with Qt4.

Also required that libQt5X11Extras be built (which it is by default in 5.8)

The full code of a demo is in the Readme in that repo.
It will spawn a copy of mplayer, wait until the window is created and
then get its ID and embed it into a container widget.

That embedding has completely changed from Qt4, but does work, so long
as you explicitly re-parent the container to the widget it was created from,
(passing the parent in the createWindowContainer() call did not seem to
work properly) and first show() the parent then the child container.

I also reimplemented the resize event to make the container resize to
match any changes in window size.

Using the reverse method and passing a Qt Wid in a spawn to programs
that support embedding, such as mplayer or rxvt, works OK too.

So should all be possible in python too.

Feel free to use the repo or contact me off list

regards

Loading...