开发者

how to convert mouse move event into mouse scroll/drag event

开发者 https://www.devze.com 2023-03-31 14:08 出处:网络
My app requires me to use multiple mouse and when user moves a parti开发者_运维问答cular mouse then OS should give back the mouse drag/scroll event. I want to implement this using Qt 4.6. What you cou

My app requires me to use multiple mouse and when user moves a parti开发者_运维问答cular mouse then OS should give back the mouse drag/scroll event. I want to implement this using Qt 4.6.


What you could do is

QWidget::setMouseTracking ( true );

that should invoke QWidget::mouseMoveEvent ( QMouseEvent * event ) whenever your mouse moves

then you can handle the event as you want.

If you are looking for general drag event then Qt already handles mouse events QWidget::dragEnterEvent ( QDragEnterEvent * event ) http://doc.qt.nokia.com/latest/qwidget.html#dragEnterEvent

0

精彩评论

暂无评论...
验证码 换一张
取 消