Skip to content
  • 0 Votes
    10 Posts
    4k Views
    X

    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.

  • 0 Votes
    2 Posts
    3k Views
    SGaistS

    Hi,

    Sounds like you may have found a regression. You should take a look at the bug report system to see if it's something known. If not please consider opening a new report providing a minimal compilable example showing the behavior

  • 0 Votes
    6 Posts
    5k Views
    R

    There is a static function of QWidget that will create a container widget with a QWindow as a parent.
    QWidget* QWidget::createWindowContainer(QWindow *,...)

    Once you have the widget container this can be the parent of any other dialogs or widgets you need to add.