From: Mark Somerville Date: 2006-01-30T20:46:17+09:00 Subject: Re: install_qtruby_on_mac On Monday 30 January 2006 10:42, 天野 竜太郎 wrote: > Hi, I am Ryutaro Amano. > I am using ruby-1.8.4 on Mac 10.4.4 with XCode-2.2 > I have installed qtruby-1.0.10 Hello. There is a bug in version 1.0.10 when using Ruby 1.8.4 - it is some sort of problem with calling super when subclassing the Qt classes, which will create the problem you describe below. An upgrade to 1.0.11 should fix the problem. Mark > ----------------------------------------------------------------------- > > The window of tutorial4 have not button. > --------------------------------------------------------------------- > #!/usr/bin/env ruby > $VERBOSE = true; $:.unshift File.dirname($0) > > require 'Qt' > > class MyWidget < Qt::Widget > > def initialize(parent = nil, name = nil) > super > setMinimumSize(200, 120) > setMaximumSize(200, 120) > > quit = Qt::PushButton.new('Quit', self, 'quit') > quit.setGeometry(62, 40, 75, 30) > quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold)) > connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()')) > end > > end > > a = Qt::Application.new(ARGV) > > w = MyWidget.new > w.setGeometry(100, 100, 200, 120) > a.setMainWidget(w) > w.show > a.exec