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

containsMouse property not updated when switching tabs in TabView programmatically

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.2.0, 5.2.1
    • None

      When switching to a new Tab of the TabView, the containsMouse property of a child mouseArea is not updated initially. You have to move the mouse in order to update the flag. The following code will reproduce the problem.

      import QtQuick 2.2
      import QtQuick.Controls 1.1
      import QtTest 1.0
      
      Item{
          id: root
          width: 256
          height: 256
      
          TabView {
              id: tabView
              anchors.fill: parent
              Tab {}
              Tab {
                  id: tab2
                  MouseArea {
                      hoverEnabled: true
                  }
              }
          }
      
          TestCase {
              when: windowShown
      
              function test_containsMouse() {
                  mouseMove(root, 128, 128);
      
                  tabView.currentIndex = 1;
                  // bug: tab2 is shown, but containsMouse is not updated
                  verify(!tab2.item.containsMouse); // <- BUG: passes, but should fail!
      
                  // only after moving the mouse, containsMouse is updated
                  mouseMove(root, 129, 128);
                  verify(tab2.item.containsMouse);
              }
          }
      }
      

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

            Unassigned Unassigned
            che Carsten Henßinger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes