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

MouseArea should ignore cursorShape if enabled:false

    XMLWordPrintable

Details

    • All

    Description

      My suggestion is that if the MouseArea has enabled:false, then its cursorShape value should be ignored.

      Take the case of a MouseArea that's created to make a UI element clickable. Naturally you'd set cursorShape to Qt.PointingHandCursor to indicate this.

      Now take the case where this UI element needs to appear disabled. Here the MouseArea should not be operational, so it makes sense to set enabled:false and this would stop it being clickable. However the cursorShape remains enabled as Qt.PointingHandCursor, which is misleading in the UI.

      To get the expected behaviour, either we need to use Loader or some other way to selectively create the MouseArea only when the UI element is not shown as disabled, or we need to apply conditional logic to the cursorShape and the click event handlers, both of which are messy and unintuitive.

      I accept this would be a change of longstanding logic. If this is too controversial, my workaround request would be to make the cursorShape behaviour explicit in the documentation.

      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
            paulmasri Paul
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes