Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebEngineView and createWindow()
Qt 6.11 is out! See what's new in the release blog

QWebEngineView and createWindow()

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello there!

    I have a problem with Qt5.4. I have QWebEngineView and some page with JS popup. I want open this popup in same QWebEngineView. In QWebView i just write in createWindow() "return this", but with QWebEngineView this not work.

    @
    #ifndef WEBVIEW_H
    #define WEBVIEW_H

    #include <QWebEngineView>--

    class WebView : public QWebEngineView {

    Q_OBJECT
    

    public:
    explicit WebView(QWidget *parent = 0);

    private:
    QWebEngineView* createWindow(QWebEnginePage::WebWindowType);
    };

    #endif // WEBVIEW_H
    @
    @
    #include "webview.h"

    WebView::WebView(QWidget *parent) : QWebEngineView(parent) {
    }

    QWebEngineView* WebView::createWindow(QWebEnginePage::WebWindowType) {
    return this;

     /*QWebEngineView *webView = new QWebEngineView;
     QWebEnginePage *newWeb = new QWebEnginePage(webView);
     webView->setAttribute(Qt::WA_DeleteOnClose, true);
     webView->setPage(newWeb);
     webView->show();
    
     return webView;*/
    

    }
    @

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved