Skip to content

QtWebEngine

Discussions and questions on QtWebEngine
1.2k Topics 3.8k Posts

QtWS: Super Early Bird Tickets Available!

  • 0 Votes
    1 Posts
    62 Views
    No one has replied
  • QtWebEngine and JS Integration

    Unsolved
    7
    0 Votes
    7 Posts
    302 Views
    JKSHJ

    @emircanacardev said in QtWebEngine and JS Integration:

    WebEngineScriptCollection is not support the qt 5.x i think. Am i right.

    Qt 5.15 didn't have WebEngineScriptCollection, but it still has a list of user scripts: https://doc.qt.io/qt-5/qml-qtwebengine-webengineview.html#userScripts-prop

    // script.js document.body.style.background = "#00aaaa" // *.qml in Qt 5.15 WebEngineView { id: webView anchors.fill: parent url: "chrome://gpu" WebEngineScript { id: script sourceUrl: Qt.resolvedUrl("scripts.js") } Component.onCompleted: webView.userScripts.push(script) } // *.qml in Qt 6.7 WebEngineView { id: webView anchors.fill: parent url: "chrome://gpu" Component.onCompleted: { let script = WebEngine.script() script.sourceUrl = Qt.resolvedUrl("scripts.js") webView.userScripts.insert(script) } }
  • when running the code of webengineview,came the errors

    Unsolved
    3
    0 Votes
    3 Posts
    129 Views
    nicker playerN

    when I resize the qwebengineview,the errors came out.I guess maybe it was caused by the chorum ui threads.
    cause When I resized the qwebengineview very quickly then the program crashed.heres the detail information.

    by the way.are there any ways that could resize the qwebengineview normally?

    code_text

    [opengl\qopenglframebufferobject.cpp line 570] OpenGL Error: 1281
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
    [opengl\qopenglframebufferobject.cpp line 802] OpenGL Error: 1281
    [opengl\qopenglframebufferobject.cpp line 570] OpenGL Error: 1281
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
    QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
    [opengl\qopenglframebufferobject.cpp line 802] OpenGL Error: 1281
    [7,484:6,388:0827/213650.756:ERROR:gles2_cmd_decoder.cc(5,678)] GLES2DecoderImpl::ResizeOffscreenFramebuffer failed to allocate storage due to excessive dimensions.
    [7,484:6,388:0827/213650.756:ERROR:gles2_cmd_decoder.cc(5,678)] GLES2DecoderImpl::ResizeOffscreenFramebuffer failed to allocate storage due to excessive dimensions.
    [7,484:6,388:0827/213650.756:ERROR:gles2_cmd_decoder.cc(5,827)] GLES2DecoderImpl: Context lost because ResizeOffscreenFramebuffer failed.
    [7,484:6,388:0827/213650.757:ERROR:gles2_cmd_decoder.cc(5,963)] Error: 5 for Command kResizeCHROMIUM
    [7,484:6,388:0827/213650.757:ERROR:in_process_command_buffer.cc(375)] MakeCurrent failed because context lost.
    [7,484:6,388:0827/213650.756:ERROR:gles2_cmd_decoder.cc(5,827)] GLES2DecoderImpl: Context lost because ResizeOffscreenFramebuffer failed.
    [7,484:6,388:0827/213650.757:ERROR:gles2_cmd_decoder.cc(5,963)] Error: 5 for Command kResizeCHROMIUM
    [7,484:6,388:0827/213650.757:ERROR:in_process_command_buffer.cc(375)] MakeCurrent failed because context lost.
    [7,484:6,388:0827/213650.766:ERROR:in_process_command_buffer.cc(375)] MakeCurrent failed because context lost.
    [7,484:6,388:0827/213650.766:ERROR:in_process_command_buffer.cc(375)] MakeCurrent failed because context lost.
    [7,484:6,388:0827/213650.852:ERROR:gles2_cmd_decoder.cc(5,678)] GLES2DecoderImpl::ResizeOffscreenFramebuffer failed to allocate storage due to excessive dimensions.
    [7,484:6,388:0827/213650.852:ERROR:gles2_cmd_decoder.cc(5,827)] GLES2DecoderImpl: Context lost because ResizeOffscreenFramebuffer failed.
    [7,484:6,388:0827/213650.852:ERROR:gles2_cmd_decoder.cc(5,678)] GLES2DecoderImpl::ResizeOffscreenFramebuffer failed to allocate storage due to excessive dimensions.
    [7,484:6,388:0827/213650.852:ERROR:gles2_cmd_decoder.cc(5,963)] Error: 5 for Command kResizeCHROMIUM
    [7,484:7,364:0827/213650.852:ERROR:program_binding.cc(257)] Error compiling shader:
    shader program: #define TexCoordPrecision highp
    attribute float a_index;
    attribute TexCoordPrecision vec4 a_position;
    uniform TexCoordPrecision vec2 quad[4];
    uniform mat4 matrix;
    void main() {
    // Compute indices for uniform arrays.
    int vertex_index = int(a_index);

    // Compute the position.
    vec4 pos = vec4(quad[vertex_index], a_position.z, a_position.w);
    gl_Position = matrix * pos;
    }

    [7,484:6,388:0827/213650.852:ERROR:gles2_cmd_decoder.cc(5,827)] GLES2DecoderImpl: Context lost because ResizeOffscreenFramebuffer failed.
    [7,484:6,388:0827/213650.852:ERROR:gles2_cmd_decoder.cc(5,963)] Error: 5 for Command kResizeCHROMIUM
    [7,484:7,364:0827/213650.852:ERROR:program_binding.cc(257)] Error compiling shader:
    shader program: #define TexCoordPrecision highp
    attribute float a_index;
    attribute TexCoordPrecision vec4 a_position;
    uniform TexCoordPrecision vec2 quad[4];
    uniform mat4 matrix;
    void main() {
    // Compute indices for uniform arrays.
    int vertex_index = int(a_index);

    // Compute the position.
    vec4 pos = vec4(quad[vertex_index], a_position.z, a_position.w);
    gl_Position = matrix * pos;
    }

    [7,484:7,364:0827/213650.852:FATAL:program_binding.h(453)] Check failed: IsContextLost(context_provider->ContextGL()).
    Backtrace:
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2B3,345+820,181]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2C5,644+894,676]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2C5,6DC+894,828]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,1F7,046+49,366]
    GetHandleVerifier [0x55,67A,44E+20,479,374]
    GetHandleVerifier [0x55,67A,233+20,478,835]
    GetHandleVerifier [0x55,67D,7DD+20,492,573]
    GetHandleVerifier [0x55,674,E75+20,457,397]
    GetHandleVerifier [0x55,672,8B5+20,447,733]
    GetHandleVerifier [0x55,662,A4D+20,382,605]
    GetHandleVerifier [0x55,662,B49+20,382,857]
    GetHandleVerifier [0x55,662,3B7+20,380,919]
    GetHandleVerifier [0x55,63A,DDE+20,219,678]
    GetHandleVerifier [0x55,635,479+20,196,793]
    GetHandleVerifier [0x55,634,8E8+20,193,832]
    GetHandleVerifier [0x55,635,70A+20,197,450]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,814,773+1,925,219]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,814,7B9+1,925,289]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,81E,C44+1,967,412]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,825,AB4+1,995,684]
    QtWebEngineCore::WebEngineSettings::setWebContentsAdapter [0x51,521,165+3,173]
    TargetNtUnmapViewOfSection [0x53,F12,EB5+26,061,381]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68D,3C0+322,736]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68D,6B5+323,493]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68D,B44+324,660]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68F,606+331,510]
    QtWebEngineCore::WebEngineSettings::setWebContentsAdapter [0x51,521,165+3,173]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,20F,5C1+149,073]
    GetHandleVerifier [0x54,302,B4F+66,703]
    GetHandleVerifier [0x54,302,486+64,966]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2CD,44B+926,939]
    GetHandleVerifier [0x54,303,31C+68,700]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,23C,4DB+333,163]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,23C,294+332,580]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,243,102+360,850]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,243,C0C+363,676]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,200,49C+87,340]
    BaseThreadInitThunk [0x75,957,D69+25]
    RtlInitializeExceptionChain [0x76,F2B,B9B+107]
    RtlClearBits [0x76,F2B,B1F+191]
    Task trace:
    Backtrace:
    GetHandleVerifier [0x55,636,56B+20,201,131]
    GetHandleVerifier [0x54,737,E49+4,478,857]
    GetHandleVerifier [0x55,547,CA7+19,224,039]
    GetHandleVerifier [0x57,B25,FEB+58,931,499]
    GetHandleVerifier [0x55,4F9,72B+18,903,147]
    IPC message handler context: 0x85F9598B

    [7,484:7,364:0827/213650.852:FATAL:program_binding.h(453)] Check failed: IsContextLost(context_provider->ContextGL()).
    Backtrace:
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2B3,345+820,181]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2C5,644+894,676]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2C5,6DC+894,828]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,1F7,046+49,366]
    GetHandleVerifier [0x55,67A,44E+20,479,374]
    GetHandleVerifier [0x55,67A,233+20,478,835]
    GetHandleVerifier [0x55,67D,7DD+20,492,573]
    GetHandleVerifier [0x55,674,E75+20,457,397]
    GetHandleVerifier [0x55,672,8B5+20,447,733]
    GetHandleVerifier [0x55,662,A4D+20,382,605]
    GetHandleVerifier [0x55,662,B49+20,382,857]
    GetHandleVerifier [0x55,662,3B7+20,380,919]
    GetHandleVerifier [0x55,63A,DDE+20,219,678]
    GetHandleVerifier [0x55,635,479+20,196,793]
    GetHandleVerifier [0x55,634,8E8+20,193,832]
    GetHandleVerifier [0x55,635,70A+20,197,450]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,814,773+1,925,219]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,814,7B9+1,925,289]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,81E,C44+1,967,412]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,825,AB4+1,995,684]
    QtWebEngineCore::WebEngineSettings::setWebContentsAdapter [0x51,521,165+3,173]
    TargetNtUnmapViewOfSection [0x53,F12,EB5+26,061,381]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68D,3C0+322,736]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68D,6B5+323,493]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68D,B44+324,660]
    QtWebEngineCore::JavaScriptDialogController::qt_static_metacall [0x51,68F,606+331,510]
    QtWebEngineCore::WebEngineSettings::setWebContentsAdapter [0x51,521,165+3,173]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,20F,5C1+149,073]
    GetHandleVerifier [0x54,302,B4F+66,703]
    GetHandleVerifier [0x54,302,486+64,966]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,2CD,44B+926,939]
    GetHandleVerifier [0x54,303,31C+68,700]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,23C,4DB+333,163]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,23C,294+332,580]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,243,102+360,850]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,243,C0C+363,676]
    QWebEngineUrlSchemeHandler::qt_static_metacall [0x54,200,49C+87,340]
    BaseThreadInitThunk [0x75,957,D69+25]
    RtlInitializeExceptionChain [0x76,F2B,B9B+107]
    RtlClearBits [0x76,F2B,B1F+191]
    Task trace:
    Backtrace:
    GetHandleVerifier [0x55,636,56B+20,201,131]
    GetHandleVerifier [0x54,737,E49+4,478,857]
    GetHandleVerifier [0x55,547,CA7+19,224,039]
    GetHandleVerifier [0x57,B25,FEB+58,931,499]
    GetHandleVerifier [0x55,4F9,72B+18,903,147]
    IPC message handler context: 0x85F9598B

  • 0 Votes
    3 Posts
    355 Views
    D

    self.showMaximized()Put it in front,
    Because the initial window is small, flickering is when the window suddenly maximizes
    from PyQt6.QtCore import QUrl
    from PyQt6.QtWebEngineWidgets import QWebEngineView
    from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout

    class MainWindow(QMainWindow):
    def init(self):
    super().init()
    self.showMaximized()
    wgt_main = QWidget()
    self.layout_main = QVBoxLayout()
    wgt_main.setLayout(self.layout_main)
    self.setCentralWidget(wgt_main)

    self.wbv_main = QWebEngineView() self.wbv_main.load(QUrl("https://threejs.org/examples/#webgl_animation_keyframes")) self.wbv_main.show() self.layout_main.addWidget(self.wbv_main)

    if name == "main":
    # Start QT app
    app = QApplication(sys.argv)

    window = MainWindow() window.show() app.exec()
  • 0 Votes
    2 Posts
    102 Views
    nicker playerN

    and if I set the source file whit the setHtml() function.
    it is hard to get the real height and width if the source was made by the txt.

  • 0 Votes
    2 Posts
    253 Views
    E

    Do you have a solution for that problem? I need.

  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • I got error when i use Webengine lib

    Unsolved
    7
    0 Votes
    7 Posts
    211 Views
    E

    I dont get errors when i use gold linker but website’s dont load , i get blank screen.

  • 0 Votes
    6 Posts
    395 Views
    SGaistS

    @delamor hi, why build for x86_64 if targeting M1 machine ? There's a translation layer that will incur a performance hit.

  • Web Engine runs out of memory when loading a node.js server.

    Unsolved
    2
    0 Votes
    2 Posts
    97 Views
    S

    hi!did you solve the problem, i met the same problem.

  • Build from source errors. QTWebengine (chromium)

    Unsolved
    5
    0 Votes
    5 Posts
    424 Views
    M

    It's not related to Debug or Release. The error is caused by line endings. The parser expects unix instead of dos line endings.

  • Terminating renderer for bad IPC message, reason 123

    Unsolved
    5
    0 Votes
    5 Posts
    194 Views
    SGaistS

    Hi,

    You can build the latest Qt 5.15 for your project and if it works better. If so backport the changes.

  • Solving Error: TLS initialization failed on PySide2

    Unsolved
    2
    0 Votes
    2 Posts
    106 Views
    SGaistS

    Hi,

    You should move to PySide6. Support for OpenSSL 3 started with Qt 6. Even if the support is back-ported to 5.15, you would need to build PySide2 yourself with the corresponding version of Qt 5.

  • Compiling QtWebEngine fails because out of memory

    Unsolved
    13
    0 Votes
    13 Posts
    2k Views
    ytexasY

    @CompSciDude
    I tried -no-webengine-jumbo-build when building Qt 6.7.2, still cannot build cause by out of memory (12 G RAM). Neither --webengine-jumbo-build=<number>

  • Linux gives error in QtWebEngineProcess

    Unsolved
    1
    0 Votes
    1 Posts
    78 Views
    No one has replied
  • No content on macOS M

    Unsolved
    2
    0 Votes
    2 Posts
    115 Views
    No one has replied
  • QWebEngineView not showing on Linux Mint

    Solved
    2
    0 Votes
    2 Posts
    151 Views
    I

    Found the problem, I'm replying if someone else got the same problem.
    I needed to put this line of code :

    os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = "--no-sandbox"

    And to use sys.argv when initializing the app :

    App = Qt.QApplication(sys.argv)

    The final code being the following :

    import PyQt5.QtWidgets as Qt from PyQt5 import QtCore import PyQt5.QtWebEngineWidgets as QtWeb import sys import os class WebView(Qt.QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Web View") self.setGeometry(100, 100, 800, 600) self.webview = QtWeb.QWebEngineView(self) self.setCentralWidget(self.webview) self.webview.load(QtCore.QUrl("https://www.google.com")) if __name__ == "__main__": os.environ["QTWEBENGINE_CHROMIUM_FLAGS"] = "--no-sandbox" App = Qt.QApplication(sys.argv) window = WebView() window.show() app.exec_()

    Hope it helps if someone gets the same issue !

  • QWebEngineView - Application Not Responding

    Unsolved
    12
    0 Votes
    12 Posts
    276 Views
    Juan DevJ

    If I keep the code posted above and if I modify my webBrowser function with this code

    void MyMainWindow::webBrowser() { // Creation Objects m_webViewer = new QWebEngineView(); // Initialisation QString urlPage = "http://factice_url/simple_page.html"; // Setting and Loading URL (HTTP Object used because subsequently need to apply headers) QWebEngineHttpRequest httpObjet; httpObjet.setUrl(urlPage); m_webViewer->load(httpObjet); // Connexions connect(m_webViewer,&QWebEngineView::loadStarted,this,&MyMainWindow::manageBeginLoading); connect(m_webViewer,&QWebEngineView::loadFinished,this,&MyMainWindow::manageEndLoading); }

    And if I add this function

    void MyMainWindow::manageBeginLoading() { // Set Central Frame setCentralWidget(m_webViewer); }

    Application works in mode Debug and in mode Release without problem.
    With this changes I move setCentralWidget(m_webViewer) into the function launched when signal loadStarted is emitted.

    But is this correct or should we deport the creation of the m_webViewer and the connections in the constructor..?

  • 0 Votes
    1 Posts
    60 Views
    No one has replied
  • Persist DevTools preferences between restarts

    Unsolved
    1
    0 Votes
    1 Posts
    87 Views
    No one has replied