Hi guys.

I'm with a problem when using signal and slots in PyQt.
Actualy I can't connec the signal with the slot. I ever got the message:

Qt Code:
  1. Object::connect: No such slot Main::mousePress(QMouseEvent,int,int)
  2. Object::connect: (receiver name: 'MainWindow')
  3. Object::connect: No such slot Main::mouseMove(QMouseEvent,int,int)
  4. Object::connect: (receiver name: 'MainWindow')
  5. Object::connect: No such slot Main::mouseRelease(QMouseEvent,int,int)
  6. Object::connect: (receiver name: 'MainWindow')
To copy to clipboard, switch view to plain text mode 

Look, some parts.
I have an QGraphicsView sub-class that emit signals of mouseMove, mousePress and mouseRelease:
Qt Code:
  1. def mousePressEvent(self, event):
  2. # emitir o sinal
  3. self.emit(SIGNAL('mousePressEvent(int, int, QMouseEvent)'),
  4. event.pos().x(), event.pos().y(), event)
  5.  
  6. def mouseMoveEvent(self, event):
  7. # emitir o sinal
  8. self.emit(SIGNAL('mouseMoveEvent(int, int, QMouseEvent)'),
  9. event.pos().x(), event.pos().y(), event)
  10.  
  11. def mouseReleaseEvent(self, event):
  12. self.emit(SIGNAL('mouseReleaseEvent(int, int, QMouseEvent)'),
  13. event.pos().x(), event.pos().y(), event)
To copy to clipboard, switch view to plain text mode 


And, in other class that implements the QGraphicsView sub class, I get the signals:

Qt Code:
  1. self.connect(
  2. self.view, SIGNAL('mousePressEvent(QMouseEvent, int, int)'),
  3. self, SLOT('mousePress(QMouseEvent, int, int)'))
  4. self.connect(
  5. self.view, SIGNAL('mouseMoveEvent(QMouseEvent, int, int)'),
  6. self, SLOT('mouseMove(QMouseEvent, int, int)'))
  7.  
  8. self.connect(
  9. self.view, SIGNAL('mouseReleaseEvent(QMouseEvent, int, int)'),
  10. self, SLOT('mouseRelease(QMouseEvent, int, int)'))
  11.  
  12. ...
  13.  
  14. @pyqtSlot(QMouseEvent, int, int)
  15. def mousePress(self, event, x, y):
  16. if (self.desLinha):
  17. self.inicio = self.fim = self.view.mapToScene(QPoint(x,y));
  18. self.linha = QGraphicsLineItem(QLineF(self.inicio, self.fim))
  19. self.linha.setFlags(QGraphicsItem.ItemIsMovable)
  20. print "%dx %dy" % (x, y)
  21.  
  22. self.cena.addItem(self.linha)
  23.  
  24. QGraphicsView.mousePressEvent(event)
  25.  
  26. @pyqtSlot(QMouseEvent, int, int)
  27. def mouseMove(self, event, x, y):
  28. if (self.desLinha):
  29. self.fim = self.view.mapToScene(QPoint(x,y))
  30. self.linha.setLine(QLineF(self.inicio, self.fim))
  31.  
  32. QGraphicsView.mouseMoveEvent(event)
  33.  
  34. @pyqtSlot(QMouseEvent, int, int)
  35. def mouseRelease(self, event, x, y):
  36. if (self.desLinha):
  37. self.fim = self.view.mapToScene(QPoint(x,y))
  38. self.linha.setLine(QLineF(self.inicio, self.fim))
  39.  
  40. QGraphicsView.mouseReleaseEvent(event)
To copy to clipboard, switch view to plain text mode 

How I said before, I'm ever getting the same error que I posted firstly.