Results 1 to 5 of 5

Thread: Stand alone Qt application with multiple windows not rendering on Wayland platform

  1. #1
    Join Date
    Aug 2021
    Posts
    4
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Stand alone Qt application with multiple windows not rendering on Wayland platform

    I have cross compiled Qt application with multiple windows and running the same on IMX8(target board) using platform wayland-egl. The sub-window is used to render the 3D. I am not able to see the 3D on the sub-window. Instead I am seeing a blank black screen.
    The same application is configured for Desktop and is working perfectly fine.
    Is there any issue with using Wayland platform to run multiple windows application?

    To test this scenario, I created an application with 2 windows where in the sub-window contains a rectangle whose color alternates between Red and Black based on the click from the root window button. This works fine on the Desktop where as on IMX8, the application crashes after two clicks on root window.

    Thanks!

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,017
    Thanks
    280
    Thanked 816 Times in 805 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Stand alone Qt application with multiple windows not rendering on Wayland platfor

    The sub-window is used to render the 3D. I am not able to see the 3D on the sub-window.
    This sounds like an OpenGL problem. If you are using OpenGL, be sure the level of OpenGL you are programming against is supported on that platform.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Aug 2021
    Posts
    4
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Stand alone Qt application with multiple windows not rendering on Wayland platfor

    Quote Originally Posted by d_stranz View Post
    This sounds like an OpenGL problem. If you are using OpenGL, be sure the level of OpenGL you are programming against is supported on that platform.
    If I run each window as separate applications simultaneously on IMX8, then I am able to see the 3D rendered on the display in one of the applications.
    Also, if the same application is configured as a single window application, there is no problem in rendering the 3D output.

    Does OpenGL have any impact on rendering multiple windows?

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,017
    Thanks
    280
    Thanked 816 Times in 805 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Stand alone Qt application with multiple windows not rendering on Wayland platfor

    Does OpenGL have any impact on rendering multiple windows?
    I am neither an expert on OpenGL or the IMX8. Since you can get the graphics to run standalone, I wonder if the problem is related to OpenGL not rendering into the correct context (or not having the context set at all) when you try to use multiple windows in the same application?

    Have you tried making a minimal project with multiple rendering subwindows, like the OpenGL Window example with this same basic code running in each subwindow? If that doesn't work, maybe the problem is one of OS support in the IMX8 for multiple OpenGL windows in the same app.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Aug 2021
    Posts
    4
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Stand alone Qt application with multiple windows not rendering on Wayland platfor

    The example that you suggested worked fine on the IMX8. We were able to visualize both the windows on IMX8 as the window is a QWindow. But in our case, we are using a class which is inherited from QQuickFramebufferObject ( QQuickItem-derived class ) which needs to be registered to QML and used like any other standard Quick element. So it looks like the window on top of which 3D has to be rendered should be a QML window. The context was always set but the rendering on the desired screen is not happening on IMX8 unlike on Desktop. My code looks something like this:

    QML:

    Window {
    width: 640
    height: 480
    visible: true
    //...
    //...

    Window {
    height: 400
    width: 400
    visible: true

    //Custom 3D class which is registered to QML
    3DTest {

    }
    }
    }


    Backend : CustomClass : public QQuickFramebufferObject //class which renders 3D

    CustomClass :: redraw () {

    QOpenGLContext *glContext = QOpenGLContext::currentContext () ; //Only place where the context is set
    if ( glContext ) {

    // calling necessary openGL functions for redrawing the 3D

    }
    }

    Am I missing something here?

Similar Threads

  1. Problem Deploying Qt5 Application to a Windows 8 platform
    By davethomaspilot in forum Installation and Deployment
    Replies: 3
    Last Post: 20th February 2015, 22:36
  2. Replies: 1
    Last Post: 20th June 2012, 09:53
  3. how to port application made in linux to windows platform
    By sachinmcajnu in forum Qt Programming
    Replies: 8
    Last Post: 11th March 2011, 18:11
  4. Replies: 3
    Last Post: 9th March 2011, 12:52
  5. stand alone dll under qt application
    By ami in forum Qt Programming
    Replies: 3
    Last Post: 15th June 2010, 13:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.