How to kill page when it's window is closed?
Solved
QtWebEngine
-
I handle
target="_blank"
links this way:QWebEngineView *BrowserView::createWindow(QWebEnginePage::WebWindowType) { MainWindow *win = new MainWindow(); win->show(); BrowserView *browserView = win->findChild<BrowserView *>("browserView"); return browserView; }
So when I click a link that is supposed to be opened in new tab/window, a new
MainWindow
is created and the url is opened there. That's ok, but if I close that window, the page obviously isn't killed — the sound from that page continues to play. How can I close/kill the page when the window is closed?MainWindow
declaration:class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private: Ui::MainWindow *ui; };