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. QWebEngineView->render() throws nullptr exception
Forum Updated to NodeBB v4.3 + New Features

QWebEngineView->render() throws nullptr exception

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 351 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.
  • A Offline
    A Offline
    ANorton
    wrote on last edited by
    #1

    Hello everyone, having a Qt 5.15.5 that was built for x86, Windows, QWebEngineView and QGraphicsScene (used for off-screen rendering)
    Rendering a QWebEngineView by render() method, and everything works-as-designed.
    But, in some undefined scenarios, it throws some nullpointer exception within QOpenGLFunctions::glReadPixels: a pixels is nullptr.
    I think that's may be a some strange bug that should be fixed, passing some screenshots of exception points
    Point first: calling QGraphicsScene render() method
    45be4ad3-69cd-495e-8f50-87d3c207f127-image.png
    And then the point where exception happens
    83113a3b-5010-4f15-8f7b-27c58be183e9-image.png 88e528e7-c9b9-40bd-a6c5-4ad41d63236d-image.png

    If you need a full call stack then I can provide it, the only problem is that this exception happens not always, once in 35-40 minutes i guess

    JonBJ 1 Reply Last reply
    0
    • A ANorton

      Hello everyone, having a Qt 5.15.5 that was built for x86, Windows, QWebEngineView and QGraphicsScene (used for off-screen rendering)
      Rendering a QWebEngineView by render() method, and everything works-as-designed.
      But, in some undefined scenarios, it throws some nullpointer exception within QOpenGLFunctions::glReadPixels: a pixels is nullptr.
      I think that's may be a some strange bug that should be fixed, passing some screenshots of exception points
      Point first: calling QGraphicsScene render() method
      45be4ad3-69cd-495e-8f50-87d3c207f127-image.png
      And then the point where exception happens
      83113a3b-5010-4f15-8f7b-27c58be183e9-image.png 88e528e7-c9b9-40bd-a6c5-4ad41d63236d-image.png

      If you need a full call stack then I can provide it, the only problem is that this exception happens not always, once in 35-40 minutes i guess

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @ANorton said in QWebEngineView->render() throws nullptr exception:

      If you need a full call stack then I can provide it

      Certainly that will give a clue.

      A 1 Reply Last reply
      0
      • JonBJ JonB

        @ANorton said in QWebEngineView->render() throws nullptr exception:

        If you need a full call stack then I can provide it

        Certainly that will give a clue.

        A Offline
        A Offline
        ANorton
        wrote on last edited by
        #3

        @JonB 0a5f24e3-7947-4065-8458-88b3e8635e41-image.png
        4d35bbbe-d2a1-4816-a0e8-2867b47d5c86-image.png

        1 Reply Last reply
        0
        • Paul ColbyP Offline
          Paul ColbyP Offline
          Paul Colby
          wrote on last edited by
          #4

          Hi @ANorton,

          I could be wrong (not at all familiar with Qt's painters, graphics scenes, and OpenGL) but try removing the this from the QPainter's constructor.

          Typically, Qt's QObject-derived classed accept other QObject-derived classes (such as your main_window) to set a parent-child relationship for chained destruction, which is great! :) So its not at all surprising to see you using the common pattern of constructing a Qt class with this.

          However, QPainter is not QObject-derived, and is not using this typical Qt "parent" pattern. According to the docs, the QPainter(QPaintDevice *device) constructor that you are using:

          Constructs a painter that begins painting the paint device immediately.

          In other words, its a convenient overload that automatically invokes QPainter::begin(this) (on construction) and QPainter::end() (on destruction).

          Since you're using the graphics scene to paint, I think that you're meant to use the QPainter() constructor, so that the graphics scene can handle the operation completely its own way.

          Anyway, it's just a hunch, but worth a try :)

          Cheers.

          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