qtbindings 4.8.6.3-x64-mingw32 → 4.8.6.4-x64-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.2 → 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 -114
  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/libsmokeqtgui.dll +0 -0
  108. data/lib/2.1/libsmokeqthelp.dll +0 -0
  109. data/lib/2.1/libsmokeqtmultimedia.dll +0 -0
  110. data/lib/2.1/libsmokeqtnetwork.dll +0 -0
  111. data/lib/2.1/libsmokeqtopengl.dll +0 -0
  112. data/lib/2.1/libsmokeqtscript.dll +0 -0
  113. data/lib/2.1/libsmokeqtsql.dll +0 -0
  114. data/lib/2.1/libsmokeqtsvg.dll +0 -0
  115. data/lib/2.1/libsmokeqttest.dll +0 -0
  116. data/lib/2.1/libsmokeqtuitools.dll +0 -0
  117. data/lib/2.1/libsmokeqtwebkit.dll +0 -0
  118. data/lib/2.1/libsmokeqtxml.dll +0 -0
  119. data/lib/2.1/libsmokeqtxmlpatterns.dll +0 -0
  120. data/lib/2.1/qtdeclarative.so +0 -0
  121. data/lib/2.1/qtruby4.so +0 -0
  122. data/lib/2.1/qtscript.so +0 -0
  123. data/lib/2.1/qttest.so +0 -0
  124. data/lib/2.1/qtuitools.so +0 -0
  125. data/lib/2.1/qtwebkit.so +0 -0
  126. data/lib/2.2/libqtruby4shared.dll +0 -0
  127. data/lib/2.2/libsmokebase.dll +0 -0
  128. data/lib/2.2/libsmokeqtcore.dll +0 -0
  129. data/lib/2.2/libsmokeqtdeclarative.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,43 +1,43 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = true; $:.unshift File.dirname($0)
3
-
4
- require 'Qt'
5
- require './lcdrange.rb'
6
- require './cannon.rb'
7
-
8
- class MyWidget < Qt::Widget
9
- def initialize(parent = nil)
10
- super
11
- quit = Qt::PushButton.new('Quit')
12
- quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))
13
-
14
- connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
15
-
16
- angle = LCDRange.new( self )
17
- angle.range = 5..70
18
-
19
- cannonField = CannonField.new( self )
20
-
21
- connect( angle, SIGNAL('valueChanged(int)'),
22
- cannonField, SLOT('setAngle(int)') )
23
- connect( cannonField, SIGNAL('angleChanged(int)'),
24
- angle, SLOT('setValue(int)') )
25
-
26
- gridLayout = Qt::GridLayout.new
27
- gridLayout.addWidget( quit, 0, 0 )
28
- gridLayout.addWidget( angle, 1, 0 )
29
- gridLayout.addWidget( cannonField, 1, 1, 2, 1 )
30
- gridLayout.setColumnStretch( 1, 10 )
31
- setLayout( gridLayout )
32
-
33
- angle.setValue( 60 )
34
- angle.setFocus()
35
- end
36
- end
37
-
38
- a = Qt::Application.new(ARGV)
39
-
40
- w = MyWidget.new
41
- w.setGeometry( 100, 100, 500, 355 )
42
- w.show
43
- a.exec
1
+ #!/usr/bin/env ruby
2
+ $VERBOSE = true; $:.unshift File.dirname($0)
3
+
4
+ require 'Qt'
5
+ require_relative 'lcdrange.rb'
6
+ require_relative 'cannon.rb'
7
+
8
+ class MyWidget < Qt::Widget
9
+ def initialize(parent = nil)
10
+ super
11
+ quit = Qt::PushButton.new('Quit')
12
+ quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))
13
+
14
+ connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
15
+
16
+ angle = LCDRange.new(self)
17
+ angle.range = 5..70
18
+
19
+ cannonField = CannonField.new(self)
20
+
21
+ connect(angle, SIGNAL('valueChanged(int)'),
22
+ cannonField, SLOT('setAngle(int)'))
23
+ connect(cannonField, SIGNAL('angleChanged(int)'),
24
+ angle, SLOT('setValue(int)'))
25
+
26
+ gridLayout = Qt::GridLayout.new
27
+ gridLayout.addWidget(quit, 0, 0)
28
+ gridLayout.addWidget(angle, 1, 0)
29
+ gridLayout.addWidget(cannonField, 1, 1, 2, 1)
30
+ gridLayout.setColumnStretch(1, 10)
31
+ setLayout(gridLayout)
32
+
33
+ angle.setValue(60)
34
+ angle.setFocus()
35
+ end
36
+ end
37
+
38
+ a = Qt::Application.new(ARGV)
39
+
40
+ w = MyWidget.new
41
+ w.setGeometry(100, 100, 500, 355)
42
+ w.show
43
+ a.exec
@@ -1,45 +1,44 @@
1
- require 'Qt'
2
-
3
- class CannonField < Qt::Widget
4
- signals 'angleChanged(int)'
5
- slots 'setAngle(int)'
6
-
7
- def initialize(parent = nil)
8
- super
9
- @currentAngle = 45
10
- setPalette( Qt::Palette.new( Qt::Color.new( 250, 250, 200) ) )
11
- setAutoFillBackground(true)
12
- end
13
-
14
- def setAngle( degrees )
15
- if degrees < 5
16
- degrees = 5
17
- elsif degrees > 70
18
- degrees = 70
19
- end
20
- if @currentAngle == degrees
21
- return
22
- end
23
- @currentAngle = degrees
24
- repaint()
25
- emit angleChanged( @currentAngle )
26
- end
27
-
28
- def paintEvent( event )
29
- painter = Qt::Painter.new( self )
30
-
31
- painter.setPen( Qt::NoPen )
32
- painter.setBrush( Qt::Brush.new(Qt::blue) )
33
-
34
- painter.translate( 0, rect().bottom() )
35
- painter.drawPie( Qt::Rect.new(-35, -35, 70, 70), 0, 90*16 )
36
- painter.rotate( - @currentAngle )
37
- painter.drawRect( Qt::Rect.new(33, -4, 15, 8) )
38
- painter.end()
39
- end
40
-
41
-
42
- def sizePolicy()
43
- return Qt::SizePolicy.new( Qt::SizePolicy::Expanding, Qt::SizePolicy::Expanding )
44
- end
45
- end
1
+ require 'Qt'
2
+
3
+ class CannonField < Qt::Widget
4
+ signals 'angleChanged(int)'
5
+ slots 'setAngle(int)'
6
+
7
+ def initialize(parent = nil)
8
+ super
9
+ @currentAngle = 45
10
+ setPalette(Qt::Palette.new(Qt::Color.new(250, 250, 200)))
11
+ setAutoFillBackground(true)
12
+ end
13
+
14
+ def setAngle(degrees)
15
+ if degrees < 5
16
+ degrees = 5
17
+ elsif degrees > 70
18
+ degrees = 70
19
+ end
20
+ if @currentAngle == degrees
21
+ return
22
+ end
23
+ @currentAngle = degrees
24
+ repaint()
25
+ emit angleChanged(@currentAngle)
26
+ end
27
+
28
+ def paintEvent(event)
29
+ painter = Qt::Painter.new(self)
30
+
31
+ painter.setPen(Qt::NoPen)
32
+ painter.setBrush(Qt::Brush.new(Qt::blue))
33
+
34
+ painter.translate(0, rect().bottom())
35
+ painter.drawPie(Qt::Rect.new(-35, -35, 70, 70), 0, 90 * 16)
36
+ painter.rotate(- @currentAngle)
37
+ painter.drawRect(Qt::Rect.new(33, -4, 15, 8))
38
+ painter.end()
39
+ end
40
+
41
+ def sizePolicy()
42
+ return Qt::SizePolicy.new(Qt::SizePolicy::Expanding, Qt::SizePolicy::Expanding)
43
+ end
44
+ end
@@ -1,46 +1,46 @@
1
- require 'Qt'
2
-
3
- class LCDRange < Qt::Widget
4
- signals 'valueChanged(int)'
5
- slots 'setValue(int)', 'setRange(int, int)'
6
-
7
- def initialize(parent = nil)
8
- super
9
- lcd = Qt::LCDNumber.new(2)
10
- @slider = Qt::Slider.new(Qt::Horizontal)
11
- @slider.range = 0..99
12
- @slider.setValue(0)
13
- connect(@slider, SIGNAL('valueChanged(int)'), lcd, SLOT('display(int)'))
14
- connect(@slider, SIGNAL('valueChanged(int)'), SIGNAL('valueChanged(int)'))
15
-
16
- layout = Qt::VBoxLayout.new
17
- layout.addWidget(lcd)
18
- layout.addWidget(@slider)
19
- setLayout(layout)
20
-
21
- setFocusProxy(@slider)
22
- end
23
-
24
- def value()
25
- @slider.value()
26
- end
27
-
28
- def setValue( value )
29
- @slider.setValue( value )
30
- end
31
-
32
- def range=( r )
33
- setRange(r.begin, r.end)
34
- end
35
-
36
- def setRange( minVal, maxVal )
37
- if minVal < 0 || maxVal > 99 || minVal > maxVal
38
- printf( "LCDRange::setRange(%d,%d)\n" +
39
- "\tRange must be 0..99\n" +
40
- "\tand minVal must not be greater than maxVal",
41
- minVal, maxVal )
42
- return
43
- end
44
- @slider.setRange( minVal, maxVal )
45
- end
46
- end
1
+ require 'Qt'
2
+
3
+ class LCDRange < Qt::Widget
4
+ signals 'valueChanged(int)'
5
+ slots 'setValue(int)', 'setRange(int, int)'
6
+
7
+ def initialize(parent = nil)
8
+ super
9
+ lcd = Qt::LCDNumber.new(2)
10
+ @slider = Qt::Slider.new(Qt::Horizontal)
11
+ @slider.range = 0..99
12
+ @slider.setValue(0)
13
+ connect(@slider, SIGNAL('valueChanged(int)'), lcd, SLOT('display(int)'))
14
+ connect(@slider, SIGNAL('valueChanged(int)'), SIGNAL('valueChanged(int)'))
15
+
16
+ layout = Qt::VBoxLayout.new
17
+ layout.addWidget(lcd)
18
+ layout.addWidget(@slider)
19
+ setLayout(layout)
20
+
21
+ setFocusProxy(@slider)
22
+ end
23
+
24
+ def value()
25
+ @slider.value()
26
+ end
27
+
28
+ def setValue(value)
29
+ @slider.setValue(value)
30
+ end
31
+
32
+ def range=(r)
33
+ setRange(r.begin, r.end)
34
+ end
35
+
36
+ def setRange(minVal, maxVal)
37
+ if minVal < 0 || maxVal > 99 || minVal > maxVal
38
+ printf("LCDRange::setRange(%d,%d)\n" +
39
+ "\tRange must be 0..99\n" +
40
+ "\tand minVal must not be greater than maxVal",
41
+ minVal, maxVal)
42
+ return
43
+ end
44
+ @slider.setRange(minVal, maxVal)
45
+ end
46
+ end
@@ -1,43 +1,43 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = true; $:.unshift File.dirname($0)
3
-
4
- require 'Qt'
5
- require './lcdrange.rb'
6
- require './cannon.rb'
7
-
8
- class MyWidget < Qt::Widget
9
- def initialize(parent = nil)
10
- super
11
- quit = Qt::PushButton.new('Quit')
12
- quit.font = Qt::Font.new('Times', 18, Qt::Font::Bold)
13
-
14
- connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
15
-
16
- angle = LCDRange.new( self )
17
- angle.range = 5..70
18
-
19
- cannonField = CannonField.new( self )
20
-
21
- connect( angle, SIGNAL('valueChanged(int)'),
22
- cannonField, SLOT('setAngle(int)') )
23
- connect( cannonField, SIGNAL('angleChanged(int)'),
24
- angle, SLOT('setValue(int)') )
25
- gridLayout = Qt::GridLayout.new
26
-
27
- gridLayout.addWidget( quit, 0, 0 )
28
- gridLayout.addWidget( angle, 1, 0 )
29
- gridLayout.addWidget( cannonField, 1, 1, 2, 1 )
30
- gridLayout.setColumnStretch( 1, 10 )
31
- setLayout( gridLayout )
32
-
33
- angle.setValue( 60 )
34
- angle.setFocus()
35
- end
36
- end
37
-
38
- a = Qt::Application.new(ARGV)
39
-
40
- w = MyWidget.new
41
- w.setGeometry( 100, 100, 500, 355 )
42
- w.show
43
- a.exec
1
+ #!/usr/bin/env ruby
2
+ $VERBOSE = true; $:.unshift File.dirname($0)
3
+
4
+ require 'Qt'
5
+ require_relative 'lcdrange.rb'
6
+ require_relative 'cannon.rb'
7
+
8
+ class MyWidget < Qt::Widget
9
+ def initialize(parent = nil)
10
+ super
11
+ quit = Qt::PushButton.new('Quit')
12
+ quit.font = Qt::Font.new('Times', 18, Qt::Font::Bold)
13
+
14
+ connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
15
+
16
+ angle = LCDRange.new(self)
17
+ angle.range = 5..70
18
+
19
+ cannonField = CannonField.new(self)
20
+
21
+ connect(angle, SIGNAL('valueChanged(int)'),
22
+ cannonField, SLOT('setAngle(int)'))
23
+ connect(cannonField, SIGNAL('angleChanged(int)'),
24
+ angle, SLOT('setValue(int)'))
25
+ gridLayout = Qt::GridLayout.new
26
+
27
+ gridLayout.addWidget(quit, 0, 0)
28
+ gridLayout.addWidget(angle, 1, 0)
29
+ gridLayout.addWidget(cannonField, 1, 1, 2, 1)
30
+ gridLayout.setColumnStretch(1, 10)
31
+ setLayout(gridLayout)
32
+
33
+ angle.setValue(60)
34
+ angle.setFocus()
35
+ end
36
+ end
37
+
38
+ a = Qt::Application.new(ARGV)
39
+
40
+ w = MyWidget.new
41
+ w.setGeometry(100, 100, 500, 355)
42
+ w.show
43
+ a.exec
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/Qt4.rb CHANGED
@@ -1,111 +1,119 @@
1
- windows = false
2
- platform = RUBY_PLATFORM.split("-")[1]
3
- windows = true if platform =~ /mswin32/ or platform =~ /mingw32/
4
-
5
- begin
6
- require 'thread'
7
- require 'qtbindings-qt'
8
- rescue LoadError
9
- # Oh well - Hopefully not using the Windows binary gem
10
- end
11
-
12
- ruby_version = RUBY_VERSION.split('.')[0..1].join('.')
13
- if windows
14
- ENV['PATH'] = File.join(File.dirname(__FILE__), '../bin') + ';' + File.join(File.dirname(__FILE__), "../lib/#{ruby_version}") + ';' + File.join(File.dirname(__FILE__), "../bin/#{ruby_version}") + ';' + ENV['PATH']
15
- end
16
- $: << File.join(File.dirname(__FILE__), "../lib/#{ruby_version}")
17
- require "#{ruby_version}/qtruby4"
18
-
19
- module Qt
20
- class RubyThreadFix < Qt::Object
21
- slots 'ruby_thread_timeout()'
22
- slots 'callback_timeout()'
23
- slots 'callback_timeout2()'
24
- @@queue = Queue.new
25
-
26
- def initialize
27
- super()
28
- # Enable threading
29
- @ruby_thread_sleep_period = 0.01
30
- @ruby_thread_timer = Qt::Timer.new(self)
31
- connect(@ruby_thread_timer, SIGNAL('timeout()'), SLOT('ruby_thread_timeout()'))
32
- @ruby_thread_timer.start(0)
33
- @callback_timer = Qt::Timer.new(self)
34
- connect(@callback_timer, SIGNAL('timeout()'), SLOT('callback_timeout()'))
35
- @callback_timer.start(1)
36
- @callback_timer2 = Qt::Timer.new(self)
37
- connect(@callback_timer2, SIGNAL('timeout()'), SLOT('callback_timeout2()'))
38
- @running = true
39
- end
40
-
41
- def ruby_thread_timeout
42
- sleep(@ruby_thread_sleep_period)
43
- end
44
-
45
- def callback_timeout
46
- if !@@queue.empty?
47
- # Start a backup timer in case this one goes modal.
48
- @callback_timer2.start(100)
49
- @@queue.pop.call until @@queue.empty?
50
- # Cancel the backup timer
51
- @callback_timer2.stop if @callback_timer2
52
- end
53
- end
54
-
55
- def callback_timeout2
56
- @callback_timer2.interval = 10
57
- @@queue.pop.call until @@queue.empty?
58
- end
59
-
60
- def self.queue
61
- @@queue
62
- end
63
-
64
- def stop
65
- if @running
66
- @running = false
67
- @ruby_thread_timer.stop
68
- @callback_timer.stop
69
- @callback_timer2.stop
70
- @ruby_thread_timer.dispose
71
- @callback_timer.dispose
72
- @callback_timer2.dispose
73
- @ruby_thread_timer = nil
74
- @callback_timer = nil
75
- @callback_timer2 = nil
76
- end
77
- end
78
- end
79
-
80
- # Code which accesses the GUI must be executed in the main QT GUI thread.
81
- # This method allows code in another thread to execute safely in the main GUI
82
- # thread. By default it will block the main GUI thread until the code in the
83
- # block completes althought this can be changed by passing false for the
84
- # first parameter.
85
- #
86
- # @param blocking [Boolean] Whether to block the main thread until the code
87
- # in the block finishing executing. If false the main thread will be
88
- # allowed to continue and the block code will execute in parallel.
89
- # @param sleep_period [Float] The amount of time to sleep between checking
90
- # whether the code in the block has finished executing
91
- # @param delay_execution [Boolean] Only used if called from the main GUI
92
- # thread. Allows the block to be executed in parallel with the main thread.
93
- def self.execute_in_main_thread (blocking = true, sleep_period = 0.001, delay_execution = false)
94
- if Thread.current != Thread.main
95
- complete = false
96
- RubyThreadFix.queue << lambda {|| yield; complete = true}
97
- if blocking
98
- until complete
99
- sleep(sleep_period)
100
- end
101
- end
102
- else
103
- if delay_execution
104
- RubyThreadFix.queue << lambda {|| yield; complete = true}
105
- else
106
- yield
107
- end
108
- end
109
- end
110
-
111
- end # module Qt
1
+ windows = false
2
+ platform = RUBY_PLATFORM.split("-")[1]
3
+ windows = true if platform =~ /mswin32/ or platform =~ /mingw32/
4
+
5
+ begin
6
+ require 'thread'
7
+ require 'qtbindings-qt'
8
+ rescue LoadError
9
+ # Oh well - Hopefully not using the Windows binary gem
10
+ end
11
+
12
+ ruby_version = RUBY_VERSION.split('.')[0..1].join('.')
13
+ if windows
14
+ ENV['PATH'] = File.join(File.dirname(__FILE__), '../bin') + ';' + File.join(File.dirname(__FILE__), "../lib/#{ruby_version}") + ';' + File.join(File.dirname(__FILE__), "../bin/#{ruby_version}") + ';' + ENV['PATH']
15
+ begin
16
+ require 'ruby_installer'
17
+ RubyInstaller::Runtime.add_dll_directory(File.join(File.dirname(__FILE__), '../bin'))
18
+ RubyInstaller::Runtime.add_dll_directory(File.join(File.dirname(__FILE__), "../lib/#{ruby_version}"))
19
+ RubyInstaller::Runtime.add_dll_directory(File.join(File.dirname(__FILE__), "../bin/#{ruby_version}"))
20
+ rescue
21
+ # Oh well - Hopefully not Ruby 2.4+ on windows
22
+ end
23
+ end
24
+ $: << File.join(File.dirname(__FILE__), "../lib/#{ruby_version}")
25
+ require "#{ruby_version}/qtruby4"
26
+
27
+ module Qt
28
+ class RubyThreadFix < Qt::Object
29
+ slots 'ruby_thread_timeout()'
30
+ slots 'callback_timeout()'
31
+ slots 'callback_timeout2()'
32
+ @@queue = Queue.new
33
+
34
+ def initialize
35
+ super()
36
+ # Enable threading
37
+ @ruby_thread_sleep_period = 0.01
38
+ @ruby_thread_timer = Qt::Timer.new(self)
39
+ connect(@ruby_thread_timer, SIGNAL('timeout()'), SLOT('ruby_thread_timeout()'))
40
+ @ruby_thread_timer.start(0)
41
+ @callback_timer = Qt::Timer.new(self)
42
+ connect(@callback_timer, SIGNAL('timeout()'), SLOT('callback_timeout()'))
43
+ @callback_timer.start(1)
44
+ @callback_timer2 = Qt::Timer.new(self)
45
+ connect(@callback_timer2, SIGNAL('timeout()'), SLOT('callback_timeout2()'))
46
+ @running = true
47
+ end
48
+
49
+ def ruby_thread_timeout
50
+ sleep(@ruby_thread_sleep_period)
51
+ end
52
+
53
+ def callback_timeout
54
+ if !@@queue.empty?
55
+ # Start a backup timer in case this one goes modal.
56
+ @callback_timer2.start(100)
57
+ @@queue.pop.call until @@queue.empty?
58
+ # Cancel the backup timer
59
+ @callback_timer2.stop if @callback_timer2
60
+ end
61
+ end
62
+
63
+ def callback_timeout2
64
+ @callback_timer2.interval = 10
65
+ @@queue.pop.call until @@queue.empty?
66
+ end
67
+
68
+ def self.queue
69
+ @@queue
70
+ end
71
+
72
+ def stop
73
+ if @running
74
+ @running = false
75
+ @ruby_thread_timer.stop
76
+ @callback_timer.stop
77
+ @callback_timer2.stop
78
+ @ruby_thread_timer.dispose
79
+ @callback_timer.dispose
80
+ @callback_timer2.dispose
81
+ @ruby_thread_timer = nil
82
+ @callback_timer = nil
83
+ @callback_timer2 = nil
84
+ end
85
+ end
86
+ end
87
+
88
+ # Code which accesses the GUI must be executed in the main QT GUI thread.
89
+ # This method allows code in another thread to execute safely in the main GUI
90
+ # thread. By default it will block the main GUI thread until the code in the
91
+ # block completes althought this can be changed by passing false for the
92
+ # first parameter.
93
+ #
94
+ # @param blocking [Boolean] Whether to block the main thread until the code
95
+ # in the block finishing executing. If false the main thread will be
96
+ # allowed to continue and the block code will execute in parallel.
97
+ # @param sleep_period [Float] The amount of time to sleep between checking
98
+ # whether the code in the block has finished executing
99
+ # @param delay_execution [Boolean] Only used if called from the main GUI
100
+ # thread. Allows the block to be executed in parallel with the main thread.
101
+ def self.execute_in_main_thread (blocking = true, sleep_period = 0.001, delay_execution = false)
102
+ if Thread.current != Thread.main
103
+ complete = false
104
+ RubyThreadFix.queue << lambda {|| yield; complete = true}
105
+ if blocking
106
+ until complete
107
+ sleep(sleep_period)
108
+ end
109
+ end
110
+ else
111
+ if delay_execution
112
+ RubyThreadFix.queue << lambda {|| yield; complete = true}
113
+ else
114
+ yield
115
+ end
116
+ end
117
+ end
118
+
119
+ end # module Qt