[Kde-bindings] playground/bindings/kimono

Richard Dale richard.j.dale at gmail.com
Tue Mar 6 19:36:46 UTC 2007


On Tuesday 06 March 2007, Richard Dale wrote:
> > > The key WeakReference will always be alive because the value has a
> > > GCHandle wrapping the key.
> >
> > Oops, ok, that's right.
>
> I just tried out my idea as code, and it doesn't work. Oh well. It gives
> this output:
>
> Can't select indexes from different model or with different parents
> topLeft.model: 0x84ef070 bottomRight.model: 0x84ef070
> topLeft.parent().row(): 5 topLeft.parent().column(): 0
> bottomRight.parent().row(): 5 bottomRight.parent().column(): 0
> topLeft.parent().internalPointer(): 0x79f3
> bottomRight.parent().internalPointer(): 0x79d3
> topLeft.parent().model(): 0x84ef070 bottomRight.parent().model(): 0x84ef070
>
> So the two select points need to have the same parent still, although all
> the details match. Hmm.. I don't understand how it works in Ruby now. I've
> attached the patch of what I did anyway as that might be clearer than
> trying to describe it.
Ah, I forgot to add the struct with the GCHandle to the handleMap, oops.. Once
I did that it works fine. The reason I don't think we should use
WeakReferences is that the QModelIndex 'owns' the reference in the
internalPointer and shouldn't allow it to be GC'd. I added a fix to qtruby
this morning exactly to prevent that happening.

-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qmodel_index_1.patch
Type: text/x-diff
Size: 3184 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20070306/c9e75ad0/attachment.bin>


More information about the Kde-bindings mailing list