Help!! app qt4 upgrade to qt5 for wayland , can't get the QDialog's window handle which can cast to EGLNativeWindowType

Giulio Camuffo giuliocamuffo at gmail.com
Wed Aug 6 03:36:58 PDT 2014


2014-08-06 13:31 GMT+03:00 Steve (YiLiang) Zhou <szhou at telecomsys.com>:

> So , if I want to draw something in a qwidget in wayland , it’s impossible
> to do this now?
>

You can do it, just not with OpenGL.


> Can you give some advices if I chose “ an egl surface to draw into, with
> no QWidgets on top “ ?
>

Well, you can create a QWindow and use a QOpenGLContext, and that will work
fine. Then you draw the content with OpenGL calls.


>
>
> Thanks and Best Regards
>
> Steve Zhou
>
>
>
> *From:* Giulio Camuffo [mailto:giuliocamuffo at gmail.com]
> *Sent:* Wednesday, August 06, 2014 5:52 PM
>
> *To:* Steve (YiLiang) Zhou
> *Cc:* wayland mailing list
> *Subject:* Re: Help!! app qt4 upgrade to qt5 for wayland , can't get the
> QDialog's window handle which can cast to EGLNativeWindowType
>
>
>
>
>
> 2014-08-06 12:38 GMT+03:00 Steve (YiLiang) Zhou <szhou at telecomsys.com>:
>
> Thanks for your quick reply ,  I prefer to  embed an OpenGL surface into
> QDialog .
>
>
>
> That is unfortunately not possible yet. The QtWayland QPA doesn't have
> support for wl_subsurface yet, which are needed to embed an EGL surface
> into an shm one.
>
>
>
> --
>
> Giulio
>
>
>
>
>
>
>
> Thanks and Best Regards
>
> Steve Zhou
>
>
>
> *From:* Giulio Camuffo [mailto:giuliocamuffo at gmail.com]
> *Sent:* Wednesday, August 06, 2014 5:34 PM
> *To:* Steve (YiLiang) Zhou
> *Cc:* wayland mailing list
> *Subject:* Re: Help!! app qt4 upgrade to qt5 for wayland , can't get the
> QDialog's window handle which can cast to EGLNativeWindowType
>
>
>
>
>
>
>
> 2014-08-06 11:54 GMT+03:00 Steve (YiLiang) Zhou <szhou at telecomsys.com>:
>
> 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?
>
>
>
> QDialog doesn't draw using OpenGL, so there is no EGL surface attached to
> its wl_surface.
>
> I'm not sure what you're trying to achieve. Do you want to embed an OpenGL
> surface into QDialog? Or do you just want an egl surface to draw into, with
> no QWidgets on top?
>
>
>
> --
>
> Giulio
>
>
>
>
>
>
>
> Thanks and Best Regards
>
> Steve Zhou
>
>
>
> CONFIDENTIALITY NOTICE: The information contained in this message may be
> privileged and/or confidential. If you are not the intended recipient, or
> responsible for delivering this message to the intended recipient, any
> review, forwarding, dissemination, distribution or copying of this
> communication or any attachment(s) is strictly prohibited. If you have
> received this message in error, please notify the sender immediately, and
> delete it and all attachments from your computer and network.
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>
>
> CONFIDENTIALITY NOTICE: The information contained in this message may be
> privileged and/or confidential. If you are not the intended recipient, or
> responsible for delivering this message to the intended recipient, any
> review, forwarding, dissemination, distribution or copying of this
> communication or any attachment(s) is strictly prohibited. If you have
> received this message in error, please notify the sender immediately, and
> delete it and all attachments from your computer and network.
>
>
>
> CONFIDENTIALITY NOTICE: The information contained in this message may be
> privileged and/or confidential. If you are not the intended recipient, or
> responsible for delivering this message to the intended recipient, any
> review, forwarding, dissemination, distribution or copying of this
> communication or any attachment(s) is strictly prohibited. If you have
> received this message in error, please notify the sender immediately, and
> delete it and all attachments from your computer and network.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140806/7f0806bb/attachment.html>


More information about the wayland-devel mailing list