![]() On windows a wheel event is sent with “(event->modifiers() & Qt::ControlModifier) = true”.The zoom gesture with two fingers i had to handle differently on Mac and Windows: I now use Ctrl/Shift for mouse wheel zoom. I originally wanted to use the Mouse Wheel always for Zoom AND use the Touch Pads Pan gesture. It seems impossible to distinguish between a gesture event on the track pad and a real wheel event on the mouse. ![]() Most of this (i.e panning) is handled quite well by Qt, but not all: This seems strange to me, as there is no Mouse with a horizontal Wheel.Įven more confusing, by MS definition Pan events are converted to WM_VSCROLL/WM_HSCROLL events ( ) Pan Gestures (in Qt) are converted to Mouse Wheel messages which can have a y and also a x offset. MyGraphicsView::MyGraphicsView(.) : QGraphicsView()įor(Qt::GestureType gesture : sgGestureTypes)īool MyGraphicsView::event(QEvent *event)įor (Qt::GestureType gesture : sgGestureTypes) Viewport()->setAttribute(Qt::WA_AcceptTouchEvents) īool MyGraphicsView::viewportEvent ( QEvent * event ) Finger Scrolling in QGraphicsView in QT?ġ) MyGraphicsView::MyGraphicsView(.) : QGraphicsView().I found a number of questions and some fragmentary samples. Zooming in/out works fine, but using 2 fingers for panning always results in zoom out. I have a Qt 6.2 Application (Windows/Mac) using QGraphicsScene and want to use 2 fingers on the touch pad of my laptop for panning - as many other applications do.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |