Sha256: d66599db04cb92c88b768ea0ab0863b89d1d366e9d1ee8e7db3f3110e78ce99a

Contents?: true

Size: 1.11 KB

Versions: 17

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby
$VERBOSE = true; $:.unshift File.dirname($0)

require 'Qt'
require './lcdrange.rb'
require './cannon.rb'

class MyWidget < Qt::Widget
    def initialize(parent = nil)
        super
        quit = Qt::PushButton.new('Quit')
        quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))
    
        connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
    
        angle = LCDRange.new( self )
        angle.range = 5..70

        cannonField = CannonField.new( self )

        connect( angle, SIGNAL('valueChanged(int)'),
                cannonField, SLOT('setAngle(int)') )
        connect( cannonField, SIGNAL('angleChanged(int)'),
                angle, SLOT('setValue(int)') )

        gridLayout = Qt::GridLayout.new
        gridLayout.addWidget( quit, 0, 0 )
        gridLayout.addWidget( angle, 1, 0 )
        gridLayout.addWidget( cannonField, 1, 1, 2, 1 )
        gridLayout.setColumnStretch( 1, 10 )
        setLayout( gridLayout )

        angle.setValue( 60 )
        angle.setFocus()
    end
end    

a = Qt::Application.new(ARGV)

w = MyWidget.new
w.setGeometry( 100, 100, 500, 355 )
w.show
a.exec

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
qtbindings-4.8.6.2 examples/tutorial/t8/t8.rb
qtbindings-4.8.6.1 examples/tutorial/t8/t8.rb
qtbindings-4.8.6.0 examples/tutorial/t8/t8.rb
qtbindings-4.8.6.0-x86-mingw32 examples/tutorial/t8/t8.rb
qtbindings-4.8.5.2 examples/tutorial/t8/t8.rb
qtbindings-4.8.5.2-x86-mingw32 examples/tutorial/t8/t8.rb
qtbindings-4.8.5.1 examples/tutorial/t8/t8.rb
qtbindings-4.8.5.0 examples/tutorial/t8/t8.rb
qtbindings-4.8.3.0-x86-mingw32 examples/tutorial/t8/t8.rb
qtbindings-4.8.3.0 examples/tutorial/t8/t8.rb
qtbindings-4.6.3.4-x86-mingw32 examples/tutorial/t8/t8.rb
qtbindings-4.6.3.4 examples/tutorial/t8/t8.rb
qtbindings-4.6.3.3 examples/tutorial/t8/t8.rb
qtbindings-4.6.3.2-x86-mingw32 examples/tutorial/t8/t8.rb
qtbindings-4.6.3.2 examples/tutorial/t8/t8.rb
qtbindings-4.6.3.1 examples/tutorial/t8/t8.rb
qtbindings-4.6.3.1-x86-mingw32 examples/tutorial/t8/t8.rb