[Interest] How to embed a "rdesktop" window in a QGraphicsScene

Thiago Macieira thiago.macieira at intel.com
Sat Sep 22 17:16:21 CEST 2018


On Saturday, 22 September 2018 06:45:09 PDT Francisco Ares wrote:
> Em sáb, 22 de set de 2018 03:03, Thiago Macieira <thiago.macieira at intel.com>
> escreveu:
> > On Friday, 21 September 2018 20:47:50 PDT Francisco Ares wrote:
> > > Now I want to do some fancy stuff like switching among several remote
> > > desktop sessions in a QGraphicsScene environment. So I started to try
> > 
> > using
> > 
> > > the same QWidget, but inside a QGraphicsProxyWidget, so the rdesktop's
> > > QWidget could be presented as a QGraphicsItem with all sorts of
> > > deformations possible on to it.
> > 
> > Not possible.
> 
> Thanks, Thiago, but could you tell me a bit more? What's the difference
> between a common QWidget and one embedded in a QGraphicProxyWidget?

The difference is that a QWidget is not transformed and it can have an actual, 
top-level window ID. A proxy widget doesn't, it gets painted into an internal 
QPixmap and then transformed by the graphics view engine. The only way to do 
that with an external tool would be for the external tool to give you its 
window contents in a QPixmap, which means you need to modify it to communicate 
with your wrapper app.

Instead of doing that, use OpenGL and shared content (buffers, textures, 
whatever). Then you can use OpenGL to transform the content you got into 
whatever you want it to be. This is actually the entire principle behind 
Wayland.

> And would a QWidget embedded in a QMainWindow work?

Yes, that's not a problem.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Interest mailing list