[Kde-bindings] playground/bindings/kimono

Arno Rehn arno at arnorehn.de
Tue Mar 6 17:14:14 UTC 2007


Am Montag, 5. März 2007 schrieb Richard Dale:
> So the 'internalPointer' has a different value even when the underlying
> instance is the same. That's because QAbstractItemModel.CreateIndex()
> allocates a new GCHandle every time, which will have different values. The
> reason it works in QtRuby is because the internalPointer is a Ruby VALUE
> that is  the same for every createIndex call.
Ah tanks. I added a Dictionary where all the GCHandles for QModelIndex'es are 
stored. This GCHandle is looked up for the specific QModelIndex and then 
passed to the C++ helper function. Selecting child items is no problem 
anymore. Up to now I thought GCHandle.Alloc() returns always the same value, 
but apparently it doesn't.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list