PDA

View Full Version : QX11EmbedContainer into a QSplitter (qt 4.4.3)



giancarlo
20th December 2008, 12:55
I have to put an xterm into a QSplitter but when i call embedClient()... At the moment I can get the xterm outside the splitter.



QX11EmbedContainer* container = new QX11EmbedContainer();
QString ID = "0x3a0000e"; // I've taken this id from xwininfo -root -all | grep xterm
bool* x = new bool(true);
container->embedClient(ID.toInt(x,16));

With this code I get the outside xterm.

How can I use a QProcess and embed it in the container?
And specially, how can I know its winId from qt? (without using xwininfo)

caduel
20th December 2008, 13:10
You can not, as far as I know.
(You sometimes can do hacks like telling the called program what window title it should display. Then you can query X11... basically search for the Window with that title. I did that once. You have to take care, though, to wait a bit til the window does exist.)

Tell us if you find a better way.

HTH

giancarlo
20th December 2008, 13:15
My problem is that I need a terminal in my app.
I've been trying with konsolepart,and starting a program within it, but I wasn't able to know when the program was finished :(
Suggestions?

caduel
20th December 2008, 15:13
Usually these terminal programs have an option to set the X window title. Check the man page for details.
(One of the apps I embedded by searching for the window with 'my' title was an rxvt terminal program.)

giancarlo
20th December 2008, 16:38
and the source code of your app is available? tnx

caduel
20th December 2008, 23:33
Sorry, I am not allowed to post that.
(hint: XQueryTree and XWindowName)

HTH