[Kde-bindings] Qtruby -- assorted questions
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Sun Oct 10 13:25:16 UTC 2004
On Sunday 10 October 2004 13:55, Han Holl wrote:
> On Thursday 07 October 2004 16:49, Han Holl wrote:
> > If I run as MainWindow (give 'main' as argument), the geometry is all
> > foobarred. Nothing in the documentation that I could find has anything on
> > this. It should make no difference, should it ?
>
> I apologize for the above question: yes, running under a layoutmanager
> _does_ make a difference, especially when you use width() and height().
OK, good. I've only just spotted your previous assorted questions mail.
To get the list of parents, you can't use this:
obj = self
while obj.respond_to?(:parent)
obj = obj.parent
STDERR.puts("P: #{obj.class} #{obj.object_id}")
end
Because QtRuby depends on using method_missing() to trap ruby method calls,
and divert them to the Smoke library. And so respond_to? will always be
false. Instead do something like this:
obj = self.parent
while !obj.nil?
STDERR.puts("P: #{obj.class} #{obj.object_id}")
obj = obj.parent
end
Gives this output:
focusin lang:spoed_pcode PalgaEdit Qt::Widget
P: Qt::Widget 404978152
P: Qt::WidgetStack 404812828
P: GoToCellDialog 403224788
404978152 403224788
On Thursday 07 October 2004 15:49, Han Holl wrote:
> TabWidget#addTab seems to return nil. The docs say it returns an integer.
Well, I have this in my docs for QTabWidget:
virtual void addTab ( QWidget * child, const QString & label )
virtual void addTab ( QWidget * child, const QIconSet & iconset, const QString
& label )
virtual void addTab ( QWidget * child, QTab * tab )
I still haven't fixed the GC problem with PalgaEdit fields - I'll have another
try this week.
-- Richard
More information about the Kde-bindings
mailing list