MCPcopy Create free account
hub / github.com/KDE/labplot / mouseMoveEvent

Method mouseMoveEvent

src/3rdparty/Qt-Advanced-Docking-System/src/AutoHideTab.cpp:507–554  ·  view source on GitHub ↗

============================================================================

Source from the content-addressed store, hash-verified

505
506//============================================================================
507void 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//============================================================================
557void CAutoHideTab::dragEnterEvent(QDragEnterEvent *ev)

Callers

nothing calls this directly

Calls 8

globalPositionOfFunction · 0.85
xMethod · 0.80
rectMethod · 0.80
isDraggingStateMethod · 0.45
moveFloatingMethod · 0.45
yMethod · 0.45
featuresMethod · 0.45
startFloatingMethod · 0.45

Tested by

no test coverage detected