Skip to content

QtWebEngine

Discussions and questions on QtWebEngine
1.3k Topics 3.9k Posts
  • 0 Votes
    3 Posts
    2k Views
    Bit old but if anybody finds this post while researching this (and using MSVC), make sure you're building in release mode for performance testing. The debug libs for WebEngine take significantly longer to initialize. See https://forum.qt.io/topic/52360/qwebengineview-is-very-very-very-slow
  • Porting to a new platform

    Unsolved 13 Apr 2021, 02:32
    0 Votes
    6 Posts
    934 Views
    Elad - How far did you get with a WebEngine port? Jim
  • WebEngine and cache usage

    Unsolved webengine cache qt6 7 Feb 2022, 13:52
    0 Votes
    1 Posts
    538 Views
    No one has replied
  • 1 Votes
    1 Posts
    683 Views
    No one has replied
  • 0 Votes
    1 Posts
    224 Views
    No one has replied
  • Set Home Page In Browser

    Unsolved 29 Jan 2022, 00:10
    0 Votes
    2 Posts
    345 Views
    @nareba2780 said in Set Home Page In Browser: sethome_btn.triggered.connect(self.sethome()) Look at the slot specification of all your other connect statements, e.g. self.tabs.currentChanged.connect(self.current_tab_changed) back_btn.triggered.connect(lambda: self.tabs.currentWidget().back()) Can you see the difference? Either specify a method name without the () or use a lambda: ... and you can call a method with ().
  • 0 Votes
    2 Posts
    302 Views
    @leofitz-chen see https://doc.qt.io/qt-5/qwebenginepage.html#contextMenuData
  • 0 Votes
    1 Posts
    670 Views
    No one has replied
  • 0 Votes
    3 Posts
    491 Views
    @raven-worx I Dont Understand "Qt Flatform" But, I Solved This Problem. The problem was solved by using setHtml without using setUrl. However, I am not sure why it was resolved.
  • 0 Votes
    2 Posts
    378 Views
    @Hanson https://doc.qt.io/qt-5/qwebenginecookiestore.html
  • How to return array from runJavaScript ?

    Unsolved 12 Jan 2022, 06:48
    0 Votes
    6 Posts
    875 Views
    @Oolong The existing code uses QWebElementCollection boxes = page()->mainFrame()->findAllElements(). I have no idea what the return type of runJavaScript("document.querySelectorAll()") might be, and until you know that you won't know what code is necessary to visit what comes back in your const QVariant& boxes.
  • Cross-compile QtWebEngine for Raspberry 3

    Unsolved 17 Dec 2021, 15:36
    0 Votes
    12 Posts
    2k Views
    @DiegOne said in Cross-compile QtWebEngine for Raspberry 3: error: attribute(target("arch=armv8-a+crc")) is unknown i think your issue is that the function has the attribute target("arch=armv8-a+crc") defined. but according to your compile call your are only compiling with -march=armv8-a. So the +crc is missing. But better would be to find the cause why it wrongly detects that it wants the crc extension. Read this for more details about the compiler option. Also this guides says to configure Qt with -device linux-rasp-pi3-vc4-g++ options. This enables hw acceleration via KMS, which must be supported by the Linux kernel on the Pi (i dont know thats the case, might be). Whereas -device linux-rasp-pi3-g++ would use the default Broadcom graphics stack. Is that really desired by you? check the file qtbase/mkspecs/devices/<DEVICE-OPTION>/qmake.conf in that file you could also add the +crc extension flag
  • Delete item from bookmark

    Unsolved 21 Dec 2021, 13:55
    0 Votes
    2 Posts
    363 Views
    @GDPpy You can override https://doc.qt.io/qt-5/qwidget.html#mousePressEvent where you then get the action under cursor using https://doc.qt.io/qt-5/qtoolbar.html#actionAt
  • QtWebEngine White Text on White Background

    Unsolved 5 Dec 2021, 18:54
    0 Votes
    1 Posts
    279 Views
    No one has replied
  • 0 Votes
    2 Posts
    856 Views
    Found a solution: index.html needs to be changed to the following rearrangement of the above code: <!doctype html> <html lang="en"> <meta charset="utf-8"> <head> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css" integrity="sha384-R4558gYOUz8mP9YWpZJjofhk+zx0AS11p36HnD2ZKj/6JR5z27gSSULCNHIRReVs" crossorigin="anonymous"> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js" integrity="sha384-z1fJDqw8ZApjGO3/unPWUPsIymfsJmyrDVWC8Tv/a1HeOtGmkwNd/7xUS0Xcnvsx" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"></script> <link rel="stylesheet" type="text/css" href="3rdparty/markdown.css"> <script src="3rdparty/marked.js"></script> <script src="qrc:/qtwebchannel/qwebchannel.js"></script> </head> <body> <div id="placeholder"></div> <script> 'use strict'; document.addEventListener("DOMContentLoaded", function() { var placeholder = document.getElementById('placeholder'); var renderMath = function() { renderMathInElement(document.body, { // customised options // • auto-render specific keys, e.g.: delimiters: [ {left: '$$', right: '$$', display: true}, {left: '$', right: '$', display: false}, {left: '\\(', right: '\\)', display: false}, {left: '\\[', right: '\\]', display: true} ], // • rendering keys, e.g.: throwOnError : false }); } var updateText = function(text) { placeholder.innerHTML = marked(text); renderMath(); } new QWebChannel(qt.webChannelTransport, function(channel) { var content = channel.objects.content; updateText(content.text); content.textChanged.connect(updateText); } ); }); </script> </body> </html> That is we need to call KaTeX after marked() and do so in the same update function. I had to put everything into a document-on-load since for some reason that was needed, but now I'm thinking maybe not. It depends on how KaTeX behaves.
  • QtWebEngine MSVC Compiler

    Unsolved msvc qtwebengine uwp 28 Nov 2021, 19:57
    0 Votes
    4 Posts
    815 Views
    The QtWebView module comes to mind for that.
  • 0 Votes
    1 Posts
    274 Views
    No one has replied
  • simplebrowser

    Unsolved 24 Nov 2021, 06:14
    0 Votes
    3 Posts
    447 Views
    @mecctor I took the liberty to reduct the links in your post.
  • Custom error pages (404, 403 etc) and setHtml

    Unsolved 13 Nov 2021, 15:37
    0 Votes
    2 Posts
    783 Views
    I worked around the urlbar text thing with this. if url.startswith("data:"): text = self.urlbar.text() self.urlbar.setText(text) It basically works, because setHtml always forces something starting with "data:" into the urlbar. As far as the custom Html status codes / error messages, I can make a custom 404.html page on my Apache server and direct my .htaccess file to it, but that's how far I can go. Is there any "onLoadFailed" type of syntax in PyQt where I could check if a page was able to be loaded at all? I've disabled Chromium's status codes with this: settings = QWebEngineSettings.globalSettings() settings.setAttribute(QWebEngineSettings.ErrorPageEnabled, False) but if a page is offline for example, all I get is a blank page which is confusing to users.
  • select fields with a lot of data

    Unsolved 19 Nov 2021, 16:05
    0 Votes
    3 Posts
    414 Views
    @JonB said in select fields with a lot of data: This really should not be the case, given that QtWebEngine is just using the chromium engine. Nor should how you compile be relevant if you are just presenting QtWebEngine with some fixed HTML. So do you have more than that going on? Are you counting your code time to generate the list of the selects? Can you show a minimal example of your issue? In my project I first create the complete html page and then I associate it with the WebEngine dynamically. The fields, in this case, are three select a bit long .. same this: var urlEngineFormPgm = splitViewComponent.txtCurrentPath + "/html/" + namefilehtml; var objRectPgmCreate = componentQmlRectPgm.createObject(objMainWindow, {"xProgram": positionX, "objectNameProgram": objName, "textProgram": "Loading. . . .", "visibleProgram": true, "urlPgm": urlEngineFormPgm, . . . . where urlPgm is alia og WebEngine property URL I have never calculated the execution time but I notice big differences between debug and release but also in release if I have a computer with few resources everything becomes slow .. The same page opened with crhome behaves in a normal way without being slow. P.S. Is slow when I touch fields Select for open list of combobox NOT when load QML whith WebEngine