重新上传

This commit is contained in:
feiyangqingyun
2021-01-16 12:41:38 +08:00
parent 9cf0de0f8d
commit e8195be0e3
149 changed files with 1545 additions and 6219 deletions

View File

@@ -6,8 +6,7 @@ MoveWidget::MoveWidget(QObject *parent) : QObject(parent)
{
lastPoint = QPoint(0, 0);
pressed = false;
leftButton = false;
rightButton = false;
leftButton = true;
inControl = true;
widget = 0;
}
@@ -17,12 +16,8 @@ bool MoveWidget::eventFilter(QObject *watched, QEvent *event)
if (widget != 0 && watched == widget) {
QMouseEvent *mouseEvent = (QMouseEvent *)event;
if (mouseEvent->type() == QEvent::MouseButtonPress) {
//如果鼠标左键和鼠标右键都可以拖动
if (leftButton && rightButton) {
}
//如果限定了只能鼠标左键拖动则判断当前是否是鼠标左键,如果限定了只能鼠标右键拖动则判断当前是否是鼠标右键
else if ((leftButton && mouseEvent->button() != Qt::LeftButton) || (rightButton && mouseEvent->button() != Qt::RightButton)) {
//如果限定了只能鼠标左键拖动则判断当前是否是鼠标左键
if (leftButton && mouseEvent->button() != Qt::LeftButton) {
return false;
}
@@ -73,11 +68,6 @@ void MoveWidget::setLeftButton(bool leftButton)
this->leftButton = leftButton;
}
void MoveWidget::setRightButton(bool rightButton)
{
this->rightButton = rightButton;
}
void MoveWidget::setInControl(bool inControl)
{
this->inControl = inControl;