[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] understanding SIGNALS and SLOTS
From:       "Christopher M. Nahler" <christopher.nahler () papermodels ! at>
Date:       2010-05-27 13:02:51
Message-ID: 4BFE6D7B.8000505 () papermodels ! at
[Download RAW message or body]

I have worked with shortcut signals so far. The way I used this was to
self.emit(SIGNAL("someText"), variable)
and to use this variable by
self.connect(sending.object, SIGNAL("someText"), some.function)
where some.function has an argument which it can then use.

Now I would like to use the position of an graphicsItem in one scene to 
drive/update the position of another graphicsItem in another scene. More 
specific: I have 3 scenes (top, front, side). When I move a bar 
(rectangle) in the groundScene it should update a bar/rectangle in 
another scene.

What is the best way to do this?

Now I have a MyData class object that holds the positions and that is 
pointed to in each scene. But I would like it to work with setValue(int) 
and valueChanged(int) signals and slots. Is this only possible for 
predefined QT code or can this be added like this in Python?

Also what confuses me is that graphicsItems cannot emit (if I understand 
correctly). Do I have to wrap them in an own QObject derived class 
object and do the signaling there?

Any tips and pointers are much appreciated
Chris
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic