connect(webEngineViewPointer, SIGNAL(loadProgress(int)), this, SLOT(updateUrlLineEdit()));
connect(webEngineViewPointer, SIGNAL(loadFinished(bool)), this, SLOT(updateUrlLineEdit()));
+ // Set the zoom factor.
+ webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
+
// Load a website.
webEngineViewPointer->setUrl(QUrl(QStringLiteral("https://www.stoutner.com/")));
}
void MainView::updateUrlLineEdit()
{
// Update the URL line edit.
- urlLineEditPointer->setText(webEngineViewPointer->url().toString());
+ urlLineEditPointer->setUrl(webEngineViewPointer->url().toString());
+
+ // Reapply the zoom factor. This is a bug in QWebEngineView that resets the zoom with every load. Hopefully it will be fixed in Qt6. <https://bugreports.qt.io/browse/QTBUG-51992>
+ webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
}