Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

PyQt5 html not displaying?



  • I feel like this should be straightforward to sort out, but I'm having trouble after a bunch of testing and Googling.

    I'm trying to render some plotly plots via a simply PyQt application. On some machines (three so far), it all works. On other machines (two so far), it's completely blank. All of them are running Windows, all python 3.9. All also (from pip list):

    • PyQt5 5.15.4
      PyQt5-Qt5 5.15.2
      PyQt5-sip 12.9.0
      pyqtgraph 0.12.1
      PyQtWebEngine 5.15.4
      PyQtWebEngine-Qt5 5.15.2

    I think the problem is around QWebEngine (probably some configuration, some path variable to do with it) but I'm not sure. Other Qt assets (push buttons, combo boxes, etc. etc.) work great.

    Here are two readily available scripts that I've tested, with screenshots.

    https://www.linuxquestions.org/questions/programming-9/pyqt5-and-qtwebengine-4175695802/ is a full-on web browser. On some machines, it works as a browser. On some, it's blank aside from the toolbar and navigation bar. Compare not working and working.

    Another script I'm using to debug is here, a plotly plot: https://github.com/plotly/plotly.py/issues/716#issuecomment-423748497. Compare not working and working.

    Any hints on what the issue might be? Any other info that I can give that might be helpful?

    Thanks in advance.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    One thing you can do is start your script with the QT_DEBUG_PLUGINS environment variable set to 1.

    That will give information about the various plugins loaded.

    Since it might be using WebGL, did you compare the graphics card and drivers for the machines ?



  • Thanks for the response. I'm working on getting a hold of the difference between the machines' graphics drivers.

    I've added the following to the second example (the plotly plot):

    os.environ['QT_DEBUG_PLUGINS']='1'
    os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = "--enable-gpu-command-logging"
    

    Qt Debug doesn't seem to give me anything interesting, but I do get the following:

    [33276:29816:0921/102811.379:ERROR:gles2_cmd_decoder.cc(5927)] [GroupMarkerNotSet(crbug.com/242999)!:48EB9F6FE1010000]cmd: SetBucketSize
    [33276:29816:0921/102811.379:ERROR:gles2_cmd_decoder.cc(5927)] [GroupMarkerNotSet(crbug.com/242999)!:48EB9F6FE1010000]cmd: SetBucketData
    [33276:29816:0921/102811.379:ERROR:gles2_cmd_decoder.cc(5927)] [GroupMarkerNotSet(crbug.com/242999)!:48EB9F6FE1010000]cmd: SetToken
    [33276:29816:0921/102811.379:ERROR:gles2_cmd_decoder.cc(5927)] [GroupMarkerNotSet(crbug.com/242999)!:48EB9F6FE1010000]cmd: SetBucketSize
    [33276:29816:0921/102811.380:ERROR:gles2_cmd_decoder.cc(5927)] [GroupMarkerNotSet(crbug.com/242999)!:48EB9F6FE1010000]cmd: SetBucketData
    [33276:29816:0921/102811.380:ERROR:gles2_cmd_decoder.cc(5927)] [GroupMarkerNotSet(crbug.com/242999)!:48EB9F6FE1010000]cmd: SetToken
    [33276:29816:0921/102811.380:ERROR:gles2_cmd_decoder.cc(5927)] [GroupMarkerNotSet(crbug.com/242999)!:48EB9F6FE1010000]cmd: kTraceBeginCHROMIUM
    [33276:29816:0921/102811.380:ERROR:gles2_cmd_decoder.cc(5927)] [.BrowserMainThread-000001E16F86AB50]cmd: SetBucketSize[33276:29816:0921/102811.380:ERROR:gles2_cmd_decoder.cc(5927)] [.BrowserMainThread-000001E16F86AB50]cmd: SetBucketSize[33276:29816:0921/102811.381:ERROR:raster_decoder.cc(1210)] [GroupMarkerNotSet(crbug.com/242999)!:68A1506FE1010000]cmd: SetBucketSize
    [33276:29816:0921/102811.381:ERROR:raster_decoder.cc(1210)] [GroupMarkerNotSet(crbug.com/242999)!:68A1506FE1010000]cmd: SetBucketData
    [33276:29816:0921/102811.381:ERROR:raster_decoder.cc(1210)] [GroupMarkerNotSet(crbug.com/242999)!:68A1506FE1010000]cmd: SetToken
    [33276:29816:0921/102811.381:ERROR:raster_decoder.cc(1210)] [GroupMarkerNotSet(crbug.com/242999)!:68A1506FE1010000]cmd: SetBucketSize
    [33276:29816:0921/102811.382:ERROR:raster_decoder.cc(1210)] [GroupMarkerNotSet(crbug.com/242999)!:68A1506FE1010000]cmd: SetBucketData
    [33276:29816:0921/102811.382:ERROR:raster_decoder.cc(1210)] [GroupMarkerNotSet(crbug.com/242999)!:68A1506FE1010000]cmd: SetToken
    [33276:29816:0921/102811.382:ERROR:raster_decoder.cc(1210)] [GroupMarkerNotSet(crbug.com/242999)!:68A1506FE1010000]cmd: kTraceBeginCHROMIUM
    [33276:29816:0921/102811.382:ERROR:raster_decoder.cc(1210)] [.BrowserWorker-000001E16F869E50]cmd: SetBucketSize
    [33276:29816:0921/102811.382:ERROR:raster_decoder.cc(1210)] [.BrowserWorker-000001E16F869E50]cmd: SetBucketSize
    [33276:29816:0921/102811.382:ERROR:gles2_cmd_decoder.cc(5927)] [.BrowserMainThread-000001E16F86AB50]cmd: kFlushDriverCachesCHROMIUM
    [33276:29816:0921/102811.383:ERROR:gles2_cmd_decoder.cc(5927)] [.BrowserMainThread-000001E16F86AB50]cmd: kFlush
    [33276:29816:0921/102811.383:ERROR:raster_decoder.cc(1210)] [.BrowserWorker-000001E16F869E50]cmd: kFlush
    [...]

    Does that mean anything to you guys?



  • @horsefeathers said in PyQt5 html not displaying?:

    os.environ['QT_DEBUG_PLUGINS']='1'
    os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = "--enable-gpu-command-logging"
    

    Qt Debug doesn't seem to give me anything interesting

    If you are setting the QT_DEBUG_PLUGINS environment variable within the PyQt5 script you are wanting to examine, that is too late. It needs to be set externally for Qt start-up. Inside a script it might depend exactly where you do it, maybe before QApplication is good enough, I'm not sure. It should cause some diagnostic output on stdout/err. I don't about the QTWEBENGINE_CHROMIUM_FLAGS.



  • @JonB @SGaist the above unfortunately doesn't seem to make a difference in my situation. I believe both QT_DEBUG_PLUGINS and QTWEBENGINE_CHROMIUM_FLAGS are working as intended.

    Some maybe relative tidbits from DxDiag:

    Card name: Intel(R) Iris(R) Xe Graphics
            Manufacturer: Intel Corporation
               Chip type: Intel(R) **Iris**(R) Xe Graphics Family
                DAC type: Internal
             Device Type: Full Device (POST)
              Device Key: Enum\PCI\VEN_8086&DEV_9A49&SUBSYS_0A211028&REV_01
           Device Status: 0180200A [DN_DRIVER_LOADED|DN_STARTED|DN_DISABLEABLE|DN_NT_ENUMERATOR|DN_NT_DRIVER] 
     Device Problem Code: No Problem
     Driver Problem Code: Unknown
          Display Memory: 8189 MB
        Dedicated Memory: 128 MB
           Shared Memory: 8061 MB
            Current Mode: 1920 x 1080 (32 bit) (60Hz)
             HDR Support: Not Supported
        Display Topology: Extend
     Display Color Space: DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
         Color Primaries: Red(0.648438,0.329102), Green(0.294922,0.619141), Blue(0.144531,0.058594), White Point(0.313477,0.329102)
       Display Luminance: Min Luminance = 0.500000, Max Luminance = 270.000000, MaxFullFrameLuminance = 270.000000
            Monitor Name: Generic PnP Monitor
           Monitor Model: unknown
              Monitor Id: BOE093E
             Native Mode: 1920 x 1080(p) (60.003Hz)
             Output Type: Internal
    Monitor Capabilities: HDR Not Supported


  • @horsefeathers try with: QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu" python main.py


Log in to reply