Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using Qt3D features in a QMdiArea

Using Qt3D features in a QMdiArea

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kshots
    wrote on last edited by
    #1

    Is the topic reasonable? I have an app that I want to write a plugin for that spawns a Qt3D window into the main application's QMdiArea as a QMdiSubWindow. Ideally, I would want to write this in such a way that I can also port the code for use on mobile devices (meaning that there would be no QMdiArea).

    The first obstacle I see is that Qt3D code doesn't use widgets at all - it uses QWindow. I think I can get away with using QWidget::createWindowContainer(), but there's warnings all over the place that this will have a major performance impact, and my attempt at using it gives me the following error:

    @Could not create requested format:
    QSurfaceFormat(version 2.0, options QFlags() , depthBufferSize 24 , redBufferSize -1 , greenBufferSize -1 , blueBufferSize -1 , alphaBufferSize -1 , stencilBufferSize -1 , samples -1 , swapBehavior 2 , profile 0 )
    got format:
    QSurfaceFormat(version 3.3, options QFlags(0x4) , depthBufferSize 24 , redBufferSize 8 , greenBufferSize 8 , blueBufferSize 8 , alphaBufferSize 0 , stencilBufferSize 0 , samples -1 , swapBehavior 2 , profile 0 )
    Attempt to activate invalid window surface
    Maybe set the window size, eg view.resize(800, 600)..?
    ASSERT failure in QGLPainter: "begin() has not been called or it failed", file /home/rich/tmp/depot/qt5/qt3d/src/threed/painting/qglpainter.cpp, line 1018
    The program has unexpectedly finished.@

    Would I be better off spawning a QWindow outside of the QMdiArea and giving up allowing it to be managed by the main application?

    I've been looking forward to using lots of the Qt3D capabilities like camera control and model loading.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tatarata
      wrote on last edited by
      #2

      Hi kshots,
      I came across your post because I had a very similar issue using a GL window with a winow container. What finally worked for me is to set both the size of the gl window and the size of the container fixed (e.g. 600x800).
      If you have been able to find a better way in the meantime it would be very nice of you to share it!

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved