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. QOpenGLWidget black screen as a newly created class
QtWS25 Last Chance

QOpenGLWidget black screen as a newly created class

Scheduled Pinned Locked Moved Unsolved General and Desktop
openglwidgetdesktopopengl
2 Posts 1 Posters 486 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.
  • E Offline
    E Offline
    ElonWu
    wrote on 4 Apr 2022, 23:57 last edited by ElonWu 4 May 2022, 00:08
    #1

    I got a black screen when creating a QOpenGLWidget from a QWidget in 5.14, and the code like this:
    widget.cpp:

        QOpenGLWidget *game = new QOpenGLWidget();
        game->show();
    

    But that openglwidget is really rendered and running normally if it's an independent application.

    This happened when i integrate it into another application by directly copy all files.

    I know QOpenGLWidget's function may fail when used as child thread, so should i integrate it into subdir project and launch it from other project or is there any other method to make it render again?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      ElonWu
      wrote on 5 Apr 2022, 08:30 last edited by
      #2

      It's been solved by create a process and launch the QOpenGLWidget's .exe file.

      1 Reply Last reply
      0

      1/2

      4 Apr 2022, 23:57

      • Login

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