[Qt-interest] QT-X11 Display and Window handle
Anil H
dspinside at gmail.com
Tue Sep 1 08:25:23 CEST 2009
Hi Louai Al-Khanji,
Thanks you very much for your inputs.
Sorry for the delayed response as i was on leave for a week.
I was able to get the X11 display handle and the window handle as below
/*Get global X11 handle and Window handle used by the QT application*/
*QX11Info qX11Info = ui->centralWidget->x11Info(); *
*Display *dis = qX11Info.display ();*
*WId widgWinId = ui->centralWidget->winId();*
**
*/*Create a blank child window which is embedded in the application*/*
*WId winImg=XCreateSimpleWindow(dis,WidgWin,100,100,*
*200, 200, 0,0,0);*
XMapRaised(dis, *winImg*);
**
Thanks and regards
Anil H
On Sun, Aug 23, 2009 at 7:47 PM, Louai Al-Khanji <louai.khanji at gmail.com>wrote:
> On Sat, Aug 22, 2009 at 3:01 PM, Anil H<dspinside at gmail.com> wrote:
> > Hi,
> >
> > I am trying out an X11 based QT4.5.2 application on Red Hat EL5.
> > The application requires X11 window to be embedded in the QT-GUI
> > and the embedded window displays images/video.
> > So I require an X11 display and window handle which has been already
> opened
> > by QT.
> >
> > QT documentation recommends not to use
> > QPaintDevice::x11AppDisplay ()
> > QPaintDevice::x11AppRootWindow() API's since it is provided only for QT3
> > compatibility.
> > I tried out X11 C API's XOpenDisplay() & RootWindow() .
> > But this opens up another window which can't be embedded in the QT GUI.
> >
> > How to get X11Display and window handle which has already been opened by
> QT
> > ?
> >
> > Thanks and regards
> > Anil H
> >
>
> Look at the QX11Info class for the display and root window. The
> QWidget class has a method called winId which returns the XID of the
> window - if you're trying to embed an application that is what you
> want, not the root window.
>
>
> --
> - Louai Al-Khanji
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090901/b22a34d5/attachment.html
More information about the Qt-interest-old
mailing list