[Interest] Help!! app qt4 upgrade to qt5 for wayland on tizen ivi, can't get the QDialog's window handle which can cast to EGLNativeWindowType

Tomasz Olszak olszak.tomasz at gmail.com
Thu Aug 7 19:57:52 CEST 2014


Dnia czwartek, 7 sierpnia 2014 15:51:31 Steve  Zhou pisze:
> Dear all,
> 
> I have app which was developed by qt4, and we want to port it to tizen
> ivi wayland platform, so I have to update our app to qt5.
> 
> We have a feature : drawing something based on egl on a qt window(we use
> QDialog).
> 
> Egl need a EGLSurface and a EGLDisplay to get the feature work.
> 
> EGLSurface eglCreateWindowSurface(
> 
> EGLDisplay display,
> 
> 
> 
> EGLConfig config,
> 
> 
> 
> NativeWindowType native_window,
> 
> 
> 
> EGLint const * attrib_list);
> 
> In x11 based OS like ubuntu 12.04 , we use EGL_DEFAULT_DISPLAY to get
> display, the qt window's winId()   to cast to NativeWindowType
> 
> It works well on X11 based OS.
> 
> But when it comes to wayland ,it will crash at eglCreateWindowSurface, I
> googled a lot ,but rarely got something useful.
> 
> Someone said that  to get eglCreateWindowSurface work on wayland ,the
> native_window has to be a wl_egl_window type.
> 
> I tried to get it like bellow:
> 
> 
> 
> QDialog *dialog = new QDialog(mainW);
> 
> dialog->setGeometry(QRect(0, 0, 720, 430));
> 
> dialog->show();
> 
> 
> 
> QPlatformNativeInterface *native =
> 
>         QGuiApplication::platformNativeInterface();
> 
>    struct wl_display *wl_dpy = (struct wl_display *)
> 
>         native->nativeResourceForWindow("display", NULL);
> 
>     struct wl_surface *surface = static_cast<struct wl_surface *>(
> 
>         native->nativeResourceForWindow("surface",
> dialog->windowHandle()));
> 
> struct wl_egl_window * wl_wind = wl_egl_window_create(surface, 720,430
> );
> 
> 
> 
> use the wl_wind and wl_dpy to eglCreateWindowSurface , the app didn't
> crash ,but the graphics we want to draw on the window can't be seen.
> 
> 
> 
> Is there someone met this before? Can somebody give some advices?
> 
> 

Just for clarity:

http://lists.freedesktop.org/archives/wayland-devel/2014-August/016340.html





More information about the Interest mailing list