------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.
http://bug
s.kde.org/show_bug.cgi?id=126985
------- Additional Comments From Richard_Dale tipitina demon
co uk 2006-05-16 20:55 -------
On Tuesday 16 May 2006 15:44, Caleb Tennis wrote:
[bugs.kde.org quoted mail]
I thought I already added a comment to this report. Here is
the comment from
the Qt.cpp code, that tries to explain the problem, and the
reason why code
before the super call is run twice:
/*
class LCDRange < Qt::Widget
def initialize(s, parent, name)
super(parent, name)
init()
...
For a case such as the above, the QWidget can't be
instantiated until
the initializer has been run up to the point where
'super(parent, name)'
is called. Only then, can the number and type of arguments
passed to the
constructor be known. However, the rest of the intializer
can't be run until 'self' is a proper T_DATA object with
a wrapped C++
instance.
The solution is to run the initialize code twice. First,
only up to the
'super(parent, name)' call, where the QWidget would get
instantiated in
initialize_qt(). And then rb_throw() jumps out of the
initializer returning the wrapped object as a result.
The second time round 'self' will be the wrapped instance
of type T_DATA,
so initialize() can be allowed to proceed to the end.
*/
An ordinary Ruby instance is a T_OBJECT type in the C code,
but once it wraps
a C++ instance it is a T_DATA. So it is very difficult to
work round it
without the 'run twice' fix.
-- Richard
_______________________________________________
Kde-bindings mailing list
Kde-bindings kde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings
|