Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Direct swipe support for C++ widgets
Forum Updated to NodeBB v4.3 + New Features

Direct swipe support for C++ widgets

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 3.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dpb1956
    wrote on last edited by
    #1

    Does anyone know if C++ widgets for Qt5 directly support touch gestures on mobile devices? I realize they are detected using QScroller, etc. but I would expect they would be directly supported for scroll widgets etc. by simply enabling them. Swipe scrolling is directly and automatically supported for C++ list displays but not when scrolling in text editors, etc. QML controls directly support these gestures but C++ widgets don’t seem to. Is this correct and will they be directly supported at some point if they aren’t?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      QWidgets should support gestures since Qt 4.6.
      you need to call grabGesture() on the widget in order to receive a gesture event:
      @
      widget->grabGesture(Qt::SwipeGesture);
      @

      I don't think that all widgets are implementing gestures correctly by default, e.g. like you said scrolling in text editors. You would have "implement":http://qt-project.org/doc/qt-4.8/gestures-overview.html this yourself. Or use QScroller when possible (in Qt 5).

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dpb1956
        wrote on last edited by
        #3

        Thanks for responding. I had seen this reference but haven’t had luck using it. Will this actually enable Gestures for a widget or just enable the capturing of events? QML allows enabling Gestures very easily and touch scrolling in C++ is automatically supported for menu displays.

        I ran the Gestures example which “enabled” the Gesture commands as given in your reference article but it didn’t work. It just seems that it would be simple to just globally turn on Gestures in C++ since they’re obviously already supported.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved