PDA

View Full Version : Problem with Signals and Slots



Nayrb
17th April 2012, 07:41
I know that I can only connect signals and slots between objects. I encounter this situation where I reimplement the mouseReleaseEvent of a QGraphicsLineItem object (e.g. myCable Class, cable object) and I wish to connect it to a QGraphicsScene object (e.g. myScene Class, scene object) but the object for myCable class was created in the scene.

Can someone give me some advice, I think I might have done something wrong here.

dennis81
17th April 2012, 09:45
declare your own signal, connect it to your object and emit it where ever you want.

Make sure that your emitting object is subclassed from QObject.