Quantcast
Channel: QtWebEngine
Viewing all 13965 articles
Browse latest View live

[[qanda:topic_unsolved]] Compiled QtWebEngineProcess.exe crashed 1 sec after loading webpage

$
0
0

I am trying to figure out what is needed to compile QtWebEngine properly. On my release build, currently I tried to load www.youtube.com and the QtWebEngineProcess.exe will crash after I saw the youtube page show up for 1 sec.

This is the command and configure that I used.

CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" 
SET _ROOT=F:\lib\Qt\Qt5.13.2\5.13.2\Src
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%

configure -opensource -confirm-license -no-icu -opengl desktop -qt-libpng -qt-libjpeg -nomake examples -nomake tests -no-compile-examples -prefix F:\lib\Qt\Qt5.13.2\5.13.2\msvc2019x86 -force-debug-info -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtdatavis3d -skip qtgamepad -skip qtmacextras -skip qtpurchasing -skip qtremoteobjects -skip qtx11extras

nmake
nmake install

Then I build webengine separately.
I create a empty folder and ran the following commands:

CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
F:\lib\Qt\Qt5.13.2\5.13.2\msvc2019x86\bin\qmake.exe F:\lib\Qt\Qt5.13.2\5.13.2\Src\qtwebengine -- -webengine-proprietary-codecs

However, I have no crash using the precompiled binaries dll and webengine from Qt website. 32 bits msvc2017. I have some custom changes and fixes so I need to compile QT instead of using the precompiled binaries.

Anyone knows what is the configure used by Qt to compile their precompiled binaries? Thanks.


[[qanda:topic_unsolved]] Build libQt5WebEngine*.so from sources

$
0
0
@Gluttony There is no need to build Qt to not depend on installed Qt. Simply deploy your app with your Qt libraries. Take a look at https://doc.qt.io/qt-5/deployment.html

[[qanda:topic_unsolved]] QWebEnginePage printToPdf footer

$
0
0

M.Cocktail 23 minutes ago

Hi,

I'm using QWebEnginePage whit setHtml et printToPdf to create a new PDF. I want to add page number like (page # of #) on each page. How can i do that ?

Thanks
M.C

[[qanda:topic_unsolved]] QApplication creates new thread any time

$
0
0

Hey, I'm trying to render a page few times, but unfortunately QApplication creates a new thread every time and when i'm trying to run the rendering on the second time it's saying:
QApplication was not created in the main() thread. In addition i am getting the following error:QApplication::exec must be called on main thread
I tried to create Qapplication object only once, but the trigger for the render method is an event recieved from socketIO module.
At the first time the render does works. At the second time the render crash the whole application

Here is a snipped code:

def __init__(self, table_name=None, db_type=None, *args,
                 **kwargs):
        self.app = QApplication(sys.argv)
        self.app.setApplicationName(QString("Chrome"))
        self.app.setApplicationVersion(QString("53.0.2785.113"))
        super(MainWindow, self).__init__(*args, **kwargs)
        self.setWindowTitle("ScarpSite")
        self.browser = QWebView()
        self.networkAccessManager = QNetworkAccessManager()
        self.cookieJar = QNetworkCookieJar()
        self.__VulnCrud = VulnerabilitiesCRUD
        self.__tableName = table_name
        self.get_configuration_properties()

def ScanPage(self, pageEntity=None, forms=None, links=None, vulnUtils=None):
        self.forms = forms
        self.links = links
        self.vulnUtils = vulnUtils
        self.updateCookiesMechanizetoQt(self.vulnUtils.getCookieJar())
        self.url = pageEntity.getURL()
        self.domain = urlparse(self.url).hostname
        self.browser.loadFinished.connect(self.__onUrlLoaded)
        self.browser.page().setNetworkAccessManager(self.networkAccessManager)
        self.browser.page().userAgentForUrl(QUrl(self.url))
        curURL = QUrl(self.url)
        self.browser.load(curURL)
        self.setCentralWidget(self.browser)
        self.show()
        self.app.exec_()

Any ideas how can i solve it?

[[qanda:topic_unsolved]] input value by getElementById

$
0
0

How do I fill the value in the user name & pass input

my code

import sys
from PyQt5 import QtWebEngineWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
from PyQt5.QtWidgets import QAction
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QWidget, QMainWindow


class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.iniGUI()  # App GUI
        self.table_widget = TabsWidgets(self)  # tabs
        self.setCentralWidget(self.table_widget)
        self.setWindowIcon(QIcon(r"images\title_icons.png"))

    def iniGUI(self):
        self.setWindowTitle("Team")
        self.resize(1500, 900)  # Width, height
        self.add_guiMenu_widgets()  # top menu

    # main window menu
    def add_guiMenu_widgets(self):
        self.statusBar().showMessage("Team")
        main_menu = self.menuBar()
        file_menu = main_menu.addMenu("File")
        edit_menu = main_menu.addMenu("Edit")
        view_menu = main_menu.addMenu("View")
        search_menu = main_menu.addMenu("Search")
        tools_menu = main_menu.addMenu("Tools")
        help_menu = main_menu.addMenu("Help")

        # file menu button
        exit_button = QAction(QIcon("exit.png"), "Exit", self)
        exit_button.setShortcut("Ctrl+Q")
        exit_button.setStatusTip("Exit Application")
        exit_button.triggered.connect(QApplication.instance().quit)
        file_menu.addAction(exit_button)

        # help menu button
        about_button = QAction(QIcon("about.png"), "About", self)
        about_button.setShortcut("Ctrl+H")
        about_button.setStatusTip("About Application")
        # about_button.triggered.connect(QApplication.instance().quit)
        help_menu.addAction(about_button)


class TabsWidgets(QWidget):
    def __init__(self, parent):
        super(QWidget, self).__init__(parent)
        self.layout = QVBoxLayout(self)

        # Initialize tab screen
        self.tabs = QTabWidget()
        self.tab_mainFlash = QWidget()

        # Add tabs
        self.tabs.addTab(self.tab_mainFlash, " Flash - Main ")

        # Create tab_mainFlash
        self.tab_mainFlash.layout = QVBoxLayout(self)
        self.mainFlash = QtWebEngineWidgets.QWebEngineView()
        self.tab_mainFlash.layout.addWidget(self.mainFlash)
        self.tab_mainFlash.setLayout(self.tab_mainFlash.layout)
        self.layout.addWidget(self.tabs)
        self.setLayout(self.layout)
        self.mainFlash.load(QUrl(
            "https://www.facebook.com/login.php"))

        self.mainFlash.page().runJavaScript("document.getElementById('email').Value ='0m3r'")
        self.mainFlash.page().runJavaScript("document.getElementById('pass').Value ='0m3r'")


if __name__ == "__main__":
    application = QApplication(sys.argv)  # create Application
    application.setStyle("Fusion")  # stylesheet
    appGui = MainWindow()  # create instance of class
    appGui.show()  # show the constructed window
    sys.exit(application.exec_())  # execute the application

[[qanda:topic_unsolved]] border-radius disappears during animation

$
0
0

Hello Everyone,

I have a Qt application that renders a webpage using QtWebEngine and I am running into a problem when animating transitions on an html component with border-radius.

The component has a child element (image) and a parent element (mask). The parent element has a border-radius and hides any overflow. When animating the child element to create a zoom effect, it ignores the border radius mask produced by the parent.

I have tested this on builds using Qt 5.13.2 (Chromium 73) and Qt 5.14.0-rc (Chromium 77). Both produce this same behaviour. When downloading the standalone Chromium 73/77 browser or any modern browser there is no such behaviour.

I have tried all kinds of css tricks with no luck (will-change, 3d transforms).
I have tried enabling hardware acceleration in Chromium with no luck (--enable-gpu-rasterization --ignore-gpu-blacklist --enable-oop-rasterization --force-gpu-rasterization).

Code used:
https://codepen.io/jmanhasquestions/pen/WNbxKbo

Hardware:
MacOS Catalina 10.15.1
MacBook Pro (15-inch, 2019)
2.3 GHz 8-Core Intel Core i9
Radeon Pro 560X 4 GB
Intel UHD Graphics 630 1536 MB

Bug gif:
https://imgur.com/a/QYYzf9o

Looking forward to hearing from the community as I am at a loss for what to try next.
Thank you.

[[qanda:topic_unsolved]] post with qt

$
0
0
Try out: QUrl url("http://192.168.4.1/post"); QNetworkRequest request(url); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); QUrlQuery urlq; urlq.addQueryItem ("Hi", ""); QNetworkReply *reply = manager.post(request, urlq.toString (QUrl::FullyEncoded).toUtf8 ()); while (!reply->isFinished()) { qApp->processEvents(); } if(reply->error ()) qDebug ()<<reply->error(); else qDebug ()<<reply->readAll(); reply->deleteLater ();

[[qanda:topic_unsolved]] Netflix Support on QtWebEngine

$
0
0
@dhavaljoshi said in Netflix Support on QtWebEngine: Does https://www.raspberrypi.org/forums/viewtopic.php?p=1362535 This might help.

[[qanda:topic_unsolved]] who have this widget in the web browser demo?

$
0
0
and from PySide2.QtWidgets import qApp, but ide say not fond qApp in QtWidgets.pyi

[[qanda:topic_unsolved]] ERROR:extension_system_qt.cpp(122)] Failed to parse extension manifest.

$
0
0
I haven't used QtWebEngine with Python but IIRC there's an initialisation function to call for that module at least in C++, you should check the equivalent for Python.

[[qanda:topic_unsolved]] Spotify on WebEngineView

$
0
0
Thank you for your answer but, I do not have plugins/ppapi folder..

[[qanda:topic_solved]] Application crahes on QWebEnginePage printing attempt

$
0
0
@SGaist said in Application crahes on QWebEnginePage printing attempt: checking that the call to page returns a valid pointer. Thank you. With the clue I had from this response, and with the help of demobrowser example which is bundled with Qt-5.6 I rewrote the code and could send the page to printer successfully. the code after the modification: QWebEngineView *view = new QWebEngineView(this); view->setHtml("<h1>Hello</h1>", QUrl("about:blank")); printRequest(view->page()); the functions are defined as following void MainWindow::slotHandlePagePrinted(bool result) { Q_UNUSED(result); delete printer; printer = nullptr; } void MainWindow::printRequest(QWebEnginePage *page) { if (printer) return; printer = new QPrinter(); QScopedPointer<QPrintDialog> dialog(new QPrintDialog(printer, this)); if (dialog->exec() != QDialog::Accepted) { slotHandlePagePrinted(true); return; } else { page->print(printer, [=](bool) {}); } } and in the header file: private slots: void slotHandlePagePrinted(bool result); private: QPrinter *printer; void printRequest(QWebEnginePage *page);

[[qanda:topic_unsolved]] QWebEngineView issue

$
0
0

Hi all,

With the following code:

#include <QApplication>
#include <QWebEngineView>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QWebEngineView w;
    w.setUrl(QUrl("https://web.whatsapp.com/"));
    w.show();
    return a.exec();
}

I get the following response from WhatsApp Web:
Screenshot_2020-01-11_17-27-57.png

I'm on Archlinux 64bit with Qt 5.14.

The doc says "This version of Qt WebEngine is based on Chromium version 77.0.3865, with additional security fixes from newer versions." so there shouldn't be any problem, what's wrong here ?

Thanks in advance,
Xavier

[[qanda:topic_unsolved]] QWebEngine not cleaning up Chromium processes and get a warning

$
0
0

Hi all,

I have an app with QtWebEngineWidgets, I have a QMainWindow subclass called WrapperWindow where I add a QWebEngineView, then I add a custom QWebEnginePage to that view that implements the createWindow method so, when a user selects the "Open link in new window" item from the context menu, it creates a new WrapperWindow with the QWebEngineView.
If I open a couple of windows, and then I start closing them, I see on the Windows Task Manager that the chromium processes are not being cleaned up, and when I close the application, on the Qt Creator application output, I get a bunch of warnings stating:

Release of profile requested but WebEnginePage still not deleted. Expect troubles !

Do any of you know how to get QWebEngineView to correctly clean up Chromium?

Here is the code from my Window to create the QWebEngineView and Page:

WrapperWindow::WrapperWindow(QWidget *parent) : QMainWindow(parent)
{
    //setup the window main widget
    mainWidget = new QStackedWidget();
    QWidget* layoutWidget = new QWidget();
    QHBoxLayout* layout = new QHBoxLayout();

    //setup the web view with the system events aware web page
    webView = new QWebEngineView();
    EventAwareWebEnginePage *page = new EventAwareWebEnginePage();
    webView->setPage(page);
    webView->setUrl(QUrl("https://www.google.com"));
    connect(page, &EventAwareWebEnginePage::newPageUrlChanged, [](const QUrl &url) {
        WrapperWindow *window = new WrapperWindow();
        window->setPageUrl(url);
        window->show();
    });
    layout->addWidget(webView);

    //make the layout cover the whole window
    layout->setContentsMargins(0,0,0,0);
    layout->setSpacing(0);

    //layout widgets
    layoutWidget->setLayout(layout);
    mainWidget->addWidget(layoutWidget);
    setCentralWidget(mainWidget);
    this->setMinimumSize(QSize(800,600));
}

void WrapperWindow::setPageUrl(const QUrl &url) {
    webView->setUrl(url);
}

And here is the createWindow function from the custom WebEnginePage class called EventAwareWebEnginePage:

QWebEnginePage *EventAwareWebEnginePage::createWindow(WebWindowType type)
{
    if (type == WebWindowType::WebBrowserWindow)
    {
        QWebEnginePage *page = new QWebEnginePage();
        connect(page, &QWebEnginePage::urlChanged, [this](const QUrl &url) {
            emit newPageUrlChanged(url);
        });
        return page;
    }
    return Q_NULLPTR;
}

[[qanda:topic_unsolved]] Flash disabled from 8/3 Qt 5.11.1

$
0
0
@ThatDud3 Another workaround (for posterity) is listed in https://bugreports.qt.io/browse/QTBUG-78280 So your code will include: qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--enable-pepper-testing ");

[[qanda:topic_unsolved]] some map layers based on .png files are not loaded on webEngine

$
0
0

Hello,

I want to load web page in QML and I'm using:

    Rectangle {
        anchors.fill:parent
        visible:true
        color: "black"

        WebEngineView {
            anchors.fill: parent
            url: "https://www.flightradar24.com/46.70,2.26/5"

        }
    }

All is working fine but this page have some layers with .png file based on "url" and some of them are showed (e.g: "https://tiles.flightradar24.com/atc_boundaries/6/31/21/tile.png") but other are not (e.g: "https://adn4.velocityweather.com/v1/pE1XIsihsRlS/tms/1.0.0/C09-0x0316-0+Standard-Mercator+2020-01-15T09:50:01Z/7/67/83.png?ts=1579084800&sig=gEYtTxby54aMgJHp9SQJ7dUjZJg=" is not show , do you know why?

I try to load directly the not showed .png with:

    Rectangle {
        anchors.fill:parent
        visible:true
        color: "black"

        WebEngineView {
            anchors.fill: parent
            url: "https://adn4.velocityweather.com/v1/pE1XIsihsRlS/tms/1.0.0/C09-0x0316-0+Standard-Mercator+2020-01-15T09:50:01Z/7/67/83.png?ts=1579084800&sig=gEYtTxby54aMgJHp9SQJ7dUjZJg="

        }
    }

and it's working fine, then, it's not url problem...

I open https://www.flightradar24.com/46.70,2.26/5 in iexplorer / firefox and chrome and all it's working fine in all of them

Kind regards
Philippe

[[qanda:topic_unsolved]] Disabling zoom in QWebEngine under Qt 5.9.4

$
0
0
Hello hanzoc, we did the following hack, it worked fine with Qt 5.9: src/core/render_widget_host_view_qt.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 2326dbdf..9fc68819 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -288,6 +288,9 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost *widget } #endif // QT_NO_ACCESSIBILITY // Hack: Disable pinch gesture m_gestureProvider.SetMultiTouchZoomSupportEnabled(false); if (GetTextInputManager()) GetTextInputManager()->AddObserver(this); -- 2.19.2 However, in Qt 5.12, this hack is not required, instead QtWebEngine understands: export QTWEBENGINE_CHROMIUM_FLAGS=--disable-pinch <start your application>

[[qanda:topic_unsolved]] How to deal with error "libQt5WebEngineWidgets.so.5: cannot open shared object file: No s uch file or directory"

$
0
0

Hello
I have already deployed cross-compiled Qt to my ARM board and run a simple testing application successfully. But when I tried to run another application requiring Qtwebengine the error mentioned above occured. I find there was no lib about qtwebengine in lib file-folder. So how can I compile Qt with qtwebengine lib ?

[[qanda:topic_unsolved]] Thanks

[[qanda:topic_unsolved]] Pyside2 toHtml()?

$
0
0
@v-n-lee said in Pyside2 toHtml()?: But I don't know how to transmit the code to python That is because you cannot do so, until QWebEngineCallback is dealt with. Did you understand what I wrote and the Qt bug posts it references?
Viewing all 13965 articles
Browse latest View live