Dear all,
I'd like to include a x11 window from another application into qt
application window on linux. Now I can get the winIds of the X11 window and
new created qt main window.
How can I do that? I tried XReparentWindow, but I can't see the widget, did
I do something wrong?
int main(int argc, char **argv)
{
QApplication a(argc, argv);
Board b; //Board is QMainWindow, coz I want menu bar in the image
Window winId;
b.setGeometry(0, 0, 300, 300);
Display *displayX11;
displayX11 = XOpenDisplay(NULL);
a.setMainWidget(&b);
// b.show();
winId = b.getWinId(); //get the winId of the X11 window
XReparentWindow(displayX11, winId, b.winId(), 0, 0);
XMoveResizeWindow(displayX11, winId, 0,0,300, 300);
XMapWindow(displayX11,b.winId());
//XCloseDisplay(displayX11); //When I uncomment this, I will get errors
like
// X Error: BadWindow
(invalid Window parameter) 3
//Major opcode: 7
//Minor opcode: 0
// Resource id:
0xbffff978
return a.exec();
}
Thank you for your help.