Skip to content

Commit 1abe101

Browse files
Prevent middle-click from closing unclosable tabs (#372)
This fixes a bug whereby you could close a dock widget by middle-clicking its tab, even if its `CDockWidget::DockWidgetClosable` flag is set to `false`.
1 parent 0ebc170 commit 1abe101

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DockWidgetTab.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev)
407407
}
408408
else if (ev->button() == Qt::MiddleButton)
409409
{
410-
if (CDockManager::testConfigFlag(CDockManager::MiddleMouseButtonClosesTab))
410+
if (CDockManager::testConfigFlag(CDockManager::MiddleMouseButtonClosesTab) && dockWidget->features().testFlag(CDockWidget::DockWidgetClosable))
411411
{
412412
// Only attempt to close if the mouse is still
413413
// on top of the widget, to allow the user to cancel.

0 commit comments

Comments
 (0)