1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

Rename flag.

This commit is contained in:
Cynthia Pang 2023-10-18 14:23:14 +08:00
parent 295ab43152
commit afb9933d87
3 changed files with 10 additions and 7 deletions

View File

@ -45,7 +45,7 @@ CMainWindow::CMainWindow(QWidget *parent)
table->setColumnCount(3);
table->setRowCount(10);
CDockWidget* TableDockWidget = new CDockWidget("Table 1");
TableDockWidget->setFeature(CDockWidget::AutoHideDockWidgetClosable, false);
TableDockWidget->setFeature(CDockWidget::DisableCloseButtonWhenAutoHide, true);
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->setMinimumSize(200,150);
@ -57,7 +57,7 @@ CMainWindow::CMainWindow(QWidget *parent)
table->setColumnCount(5);
table->setRowCount(1020);
TableDockWidget = new CDockWidget("Table 2");
TableDockWidget->setFeature(CDockWidget::AutoHideDockWidgetClosable, false);
TableDockWidget->setFeature(CDockWidget::DisableCloseButtonWhenAutoHide, true);
TableDockWidget->setWidget(table);
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
TableDockWidget->resize(250, 150);
@ -69,7 +69,7 @@ CMainWindow::CMainWindow(QWidget *parent)
propertiesTable->setColumnCount(3);
propertiesTable->setRowCount(10);
CDockWidget* PropertiesDockWidget = new CDockWidget("Properties");
PropertiesDockWidget->setFeature(CDockWidget::AutoHideDockWidgetClosable, true);
PropertiesDockWidget->setFeature(CDockWidget::DisableCloseButtonWhenAutoHide, true);
PropertiesDockWidget->setWidget(propertiesTable);
PropertiesDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
PropertiesDockWidget->resize(250, 150);

View File

@ -371,8 +371,11 @@ void DockAreaWidgetPrivate::updateTitleBarButtonStates()
}
TitleBar->button(TitleBarButtonClose)->setEnabled(
(_this->isAutoHide() ? _this->features().testFlag(CDockWidget::AutoHideDockWidgetClosable) : true)
&& _this->features().testFlag(CDockWidget::DockWidgetClosable));
_this->features().testFlag(CDockWidget::DockWidgetClosable)
? _this->isAutoHide()
? !_this->features(BitwiseOr).testFlag(CDockWidget::DisableCloseButtonWhenAutoHide)
: true
: false);
TitleBar->button(TitleBarButtonUndock)->setEnabled(
_this->features().testFlag(CDockWidget::DockWidgetFloatable));
TitleBar->button(TitleBarButtonAutoHide)->setEnabled(

View File

@ -162,8 +162,8 @@ public:
NoTab = 0x080, ///< dock widget tab will never be shown if this flag is set
DeleteContentOnClose = 0x100, ///< deletes only the contained widget on close, keeping the dock widget intact and in place. Attempts to rebuild the contents widget on show if there is a widget factory set.
DockWidgetPinnable = 0x200, ///< dock widget can be pinned and added to an auto hide dock container
AutoHideDockWidgetClosable = 0x400,///< dock widget in an auto hide dock container is closable
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable | DockWidgetPinnable | AutoHideDockWidgetClosable,
DisableCloseButtonWhenAutoHide = 0x400,///< when set, auto hide dock widget close button will be disabled
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable | DockWidgetPinnable,
AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling,
DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose,
NoDockWidgetFeatures = 0x000