Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. gestures
    Log in to post

    • SOLVED Cross Swipe Screens
      QML and Qt Quick • qml qt4.8 gestures • • Matheus da Silva Ribeiro  

      4
      0
      Votes
      4
      Posts
      133
      Views

      @Matheus-da-Silva-Ribeiro Please mark your answer as "Correct Answer" to change title to "Solved".
    • UNSOLVED Zoom in and out of a QTextEdit with touch pad gestures?
      General and Desktop • qtextedit zoom gestures gesture • • legitnameyo  

      13
      0
      Votes
      13
      Posts
      1186
      Views

      The following partially works and I post in the hopes that someone might get an idea that will fix my issue :) bool ZoomCode::event(QEvent *event) { if (event->type() == QEvent::NativeGesture) { return gestureEvent(static_cast<QNativeGestureEvent*>(event)); } return QWidget::event(event); } bool ZoomCode::gestureEvent(QNativeGestureEvent *e) { float value = e->value(); textEdit->setFontPointSize(NULL); // zoom does not work without this textEdit->selectAll(); // some part of the text has to be selected before the zoom in the text starts to work. It does NOT matter if it is the WHOLE text or just a character in the text, just as long as something gets highlighted. Afterwards, nothing has to be highlighted again for the zoom to work. The zoom works on the whole text, no matter what part has been highlighted. if(value >0) { zoomIn(value + 5); // + 5 to add some zoom strength } else if(value < 0) zoomOut(value - 5); // -5 to add some zoom strength } }
    • UNSOLVED Looking for C++/Qt Software Engineer to work in Leeds, UK
      Jobs • networking qt c++ gestures voice recogniti multi-touch • • sr_iBT  

      1
      0
      Votes
      1
      Posts
      742
      Views

      No one has replied

    • UNSOLVED Propagate Gestures between different Widgets
      Mobile and Embedded • qml touch gestures • • Aerius  

      1
      0
      Votes
      1
      Posts
      353
      Views

      No one has replied

    • UNSOLVED One Finger Swipe / Gestures
      Mobile and Embedded • c++ android ios gestures • • Aerius  

      8
      1
      Votes
      8
      Posts
      9708
      Views

      @Qt-embedded-developer I'm sorry but I don't remember well... It was long time ago and I ported my app to QML since then. In QML it is much much easier to achieve such things. I tried to dig the old QtWidgets code but I've not found where it was yet.
    • UNSOLVED Qt Swipe Gesture not working
      General and Desktop • gestures gesture swipe qgestureevent • • Jari  

      14
      0
      Votes
      14
      Posts
      10474
      Views

      @QTUserForAndroid This should help to 'mark as solved' and other forum inquiries: https://forum.qt.io/topic/62700/hitchhiker-s-visual-guide-to-the-qt-forum
    • QGestureEvent management
      General and Desktop • qt5.4 gestures swipe qgestureevent • • ilgale  

      1
      0
      Votes
      1
      Posts
      568
      Views

      No one has replied

    • [Solved again] Post a QGestureEvent to a QStateMachine
      General and Desktop • event state machine gestures statemachine postevent • • Malte J  

      8
      0
      Votes
      8
      Posts
      2276
      Views

      Yes that is correct. Every of the 8 custom gestures defines its own set of data in addition to the QGestureState, which is set by the according gesture recognizer. I now implemented an abstract superclass for all these gestures with a method getGestureData(). This method basically wraps all the data in a QMap<QString,QVariant> to make a general gesture treatment possible. The custom event GestureEvent now takes gesture type, the Qt::GestureState and the mentioned gesture data map. It was a little bit circumstantial, but now it works. Thanks again, Malte
    • get Gestures in QWindow
      General and Desktop • qwindow gestures • • Xv1nX  

      10
      0
      Votes
      10
      Posts
      3268
      Views

      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.