I found out the solution using native Windows Gestures WM_Gesture.
By default QT registers QMainWindow-Window as a Touch Window, so the QMainWindow-App only get WM_Touch events.
As said above one can only get either WM_Touch event or WM_Gesture event. So you have to unregister the window from getting Touch event. I do that in the constructor like this:
HWND myHwnd = reinterpret_cast<HWND>(this->winId());
PULONG flag = 0;
bool istouch = IsTouchWindow(myHwnd,flag);
if(istouch)
UnregisterTouchWindow(myHwnd);
now i get WM_Gesture events in nativeEvent:
bool OpenGLWindow::nativeEvent(const QByteArray & eventType, void* message, long* result)
{
MSG* msg = reinterpret_cast<MSG*>(message);
switch(msg->message){
case WM_GESTURE:
case WM_GESTURENOTIFY:
emit sendNativeEvent(eventType, message, result);
break;
}
return false;
}
Thanks for your help.