webEngineProfilePointer = webEnginePagePointer->profile();
webEngineSettingsPointer = webEngineViewPointer->settings();
webEngineProfilePointer = webEnginePagePointer->profile();
webEngineSettingsPointer = webEngineViewPointer->settings();
- // Update the webengine view from the URL line edit.
- connect(urlLineEditPointer, SIGNAL(returnKeyPressed(const QString)), this, SLOT(loadUrlFromTextBox(const QString)));
+ // Update the webengine view from the URL line edit. TODO. Remove.
+ connect(urlLineEditPointer, SIGNAL(returnKeyPressed(const QString)), this, SLOT(loadUrlFromLineEdit(const QString)));
// Update the URL line edit from the webengine view.
connect(webEngineViewPointer, SIGNAL(loadStarted()), this, SLOT(updateInterface()));
connect(webEngineViewPointer, SIGNAL(loadProgress(const int)), this, SLOT(updateInterface()));
connect(webEngineViewPointer, SIGNAL(loadFinished(const bool)), this, SLOT(updateInterface()));
// Update the URL line edit from the webengine view.
connect(webEngineViewPointer, SIGNAL(loadStarted()), this, SLOT(updateInterface()));
connect(webEngineViewPointer, SIGNAL(loadProgress(const int)), this, SLOT(updateInterface()));
connect(webEngineViewPointer, SIGNAL(loadFinished(const bool)), this, SLOT(updateInterface()));
connect(backButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(back()));
connect(forwardButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(forward()));
connect(refreshButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(reload()));
connect(backButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(back()));
connect(forwardButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(forward()));
connect(refreshButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(reload()));
- connect(homeButtonPointer, SIGNAL(clicked()), this, SLOT(goHome()));
+ connect(homeButtonPointer, SIGNAL(clicked()), this, SLOT(home()));
connect(javaScriptButtonPointer, SIGNAL(clicked()), this, SLOT(toggleJavaScript()));
connect(domainSettingsButtonPointer, SIGNAL(clicked()), this, SLOT(openDomainSettings()));
connect(javaScriptButtonPointer, SIGNAL(clicked()), this, SLOT(toggleJavaScript()));
connect(domainSettingsButtonPointer, SIGNAL(clicked()), this, SLOT(openDomainSettings()));
noDomainSettingsPalette = urlLineEditPointer->palette();
domainSettingsPalette = urlLineEditPointer->palette();
noDomainSettingsPalette = urlLineEditPointer->palette();
domainSettingsPalette = urlLineEditPointer->palette();
domainSettingsPalette.setColor(QPalette::Base, QColor("#C8E6C9"));
// Instantiate the mouse event pointer.
domainSettingsPalette.setColor(QPalette::Base, QColor("#C8E6C9"));
// Instantiate the mouse event pointer.
webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
// Apply the domain settings palette to the URL line edit.
webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
// Apply the domain settings palette to the URL line edit.
webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
// Apply the no domain settings palette to the URL line edit.
webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
// Apply the no domain settings palette to the URL line edit.
-void BrowserView::goHome() const
+void BrowserView::back() const
+{
+ // Go back.
+ webEngineViewPointer->back();
+}
+
+void BrowserView::forward() const
+{
+ // Go forward.
+ webEngineViewPointer->forward();
+}
+
+void BrowserView::home() const
if (!urlLineEditPointer->hasFocus())
{
// Update the URL line edit.
urlLineEditPointer->setText(webEngineViewPointer->url().toString());
}
if (!urlLineEditPointer->hasFocus())
{
// Update the URL line edit.
urlLineEditPointer->setText(webEngineViewPointer->url().toString());
}
- backButtonPointer->setEnabled(webEngineHistoryPointer->canGoBack());
- forwardButtonPointer->setEnabled(webEngineHistoryPointer->canGoForward());
+ backButtonPointer->setEnabled(webEngineHistoryPointer->canGoBack()); // TODO Remove.
+ emit updateBackAction(webEngineHistoryPointer->canGoBack());
+ forwardButtonPointer->setEnabled(webEngineHistoryPointer->canGoForward()); // TODO Remove.
+ emit updateForwardAction(webEngineHistoryPointer->canGoForward());
// 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());
// 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());