I am using mouse press event and clicked event in button class. How I can notify the parent window about the occurrence of this event.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You just have to connect the signal
clicked()of your button to a slot in your parent class (your question is not so clear).If you want to pass the click coordinates to the parent, connect the
clicked()event to an private slot in your button class, and emit a customclicked(QPoint)signal with the mouse coordinate (mapFromGlobal(QCursor::pos())) as parameter, and connect that signal in a slot in the parent.PS: A mouse press event and a click event are not the same thing: if the mouse moves after the press event but before the release event, this is not a click anymore.