summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/uilib/test/test.rb
blob: e99526f19eff63ca20a386e9b2a27c5f6b1e2062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'Qt'
require 'tqui'

a = TQt::Application.new(ARGV)
if ARGV.length == 0
	puts "Usage: test.rb <image dir> <ui file>"
	exit
end

if ARGV.length == 2
	TQUI::WidgetFactory.loadImages( ARGV[ 0 ] )
    w = TQUI::WidgetFactory.create( ARGV[ 1 ] )
    if w.nil?
		puts "Failed to create top level widget"
		exit
	end
    w.show()
    a.connect( a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()') )
    a.exec()
end