PDA

View Full Version : Qt5 does not have X11 API, how to port from Qt4 to Qt5?



PstdEr
9th October 2013, 11:36
Hi,
I need to port some applications from Qt4.8 to Qt5.0.
In Qt4.8 all the applications i used QX11EmbedXXX functions, but Qt5.0 does not have the support for X11.

is there any other way we can embed widgets in Qt5.0.
Is it possible using OpenGL or QGraphicsView related functions, if so kindly provide any reference or example.


Thanks,

Added after 1 9 minutes:

I Actually need Qt5.0.1.
Where can i find all the functions and modules available in Qt5.0.1.

anda_skoa
11th October 2013, 11:28
QX11Embed sounds like you are looking at XEmbed functionality.

QWindow::fromWinId() can do that now, in a cross-platform way.

Cheers,
_

PstdEr
11th October 2013, 15:54
yeah , got to see recently.

But i have doubt here.

in Qt 4 QX11EmbedContainer can give its window id so that other applications can be embedded into it.

for non Qt application i used to pass window id through command line and get those application embedded into my window

in Qt 5 createWindowContainer needs a window id so that it can embed that application.
for non Qt applications how can get the window id of a running application and send it to container so that it will embed into it.

anda_skoa
11th October 2013, 19:06
These are two different usage scenarios.

QWindow::fromWinId() solves the on where you have a foreign window and embed it into your application. Ideally the foreign window communicates the window id to your application somehow, or makes it window identifiable through certain window attributes and you search for those through use of native API or, if the platform QPA has support for that, through those support features.

The other way around, when your application provides a window id and the foreign window embeds itself somehow, might be supported by creating an otherwise empty QWindow and passing its winId() to the other application.

Cheers,
_

PstdEr
14th October 2013, 09:19
Hi anda_skoa,

How will I find out , is there any way to embed widgets in Qt 5.0.1?
you mentioned earlier about QWindow::fromWinId() , createWindowContainer , but they are available in Qt 5.1.


Thanks,

anda_skoa
14th October 2013, 12:22
You can probably use the same native API that the XCB QPA in Qt5.1 is using.

Cheers,
_