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

TestCase mouseClick() doesn't work properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.14.2
    • Testing: QuickTest
    • None
    • 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

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes