From: David Brunell Date: 2009-01-16T00:03:44+09:00 Subject: Re: Using qui rather than rbuic for qtdesigner .ui files Stefano Crocco wrote: > require 'Qt' > require 'qui' > > class MainWidget < Qt::Widget > > slots 'test()' > > def initialize > @widget = QUI::WidgetFactory.create "sampledialog.ui" > self.layout = Qt::VBoxLayout.new > self.layout.add_widget @widget > connect @widget.child('testButton'), SIGNAL('clicked()'), self, > SLOT('test()') > end > > def test > puts "test button clicked" > end > > end > > app = Qt::Application.new ARGV > w = MainWidget.new > w.show > a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()')) > a.exec Many thanks for your kind reply. I get the following error when running your suggested code: quitest2.rb:10:in `method_missing': undefined method `layout=' for :MainWidget (NoMethodError) I somewhat understand this error, but upon commenting out the two self.layout lines, I then get the following error: quitest2.rb:12:in `method_missing': super: no superclass method `connect'(NoMethodError) If I change "connect" to "Qt::Object.connect" (this is what the rbuic compiler would generate) the error persists. Any ideas? Thanks, David -- Posted via http://www.ruby-forum.com/.