Beispiel #1
0
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;
}
Beispiel #2
0
void MapEditorToolBase::finishDragging()
{
	Q_ASSERT(dragging);
	dragMove();
	dragging = false;
	dragFinish();
}
Beispiel #3
0
void MapEditorToolBase::reapplyConstraintHelpers()
{
	calcConstrainedPositions(cur_map_widget);
	if (dragging)
		dragMove();
	else
		mouseMove();
}
Beispiel #4
0
void MapEditorToolBase::startDragging() 
{
	Q_ASSERT(!dragging);
	dragging = true;
	dragging_canceled = false;
	dragStart();
	dragMove();
}
Beispiel #5
0
bool RotateTool::keyPress(QKeyEvent* event)
{
	if (event->key() == Qt::Key_Control)
	{
		angle_helper->setActive(true, rotation_center);
		if (isDragging())
			dragMove();
	}
    return false;
}
Beispiel #6
0
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;
}
Beispiel #7
0
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;
}
Beispiel #10
0
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;
}
Beispiel #12
0
void ScenarioView::dragMoveEvent(QGraphicsSceneDragDropEvent* event)
{
  dragMove(event->pos(), *event->mimeData());

  event->accept();
}
Beispiel #13
0
void MapEditorToolBase::updateDragging()
{
	Q_ASSERT(dragging);
	dragMove();
}
Beispiel #14
0
bool CPetDragChev::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
	dragMove(msg->_mousePos);
	return true;
}