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

MouseArea gets an extra onClicked when double clicking

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.1
    • 4.7.0
    • None
    • Git version of Qt from 2010-07-15.
    • ca36badc8925788e06910fab5200633d40e0f328

    Description

      A MouseArea that looks like:

      MouseArea {
      onClicked: {
      }

      onDoubleClicked: {
      }
      }

      All code left out. The desired action when the user double clicks something is that onClicked would be called once and then at the second click onDoubleClicked would be called and that's it.

      What actually happens is onClicked, onDoubleClicked, onClicked. The final onClicked makes for instance selection logic very hard to get right and likely should not be called at all.

      Log from #qt-qml

      [17:01] <chakie> handling selection in a GridView is painful
      [17:02] <chakie> i want single click to select/deselect and double click to launch something
      [17:02] <chakie> as is normal in any app
      [17:03] <chakie> whatever i do, my onDoubleClick ends up with the item launched fine, but always deselected
      [17:04] <chakie> what happens is that first onClicked is called, then onDoubleClicked for the second click and finally onClicked again for the second click
      [17:04] <chakie> that is imho wrong
      [17:05] <chakie> either the order must be different or the second onClicked should not be called, it's not a normal click at that point but a double click
      [17:05] <chakie> i realize that double clicks are not a priority for mobile stuff, that's likely why this bug has slipped through
      [17:06] <moew> I think only onDoubleClicked should be called on actual double click
      [17:07] <chakie> well. the first onClicked i can understand
      [17:07] <chakie> or then there must be a delay before it's delivered so that qt is sure there's no second click

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            chakie Jan Ekholm
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes