X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fmainview.cpp;h=e46f00d1d6660f68a6d9140a2ca61121668015f8;hp=a1e018b400734422350bbf1b8cf3c46d5ef88685;hb=aca3bbeca7fee2ff50918a9d09a41be4edf1140c;hpb=f3047a42fa756bb36d4840f40ab7acf83e751b48 diff --git a/src/mainview.cpp b/src/mainview.cpp index a1e018b..e46f00d 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -47,6 +47,9 @@ MainView::MainView(QWidget *parent) : QWidget(parent) 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/"))); } @@ -60,5 +63,8 @@ void MainView::loadUrl(const QString &urlFromUser) 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. + webEngineViewPointer->setZoomFactor(Settings::zoomFactor()); }