githubuser0xFFFF/Qt-Advanced-Docking-System

CDockManager::DockAreaHas* features inconsistent

JamesJCode opened this issue · 1 comments

I am setting the following features:

ads::CDockManager::setConfigFlags(ads::CDockManager::DefaultOpaqueConfig);
ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasCloseButton, false);
ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton, false);
ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasTabsMenuButton, false);

Yet observing behaviour when sometimes the close, undock, and tabs buttons are shown. When displaying / hiding / moving the docking panels, sometimes the visibility of the buttons also changes.

image

Platform is MacOS 14.4.1, Qt 6.7.0

Full MainWindow code is:

MainWindow::MainWindow(QWidget* parent)
    : QMainWindow(parent), ui{std::make_unique<Ui::MainWindow>()} {
  ui->setupUi(this);

  // Add the toolbar
  toolbar_ = addToolBar("Top Toolbar");

  // Create the dock manager
  ads::CDockManager::setConfigFlags(ads::CDockManager::DefaultOpaqueConfig);
  ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasCloseButton, false);
  ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton, false);
  ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasTabsMenuButton, false);
  m_DockManager = std::make_unique<ads::CDockManager>(this);

  // Create a dockable widget
  QLabel* l1 = new QLabel();
  l1->setWordWrap(true);
  l1->setAlignment(Qt::AlignTop | Qt::AlignLeft);
  l1->setText("Docking widget 1");
  ads::CDockWidget* dockWidget1 = new ads::CDockWidget("Dock 1");
  dockWidget1->setWidget(l1);
  m_DockManager->addDockWidget(ads::LeftDockWidgetArea, dockWidget1);

  QLabel* l2 = new QLabel();
  l2->setWordWrap(true);
  l2->setAlignment(Qt::AlignTop | Qt::AlignLeft);
  l2->setText("Docking widget 2");
  ads::CDockWidget* dockWidget2 = new ads::CDockWidget("Dock 2");
  dockWidget2->setWidget(l2);
  m_DockManager->addDockWidget(ads::RightDockWidgetArea, dockWidget2);

  // Add menu actions
  ui->menuView->addAction(dockWidget1->toggleViewAction());
  ui->menuView->addAction(dockWidget2->toggleViewAction());
  toolbar_->addAction(dockWidget1->toggleViewAction());
  toolbar_->addAction(dockWidget2->toggleViewAction());
}

Hi, I just added the configflags example in the examples folder based on your provided code. I just tested the example on Windows with Qt 6.5.2 and cannot reproduce the problem.

Please test the configflags example with Qt 6.5.2. If you still see the problem with Qt 6.5.2., then this is a Mac specific issue and you need to try to fix this on your own and provide a pull reeust because I have no Mac here to do and test any Mac related changes.