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. Flickable.pressDelay does not work on Android Mobile but works on Desktop [with small code example to reproduce]
Forum Updated to NodeBB v4.3 + New Features

Flickable.pressDelay does not work on Android Mobile but works on Desktop [with small code example to reproduce]

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
c++ qml mobile
5 Posts 2 Posters 334 Views
  • 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.
  • W Offline
    W Offline
    werto87
    wrote on last edited by werto87
    #1

    Hi, i am developing an application with multi selection drag and drop.

    desired behavior:

    • select items for draging by tapping on the items
    • flicking by preform the flicking scrolling gesture
    • start with dragging after the user preforms presses on an item (i use ListView.pressDelay: 300 for this)

    This works for Desktop but on my Android mobile the dragging does not start if i set ListView.pressDelay: to 300.
    If I set ListView.pressDelay: to 30 its the same as if I set a value to ListView.pressDelay 300.
    If I set ListView.pressDelay: to 3. Dragging starts when i try to flick.

    Note: I get this Log message on my android mobile after trying to drag with ListView.pressDelay: to 300

    • W libuntitled27_armeabi-v7a.so: QMetaObject::invokeMethod: No such method AbstractButton_QMLTYPE_1::inputMethodQuery(Qt::InputMethodQuery,QVariant)

    code is on github: "https://github.com/werto87/qt_projects" branch: "list_view_model_cxx"

    short example for reproducing:
    import QtQuick 2.14
    import QtQuick.Controls 2.14
    import QtQuick.Layouts 1.14
    import QtQml.Models 2.14

    ApplicationWindow {
    id: root
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    ColumnLayout {
        anchors.fill: parent
        ListView {
            spacing: 5
            pressDelay: 300
            id: listView
            Layout.fillHeight: true
            Layout.fillWidth: true
            model: model
            delegate: AbstractButton {
                width: root.width
                height: 75
                id: delegate
                background: Rectangle {
                    color: "#9dbad5"
                }
            }
        }
    }
    Rectangle {
        //should be moveable pressDelay: 300
        visible: dragHandler.active
        id: rectangleToMove
        Drag.active: dragHandler.active
        width: 100
        height: 100
        color: "brown"
    }
    
    DragHandler {
        id: dragHandler
        xAxis.enabled: false
        target: rectangleToMove
        Drag.onDragStarted: {
            console.log("starting drag")
        }
    }
    
    ListModel {
        //just a model with some elements
        id: model
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
        ListElement {}
    }
    

    }

    edit: added example for easy reproducing
    edit2: added log message

    M 1 Reply Last reply
    0
    • W werto87

      Hi, i am developing an application with multi selection drag and drop.

      desired behavior:

      • select items for draging by tapping on the items
      • flicking by preform the flicking scrolling gesture
      • start with dragging after the user preforms presses on an item (i use ListView.pressDelay: 300 for this)

      This works for Desktop but on my Android mobile the dragging does not start if i set ListView.pressDelay: to 300.
      If I set ListView.pressDelay: to 30 its the same as if I set a value to ListView.pressDelay 300.
      If I set ListView.pressDelay: to 3. Dragging starts when i try to flick.

      Note: I get this Log message on my android mobile after trying to drag with ListView.pressDelay: to 300

      • W libuntitled27_armeabi-v7a.so: QMetaObject::invokeMethod: No such method AbstractButton_QMLTYPE_1::inputMethodQuery(Qt::InputMethodQuery,QVariant)

      code is on github: "https://github.com/werto87/qt_projects" branch: "list_view_model_cxx"

      short example for reproducing:
      import QtQuick 2.14
      import QtQuick.Controls 2.14
      import QtQuick.Layouts 1.14
      import QtQml.Models 2.14

      ApplicationWindow {
      id: root
      visible: true
      width: 640
      height: 480
      title: qsTr("Hello World")

      ColumnLayout {
          anchors.fill: parent
          ListView {
              spacing: 5
              pressDelay: 300
              id: listView
              Layout.fillHeight: true
              Layout.fillWidth: true
              model: model
              delegate: AbstractButton {
                  width: root.width
                  height: 75
                  id: delegate
                  background: Rectangle {
                      color: "#9dbad5"
                  }
              }
          }
      }
      Rectangle {
          //should be moveable pressDelay: 300
          visible: dragHandler.active
          id: rectangleToMove
          Drag.active: dragHandler.active
          width: 100
          height: 100
          color: "brown"
      }
      
      DragHandler {
          id: dragHandler
          xAxis.enabled: false
          target: rectangleToMove
          Drag.onDragStarted: {
              console.log("starting drag")
          }
      }
      
      ListModel {
          //just a model with some elements
          id: model
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
          ListElement {}
      }
      

      }

      edit: added example for easy reproducing
      edit2: added log message

      M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      This might be related to mouse messages in Android having been broken in some Qt 5.12 version and not (AFIK) fixed since. You could verify this with Qt 5.11.3 and after that perhaps figure out a workaround.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        werto87
        wrote on last edited by werto87
        #3

        Thank you mvuori, i will try it out.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          werto87
          wrote on last edited by werto87
          #4
          • Setting the Qt Version to .11 is no solution for me because i want to use DragHandler (DragHandler is from Qt 5.12 i think?).
          • Installing qt 5.14 did not help.
          • getting arm version 8 did not help

          I noticed a log when trying to drag and drop on android:

          W MY_APP_NAME_armeabi-v7a.so: QMetaObject::invokeMethod: No such method QQuickContentItem::inputMethodQuery(Qt::InputMethodQuery,QVariant)

          I will try to get version 8

          edit: getting version 8 did not help

          1 Reply Last reply
          0
          • W Offline
            W Offline
            werto87
            wrote on last edited by
            #5

            added small example code to reproduce the problem

            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