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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user