title: Pyqt Mouse MouseButtonDblClick event
body: <p>I have some trouble to distinguish between a single and a double mouse click event. I have created an event filter but a mouse double click also gives me a single signal back. In my code I have to separate both events to connect to different functions. Can anybody suggest me how to do this?</p>
  
  <p>Here is an example. What I want is, if a double mouse click happen, only the MouseButtonDblClick should give a signal and not the LeftButton and MouseButtonDblClick:</p>
  
  <pre><code>    # coding: utf-8
      import sys
  
      from PyQt4 import QtCore, QtGui
  
  
      class MyDialog(QtGui.QDialog):
          def __init__(self, parent=None):
              super(MyDialog, self).__init__(parent)
  
              self.button1 = QtGui.QPushButton("Button 1")
              self.button2 = QtGui.QPushButton("Button 2")
  
              hbox = QtGui.QHBoxLayout()
              hbox.addWidget(self.button1)
              hbox.addWidget(self.button2)
              self.setLayout(hbox)
  
              self.button1.installEventFilter(self)
  
          def eventFilter(self, obj, event):
  
              if event.type() == QtCore.QEvent.MouseButtonPress:
                  if event.button() == QtCore.Qt.LeftButton:
                      #If image is left clicked, display a red bar.
                      print 'one left'
                  elif event.button() == QtCore.Qt.RightButton:
                      print 'one right'
              elif event.type() == QtCore.QEvent.MouseButtonDblClick:
                  #If image is double clicked, remove bar.
                  print 'two'
  
              return super(MyDialog, self).eventFilter(obj, event)
  
  
      if __name__ == '__main__':
          app = QtGui.QApplication(sys.argv)
          w = MyDialog()
          w.show()
          sys.exit(app.exec_())
  </code></pre>
  
  <p>Thank you in advance!</p>
  
  <p>Stefanie</p>