Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7010827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:02:57+00:00 2026-05-27T22:02:57+00:00

I need to send a Mouse event to a QML object, from QML. For

  • 0

I need to send a Mouse event to a QML object, from QML. For example,

Rectangle
{
  id: rect
  MouseArea
  {
    anchors.fill: parent
    onClicked: console.log(mouse.x + ', ' + mouse.y)
  }

  Rectangle
  {
    x: 0; y: 0; width: 50; height: 50
    color: 'red'
    onClicked: rect.click(randomX(), randomY())  // <---- HERE
  }
}

I’d like the line marked “HERE” to cause a click event for rect which would be passed down to the MouseArea.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:02:58+00:00Added an answer on May 27, 2026 at 10:02 pm

    There seems to be some relation between your question and this question

    Please take a look.

    import QtQuick 1.0
    
    Rectangle {
           width: 360
           height: 360
    
           MouseArea {
                   anchors {fill: parent; margins: 40}
                   onClicked: console.log("hello from below");
           }
    
           MouseArea {
                   id: mouseArea
                   anchors.fill: parent
    
                   onClicked: {
                           console.log("hello from top")
                           forwardEvent(mouse, "clicked");
                   }
    
                   function forwardEvent(event, eventType) {
                           mouseArea.visible = false
                           var item = parent.childAt(event.x, event.y)
                           mouseArea.visible = true
                           if (item && item != mouseArea && typeof(item[eventType]) == "function") {
                                   item[eventType](event);
                           }
                   }
           }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need send certain attributes(say, human readable user name) from server to client after
I need to send emails to a list of IDs from the contact application,
We need to send uploaded files from our CMS website to any antivirus product
How use submit and ajax functions on click event? I need send input hidden
I need to send global keystrokes and mouse events to another application, which is
I have a need to send messages (requests from the User to the Engine,
Need to send and receive a SOAP message in the following format from a
Need to send the event information to the users facebook profile, using jquery or
I need to send e-mails from a servlet running within Tomcat. I'll always send
I need to send some pretty long strings from a flash application to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.