QWheelEvent on Android
-
I've made an small application on PC and now i'm trying to deploy it on AVD.
The application uses QWheelEvent which does not work in my case (on Andorid only).
How is this event handled on Android and how can i solve this problem? -
Android devices have no (mouse) wheel, so it will never be called I guess. :D
you have to use your own pinch event or something, in my app I implemented the pinch event myself, Qt has no touch gesture events at the moment I think. -
It is obvious that Android devices have no wheel. But how can I use zoom, for example, on Android devices?
-
Did you even read my post? I told you there is no easy way as far as i know :/
you have to implement your own pinch-to-zoom event or whatever you want to zoom it depends on the app, you can also use buttons (+ and -) :DI mean there are Qt classes like QGesture, QGestureEvent and QPinchGesture but I think there is no way as of Qt 5.2.1 or even 5.3 to use it properly? "The API of the gesture framework is not yet finalized and still subject to change."
Best thing i could find http://qt-project.org/doc/qt-5/gestures-overview.html
-
There are quite a few Android PCs available now, using mouse and keyboard, and a mouse or a wireless mouse is used quite often together with an Android Set Top Box connected to a TV.
The mouse wheel is supported in many Android applications, e.g. the browser.
So the wheel exists in Android, and is supported by Android. Android Apps can react on mouse wheel events, see also http://stackoverflow.com/questions/11024809/how-can-my-view-respond-to-a-mousewheelExample Java code from the link above, I guess this could be added to QtActivity:
@@Override
public boolean onGenericMotionEvent(MotionEvent event) {
if (0 != (event.getSource() & InputDevice.SOURCE_CLASS_POINTER)) {
switch (event.getAction()) {
case MotionEvent.ACTION_SCROLL:
if (event.getAxisValue(MotionEvent.AXIS_VSCROLL) < 0.0f)
selectNext()
else
selectPrev();
return true;
}
}
return super.onGenericMotionEvent(event);
}@And IMHO we need the mouse wheel supported in Qt for Android too, of course.