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
connect(this,
SIGNAL(projectNewPixmapInViewWidget
(const QPixmap &)),mediator
->getPToCardVDW
(),
SLOT(setNewPixmap
(const QPixmap &)));
//necessary or not ?
{
switch(event->button())
{
case Qt::LeftButton :
//Should I emit signal here ?
//emit projectNewPixmapInViewWidget(this->pixmap());
//or simply
//mediator->getPToCardVDW()->setNewPixmap(this->pixmap());
break;
..............
connect(this,SIGNAL(projectNewPixmapInViewWidget(const QPixmap &)),mediator->getPToCardVDW(),SLOT(setNewPixmap(const QPixmap &))); //necessary or not ?
void cCardBase::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
switch(event->button())
{
case Qt::LeftButton :
//Should I emit signal here ?
//emit projectNewPixmapInViewWidget(this->pixmap());
//or simply
//mediator->getPToCardVDW()->setNewPixmap(this->pixmap());
break;
..............
To copy to clipboard, switch view to plain text mode
And a slot in QGraphicsScene based object
void cCardViewDockWidget
::setNewPixmap(const QPixmap &pixmap
) {
card->setPixmap(pixmap);
}//setNewPixmap()
card = new QGraphicsPixmapItem(QPixmap(tr("./graphics/misc/empty.jpg")));
void cCardViewDockWidget::setNewPixmap(const QPixmap &pixmap)
{
card->setPixmap(pixmap);
}//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
Bookmarks