rendered paste body#!/usr/bin/ruby -wrequire 'bodyhack'require 'Qt'#This Widget isclass BodyHackUI < Qt::Widget slots 'on_spinBox_valueChanged(int)' def initialize(parent = nil) super(parent) @main_window = load("widgets/mainwindow.ui") #@ui_spinBox = @main_window.findChildren(Qt::SpinBox, "spinBox")[0] @ui_spinBox = findChild(Qt::SpinBox, "spinBox") Qt::MetaObject.connectSlotsByName(self) @main_window.show() end def on_spinBox_valueChanged(value) puts("#{value} foo") end def load(filename) @loader ||= Qt::UiLoader.new q_file = Qt::File.new(filename) w = @loader.load(q_file, self) q_file.close() return w endendapplication = Qt::Application.new(ARGV)BodyHackUI.newapplication.exec