[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    [Kde-bindings] Qyoto: showstopper bug - help needed
From:       Dimitar Dobrev <dpldobrev () yahoo ! com>
Date:       2012-06-13 22:51:14
Message-ID: 1339627874.52761.YahooMailNeo () web125905 ! mail ! ne1 ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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.


[Attachment #5 (text/html)]

<html><body><div style="color:#000; background-color:#fff; font-family:times new \
roman, new york, times, serif;font-size:12pt"><div>Hi \
all,</div><div><br></div><div>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:</div><div><br></div><div>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;<br></div><div>2. Subsequent calls to failing methods work properly. For \
example on my machine this method in \
QSize:</div><div><br></div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public new \
QSize ExpandedTo(QSize arg1) \
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object[] \
smokeArgs = new object[] \
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
typeof(QSize),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
arg1};<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return \
((QSize)(this.interceptor.Invoke("expandedTo#", "expandedTo(const QSize&amp;) const", \
typeof(QSize), false, smokeArgs)));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}</div><div><br></div><div>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.<br></div></div></body></html>



_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic