本文整理汇总了C++中QWheelEvent::globalY方法的典型用法代码示例。如果您正苦于以下问题:C++ QWheelEvent::globalY方法的具体用法?C++ QWheelEvent::globalY怎么用?C++ QWheelEvent::globalY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWheelEvent
的用法示例。
在下文中一共展示了QWheelEvent::globalY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventFilter
//.........这里部分代码省略.........
}
// If there's a visible QGraphicsItem under the mouse and mouse is not in FPS mode,
// the click's supposed to go there - don't send it at all to inworld scene.
// if (itemUnderMouse && mouseCursorVisible)
// return false;
// The mouse coordinates we receive can come from different widgets, and we are interested only in the coordinates
// in the QGraphicsView client area, so we need to remap them.
QPoint mousePos = MapPointToMainGraphicsView(obj, e->pos());
MouseEvent mouseEvent;
mouseEvent.itemUnderMouse = GetVisibleItemAtCoords(e->x(), e->y());
mouseEvent.origin = mouseEvent.itemUnderMouse ? MouseEvent::PressOriginQtWidget : MouseEvent::PressOriginScene;
if ( !doubleClickDetected)
{
mouseEvent.eventType = (event->type() == QEvent::MouseButtonPress) ? MouseEvent::MousePressed : MouseEvent::MouseReleased;
} else
{
mouseEvent.eventType = MouseEvent::MouseDoubleClicked;
}
mouseEvent.button = (MouseEvent::MouseButton)e->button();
mouseEvent.x = mousePos.x();
mouseEvent.y = mousePos.y();
mouseEvent.z = 0;
mouseEvent.relativeX = mouseEvent.x - lastMouseX;
mouseEvent.relativeY = mouseEvent.y - lastMouseY;
mouseEvent.modifiers = current_modifiers_;
lastMouseX = mouseEvent.x;
lastMouseY = mouseEvent.y;
mouseEvent.globalX = e->globalX();
mouseEvent.globalY = e->globalY();
mouseEvent.otherButtons = e->buttons();
// mouseEvent.heldKeys = heldKeys; ///\todo
mouseEvent.handled = false;
// The mouse press is going to the inworld scene - clear keyboard focus from the QGraphicsScene widget, if any had it so key events also go to inworld scene.
if (event->type() == QEvent::MouseButtonPress && !mouseEvent.itemUnderMouse && mouseCursorVisible)
mainView->scene()->clearFocus();
TriggerMouseEvent(mouseEvent);
return mouseEvent.handled;
}
case QEvent::MouseMove:
{
// If a mouse button is held down, we get the mouse drag events from the viewport widget.
// If a mouse button is not held down, the application main window will get the events.
// Duplicate events are not received, so no need to worry about filtering them here.
QMouseEvent *e = static_cast<QMouseEvent *>(event);
//QGraphicsItem *itemUnderMouse = GetVisibleItemAtCoords(e->x(), e->y());
// If there is a graphicsItem under the mouse, don't pass the move message to the inworld scene, unless the inworld scene has captured it.
// if (mouseCursorVisible)
// if ((itemUnderMouse && sceneMouseCapture != SceneMouseCapture) || sceneMouseCapture == QtMouseCapture)
// return false;
// if (mouseCursorVisible && itemUnderMouse)
// return false;