+void TabWidget::stop() const
+{
+ // Stop the loading of the current privacy WebEngine.
+ currentPrivacyWebEngineViewPointer->stop();
+}
+
+void TabWidget::toggleDeveloperTools(const bool enabled) const
+{
+ // Get a handle for the current developer tools WebEngine.
+ DevToolsWebEngineView *devToolsWebEngineViewPointer = qTabWidgetPointer->currentWidget()->findChild<DevToolsWebEngineView *>();
+
+ if (enabled)
+ {
+ // Set the zoom factor on the development tools WebEngine.
+ devToolsWebEngineViewPointer->setZoomFactor(currentWebEnginePagePointer->zoomFactor());
+
+ // Enable the development tools.
+ currentWebEnginePagePointer->setDevToolsPage(devToolsWebEngineViewPointer->page());
+
+ // Enable JavaScript on the development tools WebEngine.
+ devToolsWebEngineViewPointer->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
+
+ // Display the developer tools.
+ devToolsWebEngineViewPointer->setVisible(true);
+ }
+ else
+ {
+ // Disable JavaScript on the development tools WebEngine to prevent error messages from being written to the console.
+ devToolsWebEngineViewPointer->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
+
+ // Disable the development tools.
+ currentWebEnginePagePointer->setDevToolsPage(nullptr);
+
+ // Hide the developer tools.
+ devToolsWebEngineViewPointer->setVisible(false);
+ }
+}
+