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

TestCase mouseClick() doesn't work properly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Component/s: Testing: QuickTest
    • Labels:
      None
    • Platform/s:
      Linux/Wayland

      Description

      Hello,

       

      The following code snippet is chowing  the bug : when raising the `TestCase` mouseClick() method, nothing is printed, but when raising the button `clicked` method, "button clicked" is printed.

       

      This seems to be the same with the `TestCase` mouseWheel() method.

      // code placeholder
      import QtQuick 2.0
      import QtTest 1.0
      import QtQuick.Controls 2.0
      
      TestCase { 
         id: root 
         name: "ClickTest" 
         when: windowShown  
      
         property Component component_button: Button { 
                              onClicked: print("button clicked") 
                              }  
      
      
         function test_button() {  
           var item = createTemporaryObject(component_button, root);
           // here, the print is not working
           mouseClick(item, item.width/2, item.height/2);  
      
           // here, the print is working
           item.clicked(); 
           } 
      }  
      

       

        Attachments

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            dutoitm Marie Dutoit
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes