Skip to content

QtWebEngine

Discussions and questions on QtWebEngine
1.2k Topics 3.7k Posts
QtWS25 Call for Papers
  • 0 Votes
    1 Posts
    21 Views
    No one has replied
  • Linux gives error in QtWebEngineProcess

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

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

    Solved
    2
    0 Votes
    2 Posts
    44 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
    136 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
    21 Views
    No one has replied
  • Persist DevTools preferences between restarts

    Unsolved
    1
    0 Votes
    1 Posts
    48 Views
    No one has replied
  • 0 Votes
    2 Posts
    44 Views
    B

    I have already solved this problem. The solution is:

    m_view->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
  • 0 Votes
    1 Posts
    66 Views
    No one has replied
  • 0 Votes
    1 Posts
    35 Views
    No one has replied
  • This topic is deleted!

    Locked Unsolved
    2
    0 Votes
    2 Posts
    14 Views
  • 0 Votes
    7 Posts
    691 Views
    Cobra91151C

    Hello!

    So, I added this patch: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/505412
    I have successfully built QtWebEngine 5.15.14 for Visual Studio 2022. Now, this issue is resolved.

  • Migrating Settings from Qt5 to Qt6

    Solved
    3
    0 Votes
    3 Posts
    78 Views
    R

    thanks for the reply @mpergand
    Does that mean that on the new API, there's no way to set it as a static method so it's global for all pages and I'll have to set the profile and use it as a global variable instead of just configuring defaults at class level?

    EDIT: never mind, fixed it using something like this from your suggestion, thanks!

    QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, true);
  • Web engine not installing or downloading properly

    Unsolved
    21
    0 Votes
    21 Posts
    462 Views
    JonBJ

    @Aronox
    QWebEngine is known to be particularly slow in Debug builds. Although I understand you are only interested in the difference in speed between the two, it would be interesting to see what that is on a Release build instead.

  • 0 Votes
    9 Posts
    1k Views
    A

    @somethingvague I'm also having the same problem with my application. In my case I initialize the class which contains the web engine view instance (let us say class B) after someone clicks some button in a different class(let's say A), Now both classes A and B have different UI interfaces. Can you please help me stop flicker from happening in this case?

    ffb38eee-739e-4e23-b32f-7af6e8fb171d-image.png

    30f649a4-679d-4b50-8bf0-24a6c6155131-image.png

    I have shown the Class B initialization and engine setup above.
    I have initialized class and enigine setup before window.show() as been told in the above conversation.

  • 0 Votes
    4 Posts
    127 Views
    Axel SpoerlA

    Well, as I said, Ubuntu on arm64 is not supported.

  • setHttpHeader not wok in QWebEngineUrlRequestInfo

    Unsolved
    12
    0 Votes
    12 Posts
    231 Views
    JonBJ

    I don't know anything about it, but my guess is that it is changing the header, but you are not seeing the effect you expect/desire. What evidence do you have that it is not setting your header? After calling setHttpHeader() if you are Qt 6.5+ try calling QHash<QByteArray, QByteArray> QWebEngineUrlRequestInfo::httpHeaders() const to at least make sure your Cache-Control header is there. Or try sniffing/checking what is received at server side.

  • Can't build QtWebEngine on Windows with MSVC 2022

    Solved
    2
    0 Votes
    2 Posts
    162 Views
    T

    I ended up figuring it out... I still had the bin path for my 6.6.2 installation in my Windows PATH and I also had Qt Quick Compiler Extensions installed for 6.6.2, but not for 6.7.0. This caused the build to attempt to use qmlsc.exe from the 6.6.2 install which must have caused the issue, since the build succeeded after removing the Qt Quick Compiler Extensions module from 6.6.2 via the maintenance tool

  • 0 Votes
    2 Posts
    171 Views
    R

    Anybody?
    I know that the bug is quite specific, but it is a showstopper, still since the environment described is very common (windows laptop with external screen)

  • 0 Votes
    2 Posts
    104 Views
    P

    I solved the issue. The cookie policy and offTheRecord properties are not enough.

    It is also mandatory to set a cachePath, and possibly a storageName, as following:

    QQuickWebEngineProfile* webEngineProfile = QQuickWebEngineProfile::defaultProfile(); webEngineProfile->setPersistentCookiesPolicy(QQuickWebEngineProfile::ForcePersistentCookies); webEngineProfile->setOffTheRecord(false); webEngineProfile->setStorageName(QStringLiteral("Default")); webEngineProfile->setCachePath(webEngineProfile->persistentStoragePath() + QStringLiteral("/Cache"));