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. Embedded Qt3DWindow not getting closed/removed from widget
Forum Updated to NodeBB v4.3 + New Features

Embedded Qt3DWindow not getting closed/removed from widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.0k Views
  • 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
    poortipant
    wrote on last edited by
    #1

    Hi

    I am developing a Qt application that can load and display 3D (.dae) files. The 3D files load fine. My problem is when I try to load another 3D file on the same Qt3DWindow. Before trying to load the file, I close the viewer and then load the file.

    // Loading 3D
    mainWindow->view = new Qt3DExtras::Qt3DWindow(); // view is an object of type Qt3DExtras::Qt3DWindow
    mainWindow->container = QWidget::createWindowContainer(mainWindow->view);
    
    // Closing the viewer
    mainWindow->view->close();
    mainWindow->mainLayout->removeWidget(mainWindow->container);
    

    But somehow, the viewer isn't being closed or removed. This causes my window to have multiple viewers that stay in the background. If the user resizes the window then those viewers become visible at the borders.

    Any idea, what's wrong?
    I am using Qt 5.7 on Windows.

    jsulmJ 1 Reply Last reply
    0
    • P poortipant

      Hi

      I am developing a Qt application that can load and display 3D (.dae) files. The 3D files load fine. My problem is when I try to load another 3D file on the same Qt3DWindow. Before trying to load the file, I close the viewer and then load the file.

      // Loading 3D
      mainWindow->view = new Qt3DExtras::Qt3DWindow(); // view is an object of type Qt3DExtras::Qt3DWindow
      mainWindow->container = QWidget::createWindowContainer(mainWindow->view);
      
      // Closing the viewer
      mainWindow->view->close();
      mainWindow->mainLayout->removeWidget(mainWindow->container);
      

      But somehow, the viewer isn't being closed or removed. This causes my window to have multiple viewers that stay in the background. If the user resizes the window then those viewers become visible at the borders.

      Any idea, what's wrong?
      I am using Qt 5.7 on Windows.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @poortipant Did you try to delete mainWindow->container, or if you need it later to hide it?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      0
      • jsulmJ jsulm

        @poortipant Did you try to delete mainWindow->container, or if you need it later to hide it?

        P Offline
        P Offline
        poortipant
        wrote on last edited by
        #3

        @jsulm
        Thanks for the response!
        Yes, currently, as a temporary solution, I am hiding the views before creating a new one. But this causes problems when I close the application window. As, the viewer is not being closed, it causes the application to crash.

        I might have found something on this,
        https://bugreports.qt.io/browse/QTBUG-53834
        Will try my code on version 5.7.1 and see what happens.

        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