(Lack of) Progress Report on Cleaner Signals and Slots Implementation
Status: Inactive
Brought to you by:
manyoso
From: Marcus <ma...@my...> - 2003-01-19 07:33:06
|
I've spent some time lately looking through Qt's documentation and source code to see if we can come up with a cleaner way to implement signals and slots. Adam really wanted to avoid having all the custom prototypes for each slot type. What we really need is to something akin to Connect( QObject* sender, const char* signalName, QObject* receiver, void* slotFunction ) The problem is that Qt goes to great lengths to allow the user to specify the slot as a string (char*) rather than a function pointer. Qt uses moc to create data structures at compile time to map between signal/slot names are methods. Unfortunately, these data structures are not officially sanctioned by TrollTech. So far I have not found a simple way to achieve what we want without either using undocumented functions. By "undocumented" functions, I mean functions that are not listed in the for the classes in $QTDIR/doc/html. I will continue to look for something, but I'm not sure that I will find it. I have even looked at PyQt to see how they handle this, and it appears that they do something similar to what we are currently doing. We can probably clean the code up a bit, but unless we are willing to use some gray-area functionality of Qt, we might have to retain the current approach. I wil conitnue looking, but it would like some feedback. |