Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt3D - [c++] Q: 3D Window is not showing on Windows 10 Build
Forum Updated to NodeBB v4.3 + New Features

Qt3D - [c++] Q: 3D Window is not showing on Windows 10 Build

Scheduled Pinned Locked Moved Solved Game Development
5 Posts 1 Posters 1.1k 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.
  • K Offline
    K Offline
    kevin_d
    wrote on last edited by
    #1

    Hi!

    I am compiling my application on windows using qt creator with QT 5.15.1.
    When running, i don't get any errors or warnings. The Application is shown.
    Except of - 3D content in the Qt3DWindow (Qt3DExtras::Qt3DWindow).

    On linux, it is working well.
    Do i miss anything which needs to be considered when building / running Qt3D on windows?

    Any help is highly appreciated!

    best regards, kevin

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kevin_d
      wrote on last edited by
      #2

      This is the code, which displays the window:

      view = (Qt3DExtras::Qt3DWindow *)scene;
      widget = QWidget::createWindowContainer(scene);
      
      if (camera == nullptr)
      {
          camera = view->camera();
          camera->lens()->setPerspectiveProjection(45.0f, 45.0f, 1.0f, 1000.0f);
          camera->setPosition(QVector3D(0,-50,50));
          camera->setViewCenter(QVector3D(0,0,0));
      }
      
      layout = new QHBoxLayout(widget);
      layout->setContentsMargins(0,0,0,0);
      layout->setMargin(8);
      layout->addWidget(container);
      widget->setVisible(true);
      widget->showMinimized();
      widget->close();
      
      view->setRootEntity(scene->entity);
      view->show();
      
      setLayout(layout);
      

      btw, im compiling with VS2019 Toolset and 32 bit.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kevin_d
        wrote on last edited by
        #3

        and, additionally, these trailing lines.

        view->setRootEntity(scene->entity);
        view->showMaximized();
        view->show();
        

        Regard, the window is shown white Canvas, but no content.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kevin_d
          wrote on last edited by
          #4

          Do I miss any OpenGL / DirectX setting?
          Any C++ flags for the windows environment?
          Any additional statements to enable the graphical rendering?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kevin_d
            wrote on last edited by
            #5

            I found out what was the problem:

            The Window, which hosts the layout in which the 3D Widget is set, contains the following statement in the constructor:

            setWindowState(windowState() | Qt::WindowMaximized);
            

            or..

            setWindowState(Qt::WindowMaximized);
            

            I removed this statement and the 3D Window now shows the content.

            This is not happening in the Linux build!

            Now, both builds work correctly.

            Issue is solved.

            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