更新文档
parent
2855b71060
commit
021adc39f6
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 214 KiB |
|
@ -150,30 +150,33 @@ bool FramelessWidget2::eventFilter(QObject *watched, QEvent *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (type == QEvent::MouseButtonPress) {
|
} else if (type == QEvent::MouseButtonPress) {
|
||||||
//记住鼠标按下的坐标+窗体区域
|
//必须是鼠标左键
|
||||||
QMouseEvent *mouseEvent = (QMouseEvent *)event;
|
if (qApp->mouseButtons() == Qt::LeftButton) {
|
||||||
mousePoint = mouseEvent->pos();
|
//记住鼠标按下的坐标和窗体区域
|
||||||
mouseRect = widget->geometry();
|
QMouseEvent *mouseEvent = (QMouseEvent *)event;
|
||||||
|
mousePoint = mouseEvent->pos();
|
||||||
|
mouseRect = widget->geometry();
|
||||||
|
|
||||||
//判断按下的手柄的区域位置
|
//判断按下的手柄的区域位置
|
||||||
if (pressedRect.at(0).contains(mousePoint)) {
|
if (pressedRect.at(0).contains(mousePoint)) {
|
||||||
pressedArea[0] = true;
|
pressedArea[0] = true;
|
||||||
} else if (pressedRect.at(1).contains(mousePoint)) {
|
} else if (pressedRect.at(1).contains(mousePoint)) {
|
||||||
pressedArea[1] = true;
|
pressedArea[1] = true;
|
||||||
} else if (pressedRect.at(2).contains(mousePoint)) {
|
} else if (pressedRect.at(2).contains(mousePoint)) {
|
||||||
pressedArea[2] = true;
|
pressedArea[2] = true;
|
||||||
} else if (pressedRect.at(3).contains(mousePoint)) {
|
} else if (pressedRect.at(3).contains(mousePoint)) {
|
||||||
pressedArea[3] = true;
|
pressedArea[3] = true;
|
||||||
} else if (pressedRect.at(4).contains(mousePoint)) {
|
} else if (pressedRect.at(4).contains(mousePoint)) {
|
||||||
pressedArea[4] = true;
|
pressedArea[4] = true;
|
||||||
} else if (pressedRect.at(5).contains(mousePoint)) {
|
} else if (pressedRect.at(5).contains(mousePoint)) {
|
||||||
pressedArea[5] = true;
|
pressedArea[5] = true;
|
||||||
} else if (pressedRect.at(6).contains(mousePoint)) {
|
} else if (pressedRect.at(6).contains(mousePoint)) {
|
||||||
pressedArea[6] = true;
|
pressedArea[6] = true;
|
||||||
} else if (pressedRect.at(7).contains(mousePoint)) {
|
} else if (pressedRect.at(7).contains(mousePoint)) {
|
||||||
pressedArea[7] = true;
|
pressedArea[7] = true;
|
||||||
} else {
|
} else {
|
||||||
mousePressed = true;
|
mousePressed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (type == QEvent::MouseMove) {
|
} else if (type == QEvent::MouseMove) {
|
||||||
//改成用HoverMove识别
|
//改成用HoverMove识别
|
||||||
|
|
Loading…
Reference in New Issue