nested mdi: Fix MDI's frame title not being updated
Before we didn't need to update it because there was only 1 dock widget. But now, if there's more than one we need to set the application's name instead of the dock widget's name as title.
This commit is contained in:
@@ -237,6 +237,17 @@ QString DockWidgetBase::uniqueName() const
|
||||
|
||||
QString DockWidgetBase::title() const
|
||||
{
|
||||
if (d->isMDIWrapper()) {
|
||||
// It's just a wrapper to help implementing Option_MDINestable. Return the title of the real dock widget we're hosting.
|
||||
auto dropAreaGuest = qobject_cast<DropArea*>(widget());
|
||||
Q_ASSERT(dropAreaGuest);
|
||||
if (dropAreaGuest->hasSingleFrame()) {
|
||||
return dropAreaGuest->frames().constFirst()->title();
|
||||
} else {
|
||||
return qApp->applicationName();
|
||||
}
|
||||
}
|
||||
|
||||
return d->title;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user