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. Problem embedding Qt3DWIndow using createWindowContainer in a MainWindow
Forum Updated to NodeBB v4.3 + New Features

Problem embedding Qt3DWIndow using createWindowContainer in a MainWindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.5k Views 2 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.
  • P Offline
    P Offline
    p.f.f.
    wrote on last edited by
    #1

    Hi Everybody,
    I would like to use Qt3D in one of my projects but I am a bit stuck with stability problems.
    The compiler I am using is MSVC2015 64 bit and I have tried Qt 5.8.0 and 5.9.0 beta and I have different errors when compiling a simple application in which I have embedded a 3D widget using this code in the MainWIndow constructor generated by QtCreator for an application managed by QtDesigner:

    ui->setupUi(this);
        window3d=new Qt3DExtras::Qt3DWindow();
        ui->tab->layout()->addWidget(QWidget::createWindowContainer(window3d));
    

    I have added no additional code.
    The application crashes randomly mostly when closing it and without any message in Qt 5.8.0 and ,I have the compile-time error "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined" with Qt 5.9.0 beta.

    This happens both in debug an release mode.

    Any hint on how to "stabilize" my application or of what am I doing wrong?

    Thanks in advance for your help,

    Pier

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mescalinum
      wrote on last edited by
      #2

      It's not a compile-time error, it's a runtime error, and it happens only once at the very first draw of the window.

      It goes away if you call Qt3DWindow::show() right after window creation.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        p.f.f.
        wrote on last edited by
        #3

        Thanks a lot...of course you are right... It is a runtime error not a compile error... Thanks for the workaround...
        I will test it asap...
        Pier

        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