[Kde-bindings] Qyoto: showstopper bug - help needed

Dimitar Dobrev dpldobrev at yahoo.com
Wed Jun 13 22:51:14 UTC 2012


Hi all,

The workaround for the bug causing an invalid cast - the commenting out of the mappointer call in qyoto-qtcore/native/handlers.cpp - is not correct because it causes different managed objects to be returned for subsequent calls to the same property. So this bug has to be fixed otherwise Qyoto is completely useless. Please, if anyone has any idea, it would be of help. Here are my few findings:

1. The mentioned hack gives some hint what might be wrong - I think that the problem is that initially the wrong object is constructed but as it is not saved when it is being requested it is created anew, and this time correctly; this, I believe, is confirmed by a QDropEvent with type() == QEvent.Type.QDragMove that is tried to be passed to a QDragMove event handler; that is, the type() method gives the correct result but the object type (QDropEvent) is wrong;

2. Subsequent calls to failing methods work properly. For example on my machine this method in QSize:

        public new QSize ExpandedTo(QSize arg1) {
            object[] smokeArgs = new object[] {
                    typeof(QSize),
                    arg1};
            return ((QSize)(this.interceptor.Invoke("expandedTo#", "expandedTo(const QSize&) const", typeof(QSize), false, smokeArgs)));
        }

may crash with "Unable to cast object of type 'Qyoto.QItemSelectionModel' to type 'Qyoto.QSize'." but if I call it again (tried this a few times in the Visual Studio watch window) the error doesn't appear any more, that is, the correct type is returned.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20120613/262a131f/attachment.html>


More information about the Kde-bindings mailing list