Hi.
I love signals/slots mechanism, and im afraid that i can overuse it(or maybe i don't understand it : P )
For example, I have 2 objects. First one inherits from QPixmapGraphicsItem , second one is QGraphicsScene. When i click on a QPixmap... object , a want to display it in QGraphicsScene. And i have 2 possible solutions. Use signal/slots mechanism, or simply call a method.

Here is my reimplementation of mousePressEvent

Qt Code:
  1. connect(this,SIGNAL(projectNewPixmapInViewWidget(const QPixmap &)),mediator->getPToCardVDW(),SLOT(setNewPixmap(const QPixmap &))); //necessary or not ?
  2.  
  3. void cCardBase::mousePressEvent(QGraphicsSceneMouseEvent *event)
  4. {
  5. switch(event->button())
  6. {
  7. case Qt::LeftButton :
  8. //Should I emit signal here ?
  9. //emit projectNewPixmapInViewWidget(this->pixmap());
  10. //or simply
  11. //mediator->getPToCardVDW()->setNewPixmap(this->pixmap());
  12. break;
  13. ..............
To copy to clipboard, switch view to plain text mode 

And a slot in QGraphicsScene based object

Qt Code:
  1. card = new QGraphicsPixmapItem(QPixmap(tr("./graphics/misc/empty.jpg")));
  2.  
  3. void cCardViewDockWidget::setNewPixmap(const QPixmap &pixmap)
  4. {
  5. card->setPixmap(pixmap);
  6. }//setNewPixmap()
To copy to clipboard, switch view to plain text mode 

And maybe some pictures








So, in that case should I emit a signal or call a method ^^'

Regards