QWebEngineView and createWindow()



  • 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;*/
    

    }
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.