bool DrawPointTool::keyPress(QKeyEvent* event) { if (event->key() == Qt::Key_Tab) deactivate(); else if (event->key() == Qt::Key_Control) { if (isDragging() && rotating) { angle_helper->setActive(true, preview_object->getCoordF()); calcConstrainedPositions(cur_map_widget); dragMove(); } } else if (event->key() == Qt::Key_Shift) { snap_helper->setFilter(SnappingToolHelper::AllTypes); calcConstrainedPositions(cur_map_widget); if (isDragging()) dragMove(); else mouseMove(); } else return false; return true; }
void MapEditorToolBase::finishDragging() { Q_ASSERT(dragging); dragMove(); dragging = false; dragFinish(); }
void MapEditorToolBase::reapplyConstraintHelpers() { calcConstrainedPositions(cur_map_widget); if (dragging) dragMove(); else mouseMove(); }
void MapEditorToolBase::startDragging() { Q_ASSERT(!dragging); dragging = true; dragging_canceled = false; dragStart(); dragMove(); }
bool RotateTool::keyPress(QKeyEvent* event) { if (event->key() == Qt::Key_Control) { angle_helper->setActive(true, rotation_center); if (isDragging()) dragMove(); } return false; }
bool RotateTool::keyRelease(QKeyEvent* event) { if (event->key() == Qt::Key_Control && angle_helper->isActive()) { angle_helper->setActive(false); if (isDragging()) dragMove(); return true; } return false; }
bool DrawPointTool::keyRelease(QKeyEvent* event) { if (event->key() == Qt::Key_Control && angle_helper->isActive()) { angle_helper->setActive(false); calcConstrainedPositions(cur_map_widget); if (isDragging()) dragMove(); } else if (event->key() == Qt::Key_Shift) { snap_helper->setFilter(SnappingToolHelper::NoSnapping); calcConstrainedPositions(cur_map_widget); if (isDragging()) dragMove(); else mouseMove(); } else return false; return true; }
bool DrawPointTool::keyRelease(QKeyEvent* event) { bool result = true; switch (event->key()) { case Qt::Key_Control: if (isDragging()) dragMove(); break; case Qt::Key_Shift: snap_helper->setFilter(SnappingToolHelper::NoSnapping); reapplyConstraintHelpers(); break; default: result = false; } return result; }
bool RotatePatternTool::keyPressEvent(QKeyEvent* event) { if (event->key() == Qt::Key_Control) { active_modifiers |= Qt::ControlModifier; auto active = QGuiApplication::mouseButtons().testFlag(Qt::LeftButton); angle_helper->setActive(active, click_pos_map); if (isDragging()) { updateConstrainedPositions(); dragMove(); } else if (active) { updateDirtyRect(); // for active angle helper } updateStatusText(); return true; } return false; }
bool RotatePatternTool::keyReleaseEvent(QKeyEvent* event) { if (event->key() == Qt::Key_Control) { active_modifiers &= ~Qt::ControlModifier; if (angle_helper->isActive()) { if (!isDragging()) { updateDirtyRect(); } angle_helper->setActive(false); if (isDragging()) { updateConstrainedPositions(); dragMove(); } } updateStatusText(); return true; } return false; }
bool DrawPointTool::keyPress(QKeyEvent* event) { bool result = true; switch (event->key()) { case Qt::Key_Tab: deactivate(); break; case Qt::Key_Escape: case Qt::Key_0: if (!editingInProgress()) { preview_object->setRotation(0); updateStatusText(); if (!editor->isInMobileMode()) mouseMove(); } break; case Qt::Key_Control: if (isDragging()) dragMove(); break; case Qt::Key_Shift: snap_helper->setFilter(SnappingToolHelper::AllTypes); reapplyConstraintHelpers(); break; default: result = false; } return result; }
void ScenarioView::dragMoveEvent(QGraphicsSceneDragDropEvent* event) { dragMove(event->pos(), *event->mimeData()); event->accept(); }
void MapEditorToolBase::updateDragging() { Q_ASSERT(dragging); dragMove(); }
bool CPetDragChev::MouseDragMoveMsg(CMouseDragMoveMsg *msg) { dragMove(msg->_mousePos); return true; }