qt_dir = '/opt/qtsdk-2009.01/qt'
target_dir = '/path/to/target_dir'
`find #{qt_dir}/demos #{qt_dir}/examples -name '*.ui'`.split.each do |ui_file|
basename = File.basename ui_file, '.ui'
`/opt/ruby-1.9.1/bin/rbuic4 #{ui_file} -x -o #{target_dir}/#{basename}.rb`
end
Ruby script files are generated, but these files are written in non-rubyish style (in addition, less object-oriented style).
For example, launch one of generated script, default.rb.
>/opt/ruby-1.9.1/bin/ruby default.rb
No comments:
Post a Comment