Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88485

DragHandler onActiveChange is not emitted unless the mouse is moved

    XMLWordPrintable

Details

    • Linux/X11

    Description

      • Download the filebrowser example from the https://www.qt.io/blog/custom-window-decorations and https://github.com/johanhelsing/qt-csd-demo
      • add the following to the DragHandler
                            onActiveChanged: if (active) { window.startSystemMove(); }
                                             else { console.log("Move ends"); }
        
      • run the example
      • move it around, stop and release the mouse with out moving
        *Current result: *nothing is printed, only when the mouse is moved
        *Expected result: * the print happens once the mouse is released

      Workaround:

                      DragHandler {
                          id: dh
                          grabPermissions: TapHandler.CanTakeOverFromAnything
                          onActiveChanged: if (!active) { console.log("Move ends"); }
                          onCentroidChanged: {
                              if (active) {
                                  window.x += dh.centroid.position.x - dh.centroid.pressPosition.x;
                                  window.y += dh.centroid.position.y - dh.centroid.pressPosition.y;
                              }
                          }
                      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            karimpinter Karim Pinter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes