Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. gestures

    Log in to post
    • All categories
    • Matheus da Silva Ribeiro

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

      4
      0
      Votes
      4
      Posts
      194
      Views

      M

      @Matheus-da-Silva-Ribeiro Please mark your answer as "Correct Answer" to change title to "Solved".

    • L

      Unsolved Zoom in and out of a QTextEdit with touch pad gestures?
      General and Desktop • zoom qtextedit gesture gestures • • legitnameyo

      13
      0
      Votes
      13
      Posts
      1457
      Views

      L

      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 } }
    • S

      Unsolved Looking for C++/Qt Software Engineer to work in Leeds, UK
      Jobs • qt c++ networking multi-touch voice recogniti gestures • • sr_iBT

      1
      0
      Votes
      1
      Posts
      787
      Views

      No one has replied

    • A

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

      1
      0
      Votes
      1
      Posts
      385
      Views

      No one has replied

    • A

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

      8
      1
      Votes
      8
      Posts
      10106
      Views

      SeeLook

      @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.

    • J

      Unsolved Qt Swipe Gesture not working
      General and Desktop • swipe gesture gestures qgestureevent • • Jari

      14
      0
      Votes
      14
      Posts
      10859
      Views

      C

      @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

    • I

      QGestureEvent management
      General and Desktop • qt5.4 gestures qgestureevent swipe • • ilgale

      1
      0
      Votes
      1
      Posts
      620
      Views

      No one has replied

    • M

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

      8
      0
      Votes
      8
      Posts
      2323
      Views

      M

      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

    • X

      get Gestures in QWindow
      General and Desktop • qwindow gestures • • Xv1nX

      10
      0
      Votes
      10
      Posts
      3371
      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.