PDA

View Full Version : xterm -into for embedding



PstdEr
10th October 2013, 12:09
Hi ,

I can use this in terminal and terminal will be embeded into the window specified by Wid.
But I would like to use this in Qt application so that the required application will be embedded into my own window.

please guide me how..

anda_skoa
11th October 2013, 11:41
If you are looking for a method to get a window's window ID, then have a look at QWidget::winId()

Cheers,
_

PstdEr
11th October 2013, 15:45
No anda_skoa,
I know how to get a window id.

we use xtrem -into winid in a terminal so that the terminal is embedding in window of winid

i want to use

QApplication()
{
...................
................

xterm -into wind
}

so that this application sits in the winid.

anda_skoa
11th October 2013, 18:56
Then you'll have to rephrase your question.
I assumed you wanted to embed xterm into a window of your application.

Cheers,
_

PstdEr
13th October 2013, 13:28
Can you give an idea how can we embed an application into another using window id of our choice.
I want this to be done through a program.

Thanks,

anda_skoa
13th October 2013, 15:52
You only make your request more vague instead of more precise :(

Which application is the one having the host window and which application is the one having the window that should be embedded in the host?
Is your application the frst, the second or neither of the two?

Cheers,
_

PstdEr
13th October 2013, 18:46
Sorry , i confused you.
lets say i have a main window(QMainWindow) on which i added a 2 widgets in a horizantal layout. lets call it, first application or main application(host)
now, from my main window i launch some applications(one at a time) by QProcees . this application has to be displayed on my first widget in the layout.----> second application (to be embedded)

first application (mainwindow) will be running always and provides some window on which the launched application will be embedded ,


Thanks,

anda_skoa
13th October 2013, 19:57
Most embedding strategies seem to be based on the assumption that the host knows the ID of the window it wants to embed, i.e. this is called "foreign window support" on the platform abstraction plugin level.

With the window ID at hand, QWindow:fromWinId() should create a QWindow that contains the foreign window. It could then be possible to put this QWindow into a QWidget using QWidget::createWindowContainer().
It might also be possible to use QWidget::create() with the window ID as its first argument.

From your example earlier with xterm it seems that there is a second embedding strategy, where the host provides a window ID and the other application uses that to reparent its own window.
QWidget::winId() and QWindow::winId() should provide such a window ID for that case.

Cheers,
_

PstdEr
13th October 2013, 21:11
I would like to use the second strategy , and i can provide a window id to other application , but how can i make other application sit in the window that i provided id for.
this is where i need to implement the behaviour of "xterm -into Wid ", i dont know how to do??

anda_skoa
14th October 2013, 12:12
Isn't that the task of the other program?
You provide the window ID, the other program reparents its window.

Since you have obviously already tried it, what is the effect you are seeing?

Cheers,
_