[Kde-bindings] Best way to manually connect events in Qyoto?
Arno Rehn
arno at arnorehn.de
Sat Jan 30 20:51:49 UTC 2010
On Saturday 30 January 2010 21:37:42 IBBoard wrote:
> I'm back with another question - I'm still weighing up whether I'd
> rather have GTK#'s non-OO-ness or Qyoto's esoteric "signals".
>
> I know I can now attach delegates to signals using QObject.Connect(),
> and I've read the previous discussion about why Qyoto can't have
> "normal" C# events (the main point being that signals can be overloaded
> with different parameters, but events can't), but I'm not quite sure I
> can get used to the SIGNAL("signalName()") method as a good way to do
> things. I'm used to TDD and refactoring code, so having a method name in
> a string seems like a bad thing anyway. On top of that I don't know what
> the signals are for lists, combo boxes, buttons, etc and they're not
> available as auto-completes, so I've got to keep going back to the
> documentation, reading, copying, remembering the "SIGNAL" wrapper, and
> not finding out that I've mistyped something until runtime.
>
> I realise that Qt has its own ways of doing things and that the
> signals/slots method is cross-platform and quite flexible, but is there
> any easier way to handle this, perhaps in terms of IDE support or some
> other method of indicating the signals? The current methods just seems a
> bit brittle and difficult for new-comers (what if I'm offline and don't
> have access to the documentation, for example?)
The signals of a QObject are defined in the I<ClassName>Signals interface
(e.g. Qyoto.IQAbstractButtonSignals). That interface is used to emit signals
(via foo.Emit.Clicked()), but I guess you can also use it to list the
available signals. They are in their C# form, then, but inferring the original
C++ signature shouldn't be too hard. The C++ signature is also attached as an
attribute, but I don't know if MonoDevelop supports showing method attributes.
Otherwise there is also the Qt offline documentation ('assistant' is your
friend ;)).
For KDE 4.5 we plan to support events which map to Qt signals. If a signal is
overloaded, a scoring system for the parameters decides which signal is mapped
to the event.
--
Arno Rehn
arno at arnorehn.de
More information about the Kde-bindings
mailing list