+ // Instantiate the mainview UI.
+ Ui::MainView mainViewUi;
+
+ // Setup the UI.
+ mainViewUi.setupUi(this);
+
+ // Get handles for the views.
+ urlLineEditPointer = mainViewUi.urlLineEdit;
+ webEngineViewPointer = mainViewUi.webEngineView;
+
+ // Get a handle for the webpage.
+ QWebEnginePage *webEnginePagePointer = webEngineViewPointer->page();
+
+ // Update the webengine view from the URL line edit.
+ connect(urlLineEditPointer, SIGNAL(returnKeyPressed(const QString)), this, SLOT(loadUrl(const QString)));
+
+ // Update the URL line edit form the webengine view.
+ connect(webEngineViewPointer, SIGNAL(loadStarted()), this, SLOT(updateUrlLineEdit()));
+ connect(webEngineViewPointer, SIGNAL(loadProgress(int)), this, SLOT(updateUrlLineEdit()));
+ connect(webEngineViewPointer, SIGNAL(loadFinished(bool)), this, SLOT(updateUrlLineEdit()));
+
+ // Listen for hovered link URLs.
+ connect(webEnginePagePointer, SIGNAL(linkHovered(QString)), this, SLOT(pageLinkHovered(QString)));
+
+ // Set the zoom factor.
+ webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
+
+ // Set the focus on the WebEngine view.
+ webEngineViewPointer->setFocus();
+
+ // Load the homepage. TODO. Consider sanitizing the homepage input and adding things like protocols if they are missing.
+ webEngineViewPointer->setUrl(Settings::homepage());