[UFO-devel] Re: help me
Status: Beta
Brought to you by:
schmidtjf
From: Johannes S. <sch...@us...> - 2006-03-03 12:50:54
|
Hi Lidia, sorry for the late reply ... Am Dienstag, 28. Februar 2006 19:11 schrieb LIDIAa ARISTA SANCHEZ: > Can you help me? I hope I can :) > I don't understand signal and slot, someday I prove QT and I understand > but if I puth in me class someone slot, it said : > > no matching function for call to `slot(<unknown type>)' > candidates are: ufo::USlot0 ufo::slot(void (*)()) > > Why?, me instruction is: > combo->sigActivated().connect(slot(DrawMesh::&activar)); If you connect to a member method of a class, you have to provide 2 things: a) A reference to an object of that class b) A pointer to a member method Try something like this: combo->sigActivated().connect(slot(*combo, &DrawMesh::activar)); As a side note: I want to achieve what is called delegates in other languages. Main point is to provide an object oriented way of plain C call backs (function pointers). If you want more info on this topic, search for C++ and delegates or member function pointer etc. But you don't need that info if you just want to use it :) > I don't understand very well how I use the next clases UEvent, > UObjectSlotNode, USlotBase, USlotEven, > but you said a Dr. Luis M. de la Cruz S. > > If you are using Class methods, you need an object slot (in > uobjectslot.hpp). > > but I don't understand this class. You should use any of the slot class yourself. All the work should be done by the overloaded function: slot. Hope that helps. If it is still unclear, don't hesitate to ask. Regards, Johannes |