Update title bar label when the widget's title changes. (#798)

This commit is contained in:
André Vautour
2026-01-15 16:42:18 -04:00
committed by GitHub
parent f9ad1d7801
commit e78133b7b2
3 changed files with 19 additions and 1 deletions

View File

@@ -934,6 +934,19 @@ void CDockAreaWidget::updateTitleBarVisibility()
}
//============================================================================
void CDockAreaWidget::updateWindowTitle()
{
auto currentWidget = d->ContentsLayout->currentWidget();
if (d->TitleBar && currentWidget)
{
d->TitleBar->autoHideTitleLabel()->setText(currentWidget->windowTitle());
}
markTitleBarMenuOutdated();
}
//============================================================================
void CDockAreaWidget::markTitleBarMenuOutdated()
{

View File

@@ -165,6 +165,11 @@ protected:
*/
void internalSetCurrentDockWidget(CDockWidget* DockWidget);
/**
* Call this function to update the window title
*/
void updateWindowTitle();
/**
* Marks tabs menu to update
*/

View File

@@ -883,7 +883,7 @@ bool CDockWidget::event(QEvent *e)
}
if (d->DockArea)
{
d->DockArea->markTitleBarMenuOutdated();//update tabs menu
d->DockArea->updateWindowTitle();
}
auto FloatingWidget = floatingDockContainer();