更新文档

master
feiyangqingyun 2024-04-05 17:56:56 +08:00
parent 2855b71060
commit 021adc39f6
3 changed files with 63 additions and 29 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

View File

@ -150,7 +150,9 @@ bool FramelessWidget2::eventFilter(QObject *watched, QEvent *event)
} }
} }
} else if (type == QEvent::MouseButtonPress) { } else if (type == QEvent::MouseButtonPress) {
//记住鼠标按下的坐标+窗体区域 //必须是鼠标左键
if (qApp->mouseButtons() == Qt::LeftButton) {
//记住鼠标按下的坐标和窗体区域
QMouseEvent *mouseEvent = (QMouseEvent *)event; QMouseEvent *mouseEvent = (QMouseEvent *)event;
mousePoint = mouseEvent->pos(); mousePoint = mouseEvent->pos();
mouseRect = widget->geometry(); mouseRect = widget->geometry();
@ -175,6 +177,7 @@ bool FramelessWidget2::eventFilter(QObject *watched, QEvent *event)
} else { } else {
mousePressed = true; mousePressed = true;
} }
}
} else if (type == QEvent::MouseMove) { } else if (type == QEvent::MouseMove) {
//改成用HoverMove识别 //改成用HoverMove识别
} else if (type == QEvent::MouseButtonRelease) { } else if (type == QEvent::MouseButtonRelease) {