[Development] QX11EmbedWidget in Qt5

Alberto Mardegan mardy at users.sourceforge.net
Thu Nov 8 12:18:33 CET 2012


On 11/08/2012 11:58 AM, Samuel Rødal wrote:
> It needs to be part of a separate library, as we don't want libQtGui or 
> libQtWidgets to link to X11-specific libraries (the choice between the 
> wayland, xcb, directfb, kms, etc platform plugins is made at run-time). 

Sure, but it could still be implemented in a platform independent way:
the embedding code should be in the xcb backend, which would expose it
as a method (either adding it to the platform interface, or just by
making it Q_INVOKABLE for calling it via QMetaObject::invokeMethod(), as
the QX11Info merge request does). This platform plugin method would then
be called by QX11EmbedWidget's implementation, which could then be in
either libQx11support or libQtWidgets, as it wouldn't contain any
platform specific code itself.

However, giving that there are some changes needed to port to Qt5
anyway, adding a line "QT += x11support" to a .pro file is no big deal,
and it avoids polluting the Qt API with QX11-prefixed stuff which might
even become obsolete too as wayland gains ground, so I think it's good
to have it in a separate x11support module.

I also agree with René, to try to keep the API as close as possible to
the Qt4 one, and maybe introduce QEmbed{Widget,Container} later on when
we have it implemented in at least another backend besides the xcb one.

So, summing up, I'd go for QX11EmbedWidget in x11support, with some help
from the xcb backend.

Ciao,
  Alberto

-- 
http://blog.mardy.it <- geek in un lingua international!



More information about the Development mailing list