qtbindings 4.8.6.3-x86-mingw32 → 4.8.6.4-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/bin/2.4/rbrcc.exe +0 -0
- data/bin/2.4/rbuic4.exe +0 -0
- data/bin/2.4/smokeapi.exe +0 -0
- data/bin/2.4/smokedeptool.exe +0 -0
- data/examples/tutorial/t10/cannon.rb +72 -72
- data/examples/tutorial/t10/lcdrange.rb +45 -45
- data/examples/tutorial/t10/t10.rb +55 -55
- data/examples/tutorial/t11/cannon.rb +123 -124
- data/examples/tutorial/t11/lcdrange.rb +45 -45
- data/examples/tutorial/t11/t11.rb +65 -65
- data/examples/tutorial/t12/cannon.rb +157 -158
- data/examples/tutorial/t12/lcdrange.rb +58 -59
- data/examples/tutorial/t12/t12.rb +65 -66
- data/examples/tutorial/t13/cannon.rb +206 -208
- data/examples/tutorial/t13/gamebrd.rb +112 -113
- data/examples/tutorial/t13/lcdrange.rb +59 -60
- data/examples/tutorial/t13/t13.rb +11 -11
- data/examples/tutorial/t14/cannon.rb +262 -263
- data/examples/tutorial/t14/gamebrd.rb +122 -123
- data/examples/tutorial/t14/lcdrange.rb +61 -63
- data/examples/tutorial/t14/t14.rb +11 -11
- data/examples/tutorial/t3/t3.rb +17 -18
- data/examples/tutorial/t4/t4.rb +23 -25
- data/examples/tutorial/t5/t5.rb +35 -37
- data/examples/tutorial/t6/t6.rb +48 -52
- data/examples/tutorial/t7/lcdrange.rb +32 -32
- data/examples/tutorial/t7/t7.rb +40 -42
- data/examples/tutorial/t8/cannon.rb +37 -38
- data/examples/tutorial/t8/lcdrange.rb +45 -45
- data/examples/tutorial/t8/t8.rb +43 -43
- data/examples/tutorial/t9/cannon.rb +44 -45
- data/examples/tutorial/t9/lcdrange.rb +46 -46
- data/examples/tutorial/t9/t9.rb +43 -43
- data/lib/2.4/libqtruby4shared.dll +0 -0
- data/lib/2.4/libsmokebase.dll +0 -0
- data/lib/2.4/libsmokeqtcore.dll +0 -0
- data/lib/2.4/libsmokeqtdeclarative.dll +0 -0
- data/lib/{2.1 → 2.4}/libsmokeqtgui.dll +0 -0
- data/lib/2.4/libsmokeqthelp.dll +0 -0
- data/lib/2.4/libsmokeqtmultimedia.dll +0 -0
- data/lib/2.4/libsmokeqtnetwork.dll +0 -0
- data/lib/2.4/libsmokeqtopengl.dll +0 -0
- data/lib/2.4/libsmokeqtscript.dll +0 -0
- data/lib/2.4/libsmokeqtsql.dll +0 -0
- data/lib/2.4/libsmokeqtsvg.dll +0 -0
- data/lib/2.4/libsmokeqttest.dll +0 -0
- data/lib/2.4/libsmokeqtuitools.dll +0 -0
- data/lib/2.4/libsmokeqtwebkit.dll +0 -0
- data/lib/2.4/libsmokeqtxml.dll +0 -0
- data/lib/2.4/libsmokeqtxmlpatterns.dll +0 -0
- data/lib/2.4/qtdeclarative.so +0 -0
- data/lib/2.4/qtruby4.so +0 -0
- data/lib/2.4/qtscript.so +0 -0
- data/lib/2.4/qttest.so +0 -0
- data/lib/2.4/qtuitools.so +0 -0
- data/lib/2.4/qtwebkit.so +0 -0
- data/lib/Qt4.rb +119 -111
- data/lib/qtbindings_version.rb +2 -2
- data/qtbindings.gemspec +18 -18
- data/qtbindingsnative.gemspec +19 -19
- metadata +38 -115
- data/bin/2.0/rbrcc.exe +0 -0
- data/bin/2.0/rbuic4.exe +0 -0
- data/bin/2.0/smokeapi.exe +0 -0
- data/bin/2.0/smokedeptool.exe +0 -0
- data/bin/2.1/rbrcc.exe +0 -0
- data/bin/2.1/rbuic4.exe +0 -0
- data/bin/2.1/smokeapi.exe +0 -0
- data/bin/2.1/smokedeptool.exe +0 -0
- data/bin/2.2/rbrcc.exe +0 -0
- data/bin/2.2/rbuic4.exe +0 -0
- data/bin/2.2/smokeapi.exe +0 -0
- data/bin/2.2/smokedeptool.exe +0 -0
- data/bin/2.3/rbrcc.exe +0 -0
- data/bin/2.3/rbuic4.exe +0 -0
- data/bin/2.3/smokeapi.exe +0 -0
- data/bin/2.3/smokedeptool.exe +0 -0
- data/lib/2.0/libqtruby4shared.dll +0 -0
- data/lib/2.0/libsmokebase.dll +0 -0
- data/lib/2.0/libsmokeqtcore.dll +0 -0
- data/lib/2.0/libsmokeqtdeclarative.dll +0 -0
- data/lib/2.0/libsmokeqtgui.dll +0 -0
- data/lib/2.0/libsmokeqthelp.dll +0 -0
- data/lib/2.0/libsmokeqtmultimedia.dll +0 -0
- data/lib/2.0/libsmokeqtnetwork.dll +0 -0
- data/lib/2.0/libsmokeqtopengl.dll +0 -0
- data/lib/2.0/libsmokeqtscript.dll +0 -0
- data/lib/2.0/libsmokeqtsql.dll +0 -0
- data/lib/2.0/libsmokeqtsvg.dll +0 -0
- data/lib/2.0/libsmokeqttest.dll +0 -0
- data/lib/2.0/libsmokeqtuitools.dll +0 -0
- data/lib/2.0/libsmokeqtwebkit.dll +0 -0
- data/lib/2.0/libsmokeqtxml.dll +0 -0
- data/lib/2.0/libsmokeqtxmlpatterns.dll +0 -0
- data/lib/2.0/qtdeclarative.so +0 -0
- data/lib/2.0/qtruby4.so +0 -0
- data/lib/2.0/qtscript.so +0 -0
- data/lib/2.0/qttest.so +0 -0
- data/lib/2.0/qtuitools.so +0 -0
- data/lib/2.0/qtwebkit.so +0 -0
- data/lib/2.1/libqtruby4shared.dll +0 -0
- data/lib/2.1/libsmokebase.dll +0 -0
- data/lib/2.1/libsmokeqtcore.dll +0 -0
- data/lib/2.1/libsmokeqtdeclarative.dll +0 -0
- data/lib/2.1/libsmokeqthelp.dll +0 -0
- data/lib/2.1/libsmokeqtmultimedia.dll +0 -0
- data/lib/2.1/libsmokeqtnetwork.dll +0 -0
- data/lib/2.1/libsmokeqtopengl.dll +0 -0
- data/lib/2.1/libsmokeqtscript.dll +0 -0
- data/lib/2.1/libsmokeqtsql.dll +0 -0
- data/lib/2.1/libsmokeqtsvg.dll +0 -0
- data/lib/2.1/libsmokeqttest.dll +0 -0
- data/lib/2.1/libsmokeqtuitools.dll +0 -0
- data/lib/2.1/libsmokeqtwebkit.dll +0 -0
- data/lib/2.1/libsmokeqtxml.dll +0 -0
- data/lib/2.1/libsmokeqtxmlpatterns.dll +0 -0
- data/lib/2.1/qtdeclarative.so +0 -0
- data/lib/2.1/qtruby4.so +0 -0
- data/lib/2.1/qtscript.so +0 -0
- data/lib/2.1/qttest.so +0 -0
- data/lib/2.1/qtuitools.so +0 -0
- data/lib/2.1/qtwebkit.so +0 -0
- data/lib/2.2/libqtruby4shared.dll +0 -0
- data/lib/2.2/libsmokebase.dll +0 -0
- data/lib/2.2/libsmokeqtcore.dll +0 -0
- data/lib/2.2/libsmokeqtdeclarative.dll +0 -0
- data/lib/2.2/libsmokeqtgui.dll +0 -0
- data/lib/2.2/libsmokeqthelp.dll +0 -0
- data/lib/2.2/libsmokeqtmultimedia.dll +0 -0
- data/lib/2.2/libsmokeqtnetwork.dll +0 -0
- data/lib/2.2/libsmokeqtopengl.dll +0 -0
- data/lib/2.2/libsmokeqtscript.dll +0 -0
- data/lib/2.2/libsmokeqtsql.dll +0 -0
- data/lib/2.2/libsmokeqtsvg.dll +0 -0
- data/lib/2.2/libsmokeqttest.dll +0 -0
- data/lib/2.2/libsmokeqtuitools.dll +0 -0
- data/lib/2.2/libsmokeqtwebkit.dll +0 -0
- data/lib/2.2/libsmokeqtxml.dll +0 -0
- data/lib/2.2/libsmokeqtxmlpatterns.dll +0 -0
- data/lib/2.2/qtdeclarative.so +0 -0
- data/lib/2.2/qtruby4.so +0 -0
- data/lib/2.2/qtscript.so +0 -0
- data/lib/2.2/qttest.so +0 -0
- data/lib/2.2/qtuitools.so +0 -0
- data/lib/2.2/qtwebkit.so +0 -0
- data/lib/2.3/libqtruby4shared.dll +0 -0
- data/lib/2.3/libsmokebase.dll +0 -0
- data/lib/2.3/libsmokeqtcore.dll +0 -0
- data/lib/2.3/libsmokeqtdeclarative.dll +0 -0
- data/lib/2.3/libsmokeqtgui.dll +0 -0
- data/lib/2.3/libsmokeqthelp.dll +0 -0
- data/lib/2.3/libsmokeqtmultimedia.dll +0 -0
- data/lib/2.3/libsmokeqtnetwork.dll +0 -0
- data/lib/2.3/libsmokeqtopengl.dll +0 -0
- data/lib/2.3/libsmokeqtscript.dll +0 -0
- data/lib/2.3/libsmokeqtsql.dll +0 -0
- data/lib/2.3/libsmokeqtsvg.dll +0 -0
- data/lib/2.3/libsmokeqttest.dll +0 -0
- data/lib/2.3/libsmokeqtuitools.dll +0 -0
- data/lib/2.3/libsmokeqtwebkit.dll +0 -0
- data/lib/2.3/libsmokeqtxml.dll +0 -0
- data/lib/2.3/libsmokeqtxmlpatterns.dll +0 -0
- data/lib/2.3/qtdeclarative.so +0 -0
- data/lib/2.3/qtruby4.so +0 -0
- data/lib/2.3/qtscript.so +0 -0
- data/lib/2.3/qttest.so +0 -0
- data/lib/2.3/qtuitools.so +0 -0
- data/lib/2.3/qtwebkit.so +0 -0
- data/lib/qtbindings_qt_version.rb +0 -2
@@ -1,123 +1,122 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
class GameBoard < Qt::Widget
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
end
|
1
|
+
require_relative 'lcdrange.rb'
|
2
|
+
require_relative 'cannon.rb'
|
3
|
+
|
4
|
+
class GameBoard < Qt::Widget
|
5
|
+
slots 'fire()', 'hit()', 'missed()', 'newGame()'
|
6
|
+
|
7
|
+
def initialize()
|
8
|
+
super
|
9
|
+
quit = Qt::PushButton.new('&Quit')
|
10
|
+
quit.font = Qt::Font.new('Times', 18, Qt::Font::Bold)
|
11
|
+
|
12
|
+
connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
|
13
|
+
|
14
|
+
angle = LCDRange.new('ANGLE')
|
15
|
+
angle.range = 5..70
|
16
|
+
|
17
|
+
force = LCDRange.new('FORCE')
|
18
|
+
force.range = 10..50
|
19
|
+
|
20
|
+
cannonBox = Qt::Frame.new
|
21
|
+
cannonBox.frameStyle = Qt::Frame::WinPanel | Qt::Frame::Sunken
|
22
|
+
|
23
|
+
@cannonField = CannonField.new
|
24
|
+
|
25
|
+
connect(angle, SIGNAL('valueChanged(int)'),
|
26
|
+
@cannonField, SLOT('angle=(int)'))
|
27
|
+
connect(@cannonField, SIGNAL('angleChanged(int)'),
|
28
|
+
angle, SLOT('value=(int)'))
|
29
|
+
|
30
|
+
connect(force, SIGNAL('valueChanged(int)'),
|
31
|
+
@cannonField, SLOT('force=(int)'))
|
32
|
+
connect(@cannonField, SIGNAL('forceChanged(int)'),
|
33
|
+
force, SLOT('value=(int)'))
|
34
|
+
|
35
|
+
connect(@cannonField, SIGNAL('hit()'),
|
36
|
+
self, SLOT('hit()'))
|
37
|
+
connect(@cannonField, SIGNAL('missed()'),
|
38
|
+
self, SLOT('missed()'))
|
39
|
+
|
40
|
+
shoot = Qt::PushButton.new('&Shoot')
|
41
|
+
shoot.font = Qt::Font.new('Times', 18, Qt::Font::Bold)
|
42
|
+
|
43
|
+
connect(shoot, SIGNAL('clicked()'), SLOT('fire()'))
|
44
|
+
connect(@cannonField, SIGNAL('canShoot(bool)'),
|
45
|
+
shoot, SLOT('setEnabled(bool)'))
|
46
|
+
|
47
|
+
restart = Qt::PushButton.new('&New Game')
|
48
|
+
restart.font = Qt::Font.new('Times', 18, Qt::Font::Bold)
|
49
|
+
|
50
|
+
connect(restart, SIGNAL('clicked()'), self, SLOT('newGame()'))
|
51
|
+
|
52
|
+
@hits = Qt::LCDNumber.new(2, self)
|
53
|
+
@shotsLeft = Qt::LCDNumber.new(2, self)
|
54
|
+
hitsLabel = Qt::Label.new('HITS', self)
|
55
|
+
shotsLeftLabel = Qt::Label.new('SHOTS LEFT', self)
|
56
|
+
|
57
|
+
Qt::Shortcut.new(Qt::KeySequence.new(Qt::Key_Enter), self, SLOT('fire()'))
|
58
|
+
Qt::Shortcut.new(Qt::KeySequence.new(Qt::Key_Return), self, SLOT('fire()'))
|
59
|
+
Qt::Shortcut.new(Qt::KeySequence.new(Qt::CTRL + Qt::Key_Q), self, SLOT('close()'))
|
60
|
+
|
61
|
+
topLayout = Qt::HBoxLayout.new
|
62
|
+
topLayout.addWidget(shoot)
|
63
|
+
topLayout.addWidget(@hits)
|
64
|
+
topLayout.addWidget(hitsLabel)
|
65
|
+
topLayout.addWidget(@shotsLeft)
|
66
|
+
topLayout.addWidget(shotsLeftLabel)
|
67
|
+
topLayout.addStretch(1)
|
68
|
+
topLayout.addWidget(restart)
|
69
|
+
|
70
|
+
leftLayout = Qt::VBoxLayout.new()
|
71
|
+
leftLayout.addWidget(angle)
|
72
|
+
leftLayout.addWidget(force)
|
73
|
+
|
74
|
+
cannonLayout = Qt::VBoxLayout.new
|
75
|
+
cannonLayout.addWidget(@cannonField)
|
76
|
+
cannonBox.layout = cannonLayout
|
77
|
+
|
78
|
+
gridLayout = Qt::GridLayout.new
|
79
|
+
gridLayout.addWidget(quit, 0, 0)
|
80
|
+
gridLayout.addLayout(topLayout, 0, 1)
|
81
|
+
gridLayout.addLayout(leftLayout, 1, 0)
|
82
|
+
gridLayout.addWidget(cannonBox, 1, 1, 2, 1)
|
83
|
+
gridLayout.setColumnStretch(1, 10)
|
84
|
+
setLayout(gridLayout)
|
85
|
+
|
86
|
+
angle.value = 60
|
87
|
+
force.value = 25
|
88
|
+
angle.setFocus
|
89
|
+
|
90
|
+
newGame()
|
91
|
+
end
|
92
|
+
|
93
|
+
def fire()
|
94
|
+
if @cannonField.gameOver || @cannonField.shooting?
|
95
|
+
return
|
96
|
+
end
|
97
|
+
@shotsLeft.display(@shotsLeft.intValue() - 1)
|
98
|
+
@cannonField.shoot
|
99
|
+
end
|
100
|
+
|
101
|
+
def hit()
|
102
|
+
@hits.display(@hits.intValue() + 1)
|
103
|
+
if @shotsLeft.intValue() == 0
|
104
|
+
@cannonField.setGameOver
|
105
|
+
else
|
106
|
+
@cannonField.newTarget
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def missed()
|
111
|
+
if @shotsLeft.intValue() == 0
|
112
|
+
@cannonField.setGameOver
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def newGame()
|
117
|
+
@shotsLeft.display(15.0)
|
118
|
+
@hits.display(0)
|
119
|
+
@cannonField.restartGame
|
120
|
+
@cannonField.newTarget
|
121
|
+
end
|
122
|
+
end
|
@@ -1,63 +1,61 @@
|
|
1
|
-
class LCDRange < Qt::Widget
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
1
|
+
class LCDRange < Qt::Widget
|
2
|
+
signals 'valueChanged(int)'
|
3
|
+
|
4
|
+
slots 'value=(int)', 'setRange(int, int)', 'text=(const char*)'
|
5
|
+
|
6
|
+
def initialize(s, parent = nil)
|
7
|
+
super(parent)
|
8
|
+
init()
|
9
|
+
self.text = s
|
10
|
+
end
|
11
|
+
|
12
|
+
def init
|
13
|
+
lcd = Qt::LCDNumber.new(2)
|
14
|
+
@slider = Qt::Slider.new(Qt::Horizontal) do |s|
|
15
|
+
s.range = 0..99
|
16
|
+
s.value = 0
|
17
|
+
end
|
18
|
+
|
19
|
+
@label = Qt::Label.new do |l|
|
20
|
+
l.alignment = Qt::AlignHCenter.to_i | Qt::AlignTop.to_i
|
21
|
+
l.setSizePolicy(Qt::SizePolicy::Preferred, Qt::SizePolicy::Fixed)
|
22
|
+
end
|
23
|
+
|
24
|
+
connect(@slider, SIGNAL('valueChanged(int)'), lcd, SLOT('display(int)'))
|
25
|
+
connect(@slider, SIGNAL('valueChanged(int)'), SIGNAL('valueChanged(int)'))
|
26
|
+
|
27
|
+
self.layout = Qt::VBoxLayout.new do |l|
|
28
|
+
l.addWidget(lcd)
|
29
|
+
l.addWidget(@slider)
|
30
|
+
l.addWidget(@label)
|
31
|
+
end
|
32
|
+
|
33
|
+
setFocusProxy(@slider)
|
34
|
+
end
|
35
|
+
|
36
|
+
def value
|
37
|
+
@slider.value
|
38
|
+
end
|
39
|
+
|
40
|
+
def value=(value)
|
41
|
+
@slider.value = value
|
42
|
+
end
|
43
|
+
|
44
|
+
def range=(r)
|
45
|
+
setRange(r.begin, r.end)
|
46
|
+
end
|
47
|
+
|
48
|
+
def setRange(minVal, maxVal)
|
49
|
+
if minVal < 0 || maxVal > 99 || minVal > maxVal
|
50
|
+
qWarning("LCDRange::setRange(#{minVal},#{maxVal})\n" +
|
51
|
+
"\tRange must be 0..99\n" +
|
52
|
+
"\tand minVal must not be greater than maxVal")
|
53
|
+
return
|
54
|
+
end
|
55
|
+
@slider.setRange(minVal, maxVal)
|
56
|
+
end
|
57
|
+
|
58
|
+
def text=(s)
|
59
|
+
@label.text = s
|
60
|
+
end
|
61
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$VERBOSE = true; $:.unshift File.dirname($0)
|
3
|
-
|
4
|
-
require 'Qt'
|
5
|
-
|
6
|
-
|
7
|
-
app = Qt::Application.new(ARGV)
|
8
|
-
board = GameBoard.new
|
9
|
-
board.setGeometry(
|
10
|
-
board.show
|
11
|
-
app.exec
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$VERBOSE = true; $:.unshift File.dirname($0)
|
3
|
+
|
4
|
+
require 'Qt'
|
5
|
+
require_relative 'gamebrd.rb'
|
6
|
+
|
7
|
+
app = Qt::Application.new(ARGV)
|
8
|
+
board = GameBoard.new
|
9
|
+
board.setGeometry(100, 100, 500, 355)
|
10
|
+
board.show
|
11
|
+
app.exec
|
data/examples/tutorial/t3/t3.rb
CHANGED
@@ -1,18 +1,17 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$VERBOSE = true; $:.unshift File.dirname($0)
|
3
|
-
|
4
|
-
require 'Qt'
|
5
|
-
|
6
|
-
app = Qt::Application.new(ARGV)
|
7
|
-
|
8
|
-
window = Qt::Widget.new
|
9
|
-
window.resize(200, 120)
|
10
|
-
|
11
|
-
quit = Qt::PushButton.new('Quit', window)
|
12
|
-
quit.font = Qt::Font.new('Times', 18, Qt::Font::Bold)
|
13
|
-
quit.setGeometry(10, 40, 180, 40)
|
14
|
-
app.connect(quit, SIGNAL('clicked()'), app, SLOT('quit()'))
|
15
|
-
|
16
|
-
window.show
|
17
|
-
app.exec
|
18
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$VERBOSE = true; $:.unshift File.dirname($0)
|
3
|
+
|
4
|
+
require 'Qt'
|
5
|
+
|
6
|
+
app = Qt::Application.new(ARGV)
|
7
|
+
|
8
|
+
window = Qt::Widget.new
|
9
|
+
window.resize(200, 120)
|
10
|
+
|
11
|
+
quit = Qt::PushButton.new('Quit', window)
|
12
|
+
quit.font = Qt::Font.new('Times', 18, Qt::Font::Bold)
|
13
|
+
quit.setGeometry(10, 40, 180, 40)
|
14
|
+
app.connect(quit, SIGNAL('clicked()'), app, SLOT('quit()'))
|
15
|
+
|
16
|
+
window.show
|
17
|
+
app.exec
|
data/examples/tutorial/t4/t4.rb
CHANGED
@@ -1,25 +1,23 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$VERBOSE = true; $:.unshift File.dirname($0)
|
3
|
-
|
4
|
-
require 'Qt'
|
5
|
-
|
6
|
-
class MyWidget < Qt::Widget
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
quit
|
13
|
-
quit.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
widget.show
|
25
|
-
app.exec
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$VERBOSE = true; $:.unshift File.dirname($0)
|
3
|
+
|
4
|
+
require 'Qt'
|
5
|
+
|
6
|
+
class MyWidget < Qt::Widget
|
7
|
+
def initialize(parent = nil)
|
8
|
+
super
|
9
|
+
setFixedSize(200, 120)
|
10
|
+
|
11
|
+
quit = Qt::PushButton.new('Quit', self)
|
12
|
+
quit.setGeometry(62, 40, 75, 30)
|
13
|
+
quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))
|
14
|
+
|
15
|
+
connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
app = Qt::Application.new(ARGV)
|
20
|
+
|
21
|
+
widget = MyWidget.new
|
22
|
+
widget.show
|
23
|
+
app.exec
|