MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / mouseMoveEvent

Method mouseMoveEvent

app/src/Platform/CSD.cpp:694–715  ·  view source on GitHub ↗

* @brief Handles mouse move events for window dragging. */

Source from the content-addressed store, hash-verified

692 * @brief Handles mouse move events for window dragging.
693 */
694void Titlebar::mouseMoveEvent(QMouseEvent* event)
695{
696 if (!m_dragging || !window()) {
697 event->accept();
698 return;
699 }
700
701 auto* win = window();
702 m_dragging = false;
703
704 if (isMaximized()) {
705 const qreal relativeX = event->position().x() / width();
706 const QPointF globalPos = event->globalPosition();
707
708 win->showNormal();
709 win->setPosition(qRound(globalPos.x() - win->width() * relativeX),
710 qRound(globalPos.y() - height() / 2));
711 }
712
713 win->startSystemMove();
714 event->accept();
715}
716
717/**
718 * @brief Toggles the window maximized state on double-click.

Callers

nothing calls this directly

Calls 3

acceptMethod · 0.80
xMethod · 0.80
widthMethod · 0.80

Tested by

no test coverage detected