I found myself in that position a few months ago. Something like "QObject *sender" to be passed on the slots would save this problem...
As far as I know, Qt does not have such things.
I found myself in that position a few months ago. Something like "QObject *sender" to be passed on the slots would save this problem...
As far as I know, Qt does not have such things.
It does. It's called QObject::sender(). Unfortunately, it would not help here as the OP's sender is always the same object.Originally Posted by elcuco
@burn2themax - Have you considered using a signal multiplexor?
http://doc.trolltech.com/qq/qq08-act...ltiplexer.html
You can use this to exclusively choose the widget you are intrested into to receive your signals. no other widgets will be notified.
Last edited by Chicken Blood Machine; 6th July 2006 at 18:00.
Save yourself some pain. Learn C++ before learning Qt.
But of course it has: QObject::sender()Originally Posted by elcuco
elcuco (6th July 2006)
what do you say... you learn something new each day.
@jacek
I did a sample implementation with QEvent and... it works!! Thanks for this solution!
@Chicken Blood Machine
Thanks for the idea with the multiplexer! Seems to be an interesting concept for having multiple docs.
But in my situation the receiver-widget changes permanently, so I had to call "setCurrentObject" on and on. This produces too much overhead.
Bookmarks