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

  • Home
  • SEARCH
  • 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 3226332
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:26:36+00:00 2026-05-17T16:26:36+00:00

My application consists of a WebView widget. A mouse click on the widget is

  • 0

My application consists of a WebView widget. A mouse click on the widget is not handled by the mousePressEvent() of my application, but by the WebView widget. So, I installed an event filter to receive the events. Now, I get notified of all events, except the mouseReleaseEvent for the right click (Everything works fine for left clicks and mousePressEvent for the right click is also getting registered). I guess it has got something to do with context events getting generated by right clicks (a pop-up menu gets generated). But since I am using a filter, the event should first be sent to me. The following is the code for the event filter
in Jambi, but I hope I can modify an answer given in Qt for Jambi.

public boolean eventFilter(QObject o,QEvent event)
 {
  if (event.type()==QEvent.Type.MouseButtonPress)   // One can call the mousePressEvent() functions from here,which can do this work but speed
  {
   if (((QMouseEvent)event).button()==Qt.MouseButton.LeftButton)
   {
    mousebuttontype=1;
    clickedorpressed=1;
   }
   else
   if (((QMouseEvent)event).button()==Qt.MouseButton.RightButton)
   {
    mousebuttontype=2;
    System.out.println("right");
   }
   t1=QTime.currentTime();
   t1.start();
  }
  else
  if (event.type()==QEvent.Type.MouseButtonRelease)
  {
   if (t1.elapsed()>900)
   {
    switch(mousebuttontype)
    {
     case 1: browser.back();
      break;
     case 2: browser.forward();
      break;
    } 
   }System.out.println("choda");
  } 

  return false;
 }

MY BASIC AIM IS GETTING THE TIME INTERVAL FOR WHICH THE RIGHT CLICK WAS PRESSED. ANY WORKAROUND ?

  • 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-17T16:26:37+00:00Added an answer on May 17, 2026 at 4:26 pm

    Some digging around certainly seems to suggest that there may be no right-mouse release event being generated if that is the trigger for a context menu on your particular system. These are conveyed as a QContextMenuEvent.

    This Qt Labs post hints about this too.

    A work around may be tricky if it is system dependent. Have you tried overriding event() in the QApplication class to see if the event comes through there? Some events don’t necessarily get to the children but everything goes through QApplication::event().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Application able to record error in OnError, but we are not able to do
I am writing a simple Python web application that consists of several pages of
Currently i am working on a desktop application which consists mathematical analysiss.I am using
I am working on localization for a asp.net application that consists of several projects.
I am in the process of developing a web application that consists visually of
There is an application with an extensive object graph. This graph mainly consists of
I am working on a .NET 3.5 project which consists of a web application
I have a solution that is deployed using ClickOnce. It consists of an application,
My application consists of a UIImageView inside a UIScrollView , and I display a
My application consists of a VB6 DLL that is called from ASP. It needs

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.