If I keep the code posted above and if I modify my webBrowser function with this code
void MyMainWindow::webBrowser()
{
// Creation Objects
m_webViewer = new QWebEngineView();
// Initialisation
QString urlPage = "http://factice_url/simple_page.html";
// Setting and Loading URL (HTTP Object used because subsequently need to apply headers)
QWebEngineHttpRequest httpObjet;
httpObjet.setUrl(urlPage);
m_webViewer->load(httpObjet);
// Connexions
connect(m_webViewer,&QWebEngineView::loadStarted,this,&MyMainWindow::manageBeginLoading);
connect(m_webViewer,&QWebEngineView::loadFinished,this,&MyMainWindow::manageEndLoading);
}
And if I add this function
void MyMainWindow::manageBeginLoading()
{
// Set Central Frame
setCentralWidget(m_webViewer);
}
Application works in mode Debug and in mode Release without problem.
With this changes I move setCentralWidget(m_webViewer) into the function launched when signal loadStarted is emitted.
But is this correct or should we deport the creation of the m_webViewer and the connections in the constructor..?