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