Don't flicker when showing a floating dock widget

Create the FloatingWindow directly, instead of creating the DockWidget
then reparenting it
This commit is contained in:
Sergio Martins
2020-03-07 21:15:44 +00:00
parent ca4d63ed2e
commit cc1e1eaa51
3 changed files with 21 additions and 4 deletions

View File

@@ -343,6 +343,17 @@ QString DockWidgetBase::affinityName() const
return d->affinityName;
}
void DockWidgetBase::show()
{
if (isWindow() && (lastPosition()->m_wasFloating || !lastPosition()->isValid())) {
// Create the FloatingWindow already, instead of waiting for the show event.
// This reduces flickering on some platforms
morphIntoFloatingWindow();
} else {
QWidget::show();
}
}
void DockWidgetBase::setAffinityName(const QString &name)
{
if (d->affinityName == name)