KDAB / KDDockWidgets

KDAB's Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets
Other
747 stars 163 forks source link

How can I hide, then reshow tab group all at once so that tabs can be brought back together instead of seperating? #513

Open acarlson98 opened 3 weeks ago

acarlson98 commented 3 weeks ago

Is there a correct way to hide or show a group of widgets at the same time via QML? Simply calling .close() and .show() on all the widgets in order works in most cases (if all widgets are docked, if widgets are undocked but not tabbed), but does not work when any of the targeted widgets are tabbed together and undocked. In this case, the functions cause the widgets to redock, but leaves the widget in the last tab index undocked.

Please see gif below. I would expect the tabbed, undocked widgets in this case to remain that way when opened again, but dock4 and dock5 are redocked in the main docking area and dock6 remains undocked:

hide and show undocked tab group issue 2

I slightly modified the qtquick_dockwidgets example to make this gif. This is KDDockWidgets v2.1.0 and built using Visual Studio 2019.

The function that is fired to show or hide the widget group:

function toggleWidgetGroup() {
    if(root.groupShown){
        dock4.close()
        dock5.close()
        dock6.close()
    } else {
        dock4.open()
        dock5.open()
        dock6.open()
    }
    root.groupShown = !root.groupShown
}
iamsergio commented 2 weeks ago

This will be a bit more involved than I thought.

DockWidgets don't save their placeholder in floating windows, only main windows. Checking what can be done

iamsergio commented 1 week ago

This depends on issue #280 which has been fixed in main / 2.2