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

MouseArea signal handlers break when running successive QML tests

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 5.11.0
    • 5.3.0
    • None
    • Linux

    Description

      The was discovered in Qt Location tests. I have attached minimal example.

      Test setup is a single test binary which runs two QML tests. Running the tests individually works as expected:

      ./declarative_ui First::test_spy
      ./declarative_ui Second::test_spy

      Running both tests fails:

      ./declarative_ui

      The failure is that the mouse parameter of the MouseArea::onClicked handler cannot be found. The following message is printed on the console:

      QDEBUG : declarative_ui::Second::test_spy() arguments[0] is QQuickMouseEvent(0x7fff4299fd20)
      QWARN : declarative_ui::Second::test_spy() file:///home/amccarthy/depot/qt5/qtlocation/tests/auto/declarative_ui/tst_second.qml:24: ReferenceError: mouse is not defined

      Note that the argument is still available in the JavaScript arguments list as shown in the QDEBUG line above. It is the named parameter of the signal handler that fails to resolve.

      The cause is the SignalSpy object in the first test. After commenting out the SignalSpy (and the compare) in tst_first.qml both tests pass. This test uses the QUICK_TEST_MAIN which reuses a single QQuickView for all run tests.

      The same behaviour happens for other MouseArea signals with the same signature.

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            amccarthy Aaron McCarthy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes