Skip to content
  • 0 Votes
    2 Posts
    993 Views
    M

    @MicNielsen I guess it isn't possible :(

  • 0 Votes
    2 Posts
    1k Views
    D

    Here are the screenshots depicting the problem:
    works from web
    fails from local drive

  • 0 Votes
    3 Posts
    2k Views
    NecceferN

    As I understand the problem with a proxy so no one decided? Thought the new firmware would fix the matter, but my proxy provider says that the problem is not on their side.

  • 0 Votes
    5 Posts
    5k Views
    H

    Disregard my previous post, cookies policy can be set in the QWebEngineProfile owned by the QWebEnginePage owned by the QWebEngineView, like this: ui->webView->page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);

    The page pointer remains the same for my purposes, at least.

  • 0 Votes
    4 Posts
    3k Views
    M

    I use this code to resolve my problem :

    Rectangle {
    width: (tabView.width)-30
    Layout.preferredHeight: 400
    z:1
    WebEngineView {
    id: webview
    url: "http://google.com"
    anchors.fill: parent
    }

    }
  • 0 Votes
    6 Posts
    5k Views
    E

    Below is the one I tried. Now the link opens in a new window.
    But how do I make it open in a new tab.
    I checked the link which was provided in the previous code. But as beginner, it's too much for me to understand.

    #include "WebEnginePage.h" WebEnginePage::WebEnginePage(QObject *parent) : QWebEnginePage(parent) { connect(this,SIGNAL(urlChanged(QUrl)),this,SLOT(loadInTab(QUrl))); } WebEnginePage::~WebEnginePage() { } void WebEnginePage::loadInTab(QUrl url) { qDebug()<<"Page : "<<url; emit pageInNewTab(url); } #include "WebEngineView.h" WebEngineView::WebEngineView(QWidget *parent) : QWebEngineView(parent) { webPage = new WebEnginePage(this); setPage(webPage); setGeometry(0,35,dw.width(),dw.height()-35); // connect(page(),SIGNAL(urlChanged(QUrl)),this,SLOT(loadInNewTab(QUrl))); connect(page(),SIGNAL(pageInNewTab(QUrl)),this,SLOT(loadInNewTab(QUrl))); hide(); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(onPageLoadFinished(bool))); } void WebEngineView::onPageLoadFinished(bool value) { qDebug()<<"WebEngineView::onPageLoadFinished"; show(); emit newTab(this); } WebEngineView::~WebEngineView() { } WebEngineView *WebEngineView::createWindow(QWebEnginePage::WebWindowType type) { Q_UNUSED(type); qDebug()<<"WebEngineView::createWindow"; WebEngineView *webView = new WebEngineView(); qDebug()<<"Index : "<<++index; WebEnginePage *newWeb = new WebEnginePage(webView); webView->setAttribute(Qt::WA_DeleteOnClose, true); webView->setPage(newWeb); //webView->show(); return webView; } void WebEngineView::loadInNewTab(QUrl url) { qDebug()<<"WebEngineView "<<index<<" : "<<url; // createWindow(QWebEnginePage::WebBrowserTab); } int WebEngineView::getIndex() const { return index; } void WebEngineView::setIndex(int value) { index = value; } #include "TabWindow.h" TabWindow::TabWindow(QWidget *parent) : QMainWindow(parent) { weView = new WebEngineView(this); weView->setGeometry(0,50,dw.width(),dw.height()); loadedUrl = QUrl("http://www.google.co.in"); //weView->load(QUrl(loadedUrl)); weView->webPage->load(loadedUrl); QWidget *centralWidget = new QWidget(this); tabWidget = new QTabWidget(centralWidget); tabWidget->setTabsClosable(true); //tabWidget->setElideMode(Qt::ElideRight); tabWidget->setFixedSize(dw.width(),dw.height()); loadedUrl = QUrl("http://www.google.co.in"); tabWidget->addTab(weView,loadedUrl.host()); setCentralWidget(centralWidget); currentIndex = 0; weView->setIndex(currentIndex); //weViewNew = new WebEngineView(this); connect(weView,SIGNAL(newTab(WebEngineView&)),this,SLOT(loadNewTab(WebEngineView7))); connect(tabWidget,SIGNAL(tabCloseRequested(int)),this,SLOT(closeTab(int))); } TabWindow::~TabWindow() { } void TabWindow::closeTab(int index) { tabWidget->removeTab(index); } void TabWindow::loadNewTab(WebEngineView *webView) { //webView->show(); tabWidget->addTab(webView,webView->webPage->url().host()); //tabWidget->setCurrentIndex(currentIndex); qDebug()<<"TabWindow::loadNewTab : "; }
  • 0 Votes
    2 Posts
    4k Views
    cm0x4dC

    Had the same issue. Even the topic is quite old I publish here my solution for anyone that might have this issue now.

    Note that I need to track the mouse, so I call setMouseTracking(true); in the constructor.

    class CustomWebEngineView: public QWebEngineView { public: explicit CustomWebEngineView(QWidget *parent = nullptr): QWebEngineView(parent) { QApplication::instance()->installEventFilter(this); setMouseTracking(true); } protected: bool eventFilter(QObject *object, QEvent *event) { if (object->parent() == this && event->type() == QEvent::MouseMove) { mouseMoveEvent(static_cast<QMouseEvent *>(event)); } return false; } };