Skip to content

Moving a dockwidget from autohide to floating leaves isAutoHide() true #739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pylessard opened this issue Apr 30, 2025 · 1 comment · May be fixed by #740
Open

Moving a dockwidget from autohide to floating leaves isAutoHide() true #739

pylessard opened this issue Apr 30, 2025 · 1 comment · May be fixed by #740

Comments

@pylessard
Copy link

pylessard commented Apr 30, 2025

Hi.
First of all, thank you SO much for this awesome piece of code.

I think I found a little bug, where when a AutoHideDockWidget is removed from its dock area, isAutoHide stays true. I can reproduce like this (in python)

def test_ads_bug(self):
    QtAds.CDockManager.setAutoHideConfigFlags(QtAds.CDockManager.DefaultAutoHideConfig)
    dock_conainer= QWidget()
    dock_manager = QtAds.CDockManager(dock_conainer)
    dock_widget = QtAds.CDockWidget("hello")
    dock_manager.addAutoHideDockWidget(QtAds.SideBarRight, dock_widget)
    self.assertFalse(dock_widget.isFloating())
    self.assertTrue(dock_widget.isAutoHide())
    dock_manager.addDockWidgetFloating(dock_widget)
    self.assertTrue(dock_widget.isFloating())   # This is fine
    self.assertFalse(dock_widget.dockAreaWidget().isAutoHide())  # This is fine
    self.assertFalse(dock_widget.isAutoHide())  # This fails!

If I understood correctly:

  1. This is the removal code
  2. This is the flag check code

They are not aligned. In CDockWidget.cpp, autohide is tested with DockArea->isAutoHide() while isAutoHide() check for the SideTabWidget to have value.

Not sure if the removal code should also set SideTabWidget to null or if isAutoHide should be updated to check for d->DockArea->isAutoHide() instead. Or maybe both?

Cheers!

@pylessard pylessard changed the title Moving a dockwidget from autyohide to floating leave isAutoHide() true Moving a dockwidget from autohide to floating leaves isAutoHide() true May 1, 2025
@pylessard
Copy link
Author

pylessard commented May 1, 2025

I can reproduce with latest master branch in c++

    ads::CDockManager::setAutoHideConfigFlags(ads::CDockManager::DefaultAutoHideConfig);
    auto dock_manager = new ads::CDockManager(this);
    setCentralWidget(dock_manager);
    auto dock_widget = new ads::CDockWidget(dock_manager, "hello2");
    dock_manager->addAutoHideDockWidget(ads::SideBarRight, dock_widget);
    std::cout << "1) isFloating:" << dock_widget->isFloating() << std::endl;
    std::cout << "1) isAutoHide:" << dock_widget->isAutoHide() << std::endl;
    
    dock_manager->addDockWidgetFloating(dock_widget);
    std::cout << "2) isFloating:" << dock_widget->isFloating() << std::endl;
    std::cout << "2) area.isAutoHide:" << dock_widget->dockAreaWidget()->isAutoHide() << std::endl;
    std::cout << "2) isAutoHide:" << dock_widget->isAutoHide() << std::endl;

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant