============================================================================
| 505 | |
| 506 | //============================================================================ |
| 507 | void CAutoHideTab::mouseMoveEvent(QMouseEvent *ev) |
| 508 | { |
| 509 | if (!(ev->buttons() & Qt::LeftButton) |
| 510 | || d->isDraggingState(DraggingInactive)) |
| 511 | { |
| 512 | d->DragState = DraggingInactive; |
| 513 | Super::mouseMoveEvent(ev); |
| 514 | return; |
| 515 | } |
| 516 | |
| 517 | // move floating window |
| 518 | if (d->isDraggingState(DraggingFloatingWidget)) |
| 519 | { |
| 520 | d->FloatingWidget->moveFloating(); |
| 521 | Super::mouseMoveEvent(ev); |
| 522 | return; |
| 523 | } |
| 524 | |
| 525 | // move tab |
| 526 | if (d->isDraggingState(DraggingTab)) |
| 527 | { |
| 528 | // Moving the tab is always allowed because it does not mean moving the |
| 529 | // dock widget around |
| 530 | //d->moveTab(ev); |
| 531 | } |
| 532 | |
| 533 | auto MappedPos = mapToParent(ev->pos()); |
| 534 | bool MouseOutsideBar = (MappedPos.x() < 0) |
| 535 | || (MappedPos.x() > parentWidget()->rect().right()); |
| 536 | // Maybe a fixed drag distance is better here ? |
| 537 | int DragDistanceY = qAbs( |
| 538 | d->GlobalDragStartMousePosition.y() |
| 539 | - internal::globalPositionOf(ev).y()); |
| 540 | if (DragDistanceY >= CDockManager::startDragDistance() || MouseOutsideBar) |
| 541 | { |
| 542 | // Floating is only allowed for widgets that are floatable |
| 543 | // We can create the drag preview if the widget is movable. |
| 544 | auto Features = d->DockWidget->features(); |
| 545 | if (Features.testFlag(CDockWidget::DockWidgetFloatable) |
| 546 | || (Features.testFlag(CDockWidget::DockWidgetMovable))) |
| 547 | { |
| 548 | d->startFloating(); |
| 549 | } |
| 550 | return; |
| 551 | } |
| 552 | |
| 553 | Super::mouseMoveEvent(ev); |
| 554 | } |
| 555 | |
| 556 | //============================================================================ |
| 557 | void CAutoHideTab::dragEnterEvent(QDragEnterEvent *ev) |
nothing calls this directly
no test coverage detected