I have a QGraphicsView and want to detect user clicks, but i have a problem, clickng the scrollbars also emit the click signal. How could i avoid the signal when scrollbars are clicked?

thsi is my code:
Qt Code:
  1. rs_Graphicsview::rs_Graphicsview(QWidget *parent) :
  2. QGraphicsView(parent)
  3. {
  4. installEventFilter(this);
  5. }
  6.  
  7.  
  8. bool rs_Graphicsview::eventFilter(QObject *obj, QEvent *evnt) {
  9. if (evnt->type() == QEvent::MouseButtonPress) {
  10. emit clicked();
  11.  
  12. }
  13. return QObject::eventFilter(obj, evnt);
  14. }
To copy to clipboard, switch view to plain text mode