title: Qt: get mouse pressed event even if a button is pressed
body: <p>I need to simply detect when the right button is pressed or released in my Qt5/C++ application every moment.</p>
  
  <p>So far I have coded these functions:</p>
  
  <pre><code>void test::mousePressEvent(QMouseEvent *ev){
      if(ev-&gt;buttons() == Qt::LeftButton){
          qDebug() &lt;&lt; "Left pressed";
          ui-&gt;forceBar-&gt;setValue( 100 );
      }
  
  }
  
  void test::mouseReleaseEvent(QMouseEvent *ev){
      if(ev-&gt;button() == Qt::LeftButton){
          ui-&gt;forceBar-&gt;setValue( 50 );
          qDebug() &lt;&lt; "Left released";
      }
  </code></pre>
  
  <p>They work fine only if the click is not on a <code>pushbuttontest</code>.
  The problem is that if the click happens on a pushbutton, I don't get the event.</p>