- // Update the progress bar when a load is started.
- connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::loadStarted, [privacyWebEngineViewPointer, this] ()
+ // Update the title when it changes.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::titleChanged, [this, splitterPointer] (const QString &title)
+ {
+ // Get the index for this tab.
+ int tabIndex = qTabWidgetPointer->indexOf(splitterPointer);
+
+ // Update the title for this tab.
+ qTabWidgetPointer->setTabText(tabIndex, title);
+
+ // Update the window title if this is the current tab.
+ if (tabIndex == qTabWidgetPointer->currentIndex())
+ emit updateWindowTitle(title);
+ });
+
+ // Connect the loading favorite icon movie to the tab icon.
+ connect(loadingFavoriteIconMoviePointer, &QMovie::frameChanged, [this, splitterPointer, privacyWebEngineViewPointer]
+ {
+ // Get the index for this tab.
+ int tabIndex = qTabWidgetPointer->indexOf(splitterPointer);
+
+ // Display the loading favorite icon if this tab is loading.
+ if (privacyWebEngineViewPointer->isLoading)
+ qTabWidgetPointer->setTabIcon(tabIndex, loadingFavoriteIconMoviePointer->currentPixmap());
+ });
+
+ // Update the icon when it changes.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::iconChanged, [this, splitterPointer, privacyWebEngineViewPointer] (const QIcon &newFavoriteIcon)