Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Change pressAndHold Timeout

Change pressAndHold Timeout

Scheduled Pinned Locked Moved QML and Qt Quick
10 Posts 4 Posters 3.6k 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.
  • S Offline
    S Offline
    Schneidi
    wrote on last edited by
    #1

    Hi,

    i use the MouseAreas pressAndHold signal alot for drag and drop purposes.
    The docs say that the timerout is currently set to 800 ms. But i couldn't find a way to
    change the time after that the signal is emitted.

    Is there a way to change that ?

    Because if you have a lot of drag and drop going on the timeout seems a bit anoying.

    Thanks guys.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dasRicardo
      wrote on last edited by
      #2

      You implement drag and drop by your own? Why you don't use drag property? Or is there also a timeout to start the drag?

      **Sorry for my english :)

      PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Schneidi
        wrote on last edited by
        #3

        I had to implement it by my own because of my application structure.
        I couldn't just drag an object around because I had to drop it to completely different object structures. Thats why i instantiate dedicated drag objects.

        Its a bit tricky to explain.

        So I used the pressAndHold signal to create a new draggable object.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dasRicardo
          wrote on last edited by
          #4

          Hmmm, ok and what if you implement this also by your own? With pressed signal start a timer, with released stop it. And if the timer has a value that you like, send your own signal?

          **Sorry for my english :)

          PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Schneidi
            wrote on last edited by
            #5

            ok that is one way to do it. so if there is no way to just change the timeout i could go to every part for the drag and drop handling and do it all by hand.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              From a quick look at the source code, it seems to be a hardcoded value

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dasRicardo
                wrote on last edited by
                #7

                Where i can find the source? Sorry but every time i google for MouseArea only found examples but not the source itself.

                **Sorry for my english :)

                PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

                1 Reply Last reply
                0
                • p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #8

                  Seems already requested. Check "this":https://bugreports.qt-project.org/browse/QTBUG-24793

                  157

                  1 Reply Last reply
                  0
                  • p3c0P Offline
                    p3c0P Offline
                    p3c0
                    Moderators
                    wrote on last edited by
                    #9

                    bq. Where i can find the source?

                    If you have source installed, goto <QtDir>/5.3/Src/qtbase/src/gui/kernel/qplatformtheme.cpp and check QPlatformTheme::defaultThemeHint(ThemeHint hint)

                    157

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Schneidi
                      wrote on last edited by
                      #10

                      Thanks SGaist,

                      you're right its still hard coded.

                      case MousePressAndHoldInterval:
                          return QVariant(800);
                      

                      It would be nice if we were be to customize these settings in a future release.
                      Because they have a huge impact on the user experience.

                      To bad that this can't be overwritten.
                      Guess i have to wait for a user response to decide whether or not i'm going to implement this all by myself.

                      Thanks guys.

                      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