Add InternalFlag_DontShowWhenUnfloatingHiddenWindow

It's an internal knob you can turn so that setFloating(false)
doesn't show the dockwidget. Only adding this flag in case you need
to support both KDDW and QDW at the same time, or during porting/evaluation.

Fixes #125
This commit is contained in:
Sergio Martins
2020-12-28 19:19:46 +00:00
parent 50e1285839
commit 02bf43b468
2 changed files with 8 additions and 1 deletions

View File

@@ -276,6 +276,12 @@ bool DockWidgetBase::setFloating(bool floats)
if ((floats && alreadyFloating) || (!floats && !alreadyFloating))
return true; // Nothing to do
if (!floats && (Config::self().internalFlags() & Config::InternalFlag_DontShowWhenUnfloatingHiddenWindow) && !isVisible()) {
// Mimics behaviour of QDockWidget, which you might need during porting.
// Not something we suggest though. For KDDW, setFloating(false) means dock, and that implies showing.
return false;
}
if (floats) {
d->saveTabIndex();
if (isTabbed()) {