00001 #pragma once 00002 00003 #include "QtEventToSoEvent.h" 00004 class SoDEPRECATED QTVIEWERCOMPONENTS_API QEventToSoEvent : public QtEventToSoEvent 00009 { 00010 public: 00011 00017 static SoMouseButtonEvent* 00018 getMousePressEvent( QMouseEvent* qevent, QWidget* widget ) 00019 { 00020 return QtEventToSoEvent::getMousePressEvent( qevent, QPoint( qevent->x() * widget->devicePixelRatio(), 00021 ( ( widget->height() - 1 ) - qevent->y() ) * widget->devicePixelRatio() ) ); 00022 } 00023 00029 static SoMouseButtonEvent* 00030 getMouseReleaseEvent( QMouseEvent* qevent, QWidget* widget ) 00031 { 00032 return QtEventToSoEvent::getMouseReleaseEvent( qevent, QPoint( qevent->x() * widget->devicePixelRatio(), 00033 ( ( widget->height() - 1 ) - qevent->y() ) * widget->devicePixelRatio() ) ); 00034 } 00035 00041 static SoMouseButtonEvent* 00042 getMouseDoubleClickEvent( QMouseEvent* qevent, QWidget* widget ) 00043 { 00044 return QtEventToSoEvent::getMouseDoubleClickEvent( qevent, QPoint( qevent->x() * widget->devicePixelRatio(), 00045 ( ( widget->height() - 1 ) - qevent->y() ) * widget->devicePixelRatio() ) ); 00046 } 00047 00052 static SoMouseWheelEvent* 00053 getMouseWheelEvent( QWheelEvent* qevent, QWidget* ) 00054 { 00055 return QtEventToSoEvent::getMouseWheelEvent( qevent ); 00056 } 00057 00063 static SoLocation2Event* 00064 getMouseMoveEvent( QMouseEvent* qevent, QWidget* widget ) 00065 { 00066 return QtEventToSoEvent::getMouseMoveEvent( qevent, QPoint( qevent->x() * widget->devicePixelRatio(), 00067 ( ( widget->height() - 1 ) - qevent->y() ) * widget->devicePixelRatio() ) ); 00068 } 00069 00073 static SoLocation2Event* 00074 getMouseEnterEvent( QEvent*, QWidget* ) 00075 { 00076 return QtEventToSoEvent::getMouseEnterEvent(); 00077 } 00078 00082 static SoLocation2Event* 00083 getMouseLeaveEvent( QEvent*, QWidget* ) 00084 { 00085 return QtEventToSoEvent::getMouseLeaveEvent(); 00086 } 00087 00092 static SoKeyboardEvent* 00093 getKeyPressEvent( QKeyEvent* qevent ) 00094 { 00095 return QtEventToSoEvent::getKeyPressEvent( qevent ); 00096 } 00097 00102 static SoKeyboardEvent* 00103 getKeyReleaseEvent( QKeyEvent* qevent ) 00104 { 00105 return QtEventToSoEvent::getKeyReleaseEvent( qevent ); 00106 } 00107 00113 const std::vector<const SoEvent*>& 00114 getTouchEvents( QTouchEvent* qevent, QWidget* widget ) 00115 { 00116 return QtEventToSoEvent::getTouchEvents( qevent, widget->height() ); 00117 } 00118 }; 00119