[Kde-bindings] Qt signal return values

Arno Rehn arno at arnorehn.de
Tue Oct 10 22:26:06 UTC 2006


Am Donnerstag, 5. Oktober 2006 18:11 schrieb Richard Dale:
> On Thursday 05 October 2006 17:03, Arno Rehn wrote:
> > Hello,
> >
> > I still don't quite get it why a signal should be able to return a value.
> > I haven't found anything in the Qt examples and demos for D-Bus. Can
> > someone give me an example, when it is necessary for a signal to return a
> > value? It doesn't make any sense to me. A slot is logical, but a
> > signal...
>
> No I can't see the signal itself would return anything, it would return
> whatever the slot connected to it returns. Or if it's connected to several
> slots it would return the value from the last slot invoked.
>
> We don't need much to get DBus to work now you've added slot return values.
> Just implement the Q_CLASSINFO and Q_SCRIPTABLE attributes, and put the
> values from them in the QMetaObject data when it is constructed.

Hmm, OK, but I can't find any information on Q_SCRIPTABLE. What does it do? 
Never heard of this macro.
And how should I get the arguments Q_CLASSINFO into the QMetaObject?

The core QMetaObject-data is set up here:

				ArrayList tmp = new ArrayList(new uint[] { 
					1,                                  // revision
					handler[className],                 // classname
					0, 0,                               // classinfo
					(uint)(signals.Count + slots.Count), 10,  // methods
					0, 0,                               // properties
					0, 0
				});

The equivalent in QtRuby is:
			data = [1, 								# revision
					string_table.call(classname), 	# classname
					classinfos.length, classinfos.length > 0 ? 10 : 0, 	# classinfo
					signals.length + slots.length, 
					10 + (2*classinfos.length), 	# methods
					0, 0, 							# properties
					0, 0]							# enums/sets

Quite clear, but (I'm not that good in ruby) what does
classinfos.length > 0 ? 10 : 0
mean? Of what type is "classinfos"?
Then it still seems as only the length of "classinfos" is passed, but not the 
parameters...

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list