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

MouseArea::hoverEnabled property unexpectedly propagated to child Controls.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.0
    • Quick: Controls 2
    • None

    Description

      When nesting a Control inside a MouseArea, the Control's hoverEnabled property is, I believe, erroneously disabled, while by default it should be enabled due to the style hints.

      Window {
        visible: true
        MouseArea {
          anchors.fill: parent
          ComboBox {
            id: control
            model: ["broken1", "broken2", "broken3"]
          }
        }
        ComboBox {
          id: ctrl2
          y: 30
          model: ["working1", "working2", "working3"]
        }
      }
      

      In this example, hover events are not delivered to the top most combobox. Setting either the MouseArea's hoverEnabled, or the ComboBox's hoverEnabled to true works around the problem.

      For reasons beyond my understanding, QQuickControl::calcHoverEnabled() reads the unrelated hoverEnabled property from QQuickMouseArea.

      The doc says that Control::hoverEnabled is only propagated when set on a Control. MouseArea is not a Control.

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            pdegoeje Pieter de Goeje
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change