qtbindings 4.8.3.0 → 4.8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Rakefile +1 -2
- data/bin/rbrcc +5 -5
- data/bin/rbuic4 +5 -5
- data/bin/smokeapi +5 -5
- data/bin/smokedeptool +5 -5
- data/{CHANGELOG.txt → changelog.txt} +15 -0
- data/examples/desktop/screenshot/screenshot.rb +10 -9
- data/ext/cmake/modules/FindRuby.cmake +1 -1
- data/ext/ruby/qtruby/src/handlers.cpp +186 -176
- data/ext/ruby/qtruby/src/{Qt.cpp → qt.cpp} +135 -114
- data/ext/ruby/qtruby/src/qtruby.cpp +4 -1
- data/extconf.rb +20 -12
- data/{KNOWN_ISSUES.txt → known_issues.txt} +0 -2
- data/lib/Qt/qtruby4.rb +261 -237
- data/lib/qt4.rb +101 -0
- data/lib/qtbindings_version.rb +2 -2
- data/qtbindings.gemspec +1 -1
- data/qtbindingsnative.gemspec +1 -1
- data/{README.txt → readme.txt} +127 -119
- data/{TODO.txt → todo.txt} +0 -1
- metadata +13 -14
- data/lib/Qt4.rb +0 -20
@@ -1391,11 +1391,14 @@ qt_signal(int argc, VALUE * argv, VALUE self)
|
|
1391
1391
|
return Qfalse;
|
1392
1392
|
}
|
1393
1393
|
|
1394
|
-
#if RUBY_VERSION >=
|
1394
|
+
#if RUBY_VERSION >= 0x20000
|
1395
|
+
QLatin1String signalname(rb_id2name(rb_frame_this_func()));
|
1396
|
+
#elif RUBY_VERSION >= 0x10900
|
1395
1397
|
QLatin1String signalname(rb_id2name(rb_frame_callee()));
|
1396
1398
|
#else
|
1397
1399
|
QLatin1String signalname(rb_id2name(rb_frame_last_func()));
|
1398
1400
|
#endif
|
1401
|
+
|
1399
1402
|
VALUE metaObject_value = rb_funcall(qt_internal_module, rb_intern("getMetaObject"), 2, Qnil, self);
|
1400
1403
|
|
1401
1404
|
smokeruby_object *ometa = value_obj_info(metaObject_value);
|
data/extconf.rb
CHANGED
@@ -6,16 +6,24 @@
|
|
6
6
|
windows = false
|
7
7
|
macosx = false
|
8
8
|
processor, platform, *rest = RUBY_PLATFORM.split("-")
|
9
|
-
windows = true if platform
|
9
|
+
windows = true if platform =~ /mswin32/ or platform =~ /mingw32/
|
10
10
|
macosx = true if platform =~ /darwin/
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
ruby_version_split = RUBY_VERSION.split('.')
|
13
|
+
if ruby_version_split[0].to_i == 1
|
14
|
+
ruby_version = '1.9'
|
15
|
+
if ruby_version_split[1].to_i == 8
|
16
|
+
puts "Ruby 1.8.x is no longer supported. Install qtbindings 4.8.3.0. gem install qtbindings -v 4.8.3.0"
|
17
|
+
exit
|
18
|
+
end
|
19
|
+
else
|
20
|
+
ruby_version = '2.0'
|
21
|
+
end
|
14
22
|
|
15
23
|
if windows
|
16
24
|
# README! - Modify this path if you have QT installed somewhere else
|
17
25
|
# or if you have a different version of QT you want to link to.
|
18
|
-
qt_sdk_path = "C:\\Qt\\4.8.
|
26
|
+
qt_sdk_path = "C:\\Qt\\4.8.5"
|
19
27
|
begin
|
20
28
|
File::Stat.new(qt_sdk_path)
|
21
29
|
rescue
|
@@ -30,8 +38,8 @@ File.open('Makefile', 'w') do |file|
|
|
30
38
|
file.puts ""
|
31
39
|
file.puts "makedirs:"
|
32
40
|
file.puts "\t-mkdir ext\\build"
|
33
|
-
file.puts "\t-mkdir bin\\1.8"
|
34
41
|
file.puts "\t-mkdir bin\\1.9"
|
42
|
+
file.puts "\t-mkdir bin\\2.0"
|
35
43
|
file.puts "\t-mkdir bin\\plugins"
|
36
44
|
file.puts "\t-mkdir bin\\plugins\\accessible"
|
37
45
|
file.puts "\t-mkdir bin\\plugins\\bearer"
|
@@ -43,8 +51,8 @@ File.open('Makefile', 'w') do |file|
|
|
43
51
|
file.puts "\t-mkdir bin\\plugins\\phonon_backend"
|
44
52
|
file.puts "\t-mkdir bin\\plugins\\qmltooling"
|
45
53
|
file.puts "\t-mkdir bin\\plugins\\sqldrivers"
|
46
|
-
file.puts "\t-mkdir lib\\1.8"
|
47
54
|
file.puts "\t-mkdir lib\\1.9"
|
55
|
+
file.puts "\t-mkdir lib\\2.0"
|
48
56
|
file.puts ""
|
49
57
|
file.puts "clean: makedirs"
|
50
58
|
file.puts "\t-cd ext\\build && rmdir /S /Q CMakeFiles"
|
@@ -68,10 +76,10 @@ File.open('Makefile', 'w') do |file|
|
|
68
76
|
file.puts "\t-cd bin\\plugins\\phonon_backend && del /F /Q *"
|
69
77
|
file.puts "\t-cd bin\\plugins\\qmltooling && del /F /Q *"
|
70
78
|
file.puts "\t-cd bin\\plugins\\sqldrivers && del /F /Q *"
|
71
|
-
file.puts "\t-cd bin\\1.8 && del /F /Q *"
|
72
79
|
file.puts "\t-cd bin\\1.9 && del /F /Q *"
|
73
|
-
file.puts "\t-cd
|
80
|
+
file.puts "\t-cd bin\\2.0 && del /F /Q *"
|
74
81
|
file.puts "\t-cd lib\\1.9 && del /F /Q *"
|
82
|
+
file.puts "\t-cd lib\\2.0 && del /F /Q *"
|
75
83
|
file.puts "\t-del /F /Q Makefile"
|
76
84
|
file.puts "\t-del /F /Q qtbindings-*.gem"
|
77
85
|
file.puts ""
|
@@ -174,8 +182,8 @@ File.open('Makefile', 'w') do |file|
|
|
174
182
|
file.puts ""
|
175
183
|
file.puts "makedirs:"
|
176
184
|
file.puts "\t-mkdir ext/build"
|
177
|
-
file.puts "\t-mkdir bin/1.8"
|
178
185
|
file.puts "\t-mkdir bin/1.9"
|
186
|
+
file.puts "\t-mkdir bin/2.0"
|
179
187
|
file.puts "\t-mkdir bin/plugins"
|
180
188
|
file.puts "\t-mkdir bin/plugins/accessible"
|
181
189
|
file.puts "\t-mkdir bin/plugins/bearer"
|
@@ -187,8 +195,8 @@ File.open('Makefile', 'w') do |file|
|
|
187
195
|
file.puts "\t-mkdir bin/plugins/phonon_backend"
|
188
196
|
file.puts "\t-mkdir bin/plugins/qmltooling"
|
189
197
|
file.puts "\t-mkdir bin/plugins/sqldrivers"
|
190
|
-
file.puts "\t-mkdir lib/1.8"
|
191
198
|
file.puts "\t-mkdir lib/1.9"
|
199
|
+
file.puts "\t-mkdir lib/2.0"
|
192
200
|
file.puts ""
|
193
201
|
file.puts "clean: makedirs"
|
194
202
|
file.puts "\t-cd ext/build; rm -rf CMakeFiles"
|
@@ -212,10 +220,10 @@ File.open('Makefile', 'w') do |file|
|
|
212
220
|
file.puts "\t-cd bin/plugins/phonon_backend && rm *"
|
213
221
|
file.puts "\t-cd bin/plugins/qmltooling && rm *"
|
214
222
|
file.puts "\t-cd bin/plugins/sqldrivers && rm *"
|
215
|
-
file.puts "\t-cd bin/1.8 && rm *"
|
216
223
|
file.puts "\t-cd bin/1.9 && rm *"
|
217
|
-
file.puts "\t-cd
|
224
|
+
file.puts "\t-cd bin/2.0 && rm *"
|
218
225
|
file.puts "\t-cd lib/1.9 && rm *"
|
226
|
+
file.puts "\t-cd lib/2.0 && rm *"
|
219
227
|
file.puts "\t-rm Makefile"
|
220
228
|
file.puts "\t-rm qtbindings-*.gem"
|
221
229
|
file.puts ""
|
@@ -2,7 +2,6 @@
|
|
2
2
|
gem install opengl --pre
|
3
3
|
2. The qRgb macro doesn't appear to work correctly
|
4
4
|
3. The following examples fail on Windows:
|
5
|
-
opengl/textures -> Segfault
|
6
5
|
itemview/dirview -> Hangs
|
7
6
|
network/broadcastsender -> writeDatagram(const char* data, ...) fails
|
8
7
|
network/broadcastreceiver -> readDatagram(char* data, ...) fails
|
@@ -12,7 +11,6 @@
|
|
12
11
|
network/broadcastreceiver -> readDatagram(char* data, ...) fails
|
13
12
|
5. The following examples fail on Mac OS X:
|
14
13
|
desktop/screenshot -> QPixmap::scaled: Pixmap is a null pixmap
|
15
|
-
opengl/textures -> glwidget.rb:137
|
16
14
|
network/broadcastsender -> writeDatagram(const char* data, ...) fails
|
17
15
|
network/broadcastreceiver -> readDatagram(char* data, ...) fails
|
18
16
|
|
data/lib/Qt/qtruby4.rb
CHANGED
@@ -18,11 +18,12 @@
|
|
18
18
|
=end
|
19
19
|
|
20
20
|
module Qt
|
21
|
+
|
21
22
|
module DebugLevel
|
22
23
|
Off, Minimal, High, Extensive = 0, 1, 2, 3
|
23
24
|
end
|
24
25
|
|
25
|
-
module QtDebugChannel
|
26
|
+
module QtDebugChannel
|
26
27
|
QTDB_NONE = 0x00
|
27
28
|
QTDB_AMBIGUOUS = 0x01
|
28
29
|
QTDB_METHOD_MISSING = 0x02
|
@@ -42,7 +43,7 @@ module Qt
|
|
42
43
|
def Qt.debug_level
|
43
44
|
@@debug_level
|
44
45
|
end
|
45
|
-
|
46
|
+
|
46
47
|
module Internal
|
47
48
|
#
|
48
49
|
# From the enum MethodFlags in qt-copy/src/tools/moc/generator.cpp
|
@@ -57,14 +58,14 @@ module Qt
|
|
57
58
|
MethodCloned = 0x20
|
58
59
|
MethodScriptable = 0x40
|
59
60
|
end
|
60
|
-
|
61
|
+
|
61
62
|
class Base
|
62
63
|
def self.signals(*signal_list)
|
63
64
|
meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
|
64
65
|
meta.add_signals(signal_list, Internal::MethodSignal | Internal::AccessProtected)
|
65
66
|
meta.changed = true
|
66
67
|
end
|
67
|
-
|
68
|
+
|
68
69
|
def self.slots(*slot_list)
|
69
70
|
meta = Qt::Meta[self.name] || Qt::MetaInfo.new(self)
|
70
71
|
meta.add_slots(slot_list, Internal::MethodSlot | Internal::AccessPublic)
|
@@ -186,7 +187,7 @@ module Qt
|
|
186
187
|
loop do
|
187
188
|
classid = Qt::Internal::find_pclassid(klass.name)
|
188
189
|
break if classid.index
|
189
|
-
|
190
|
+
|
190
191
|
klass = klass.superclass
|
191
192
|
if klass.nil?
|
192
193
|
return super
|
@@ -212,24 +213,24 @@ module Qt
|
|
212
213
|
if !regular
|
213
214
|
return singleton_methods
|
214
215
|
end
|
215
|
-
|
216
|
+
|
216
217
|
qt_methods(super, 0x0)
|
217
218
|
end
|
218
|
-
|
219
|
+
|
219
220
|
def protected_methods(all=true)
|
220
221
|
# From smoke.h, Smoke::mf_protected 0x80
|
221
222
|
qt_methods(super, 0x80)
|
222
223
|
end
|
223
|
-
|
224
|
+
|
224
225
|
def public_methods(all=true)
|
225
226
|
methods
|
226
227
|
end
|
227
|
-
|
228
|
+
|
228
229
|
def singleton_methods(all=true)
|
229
230
|
# From smoke.h, Smoke::mf_static 0x01
|
230
231
|
qt_methods(super, 0x01)
|
231
232
|
end
|
232
|
-
|
233
|
+
|
233
234
|
private
|
234
235
|
def qt_methods(meths, flags)
|
235
236
|
ids = []
|
@@ -243,60 +244,60 @@ module Qt
|
|
243
244
|
return meths.uniq
|
244
245
|
end
|
245
246
|
end # Qt::Base
|
246
|
-
|
247
|
+
|
247
248
|
# Provides a mutable numeric class for passing to methods with
|
248
249
|
# C++ 'int*' or 'int&' arg types
|
249
250
|
class Integer
|
250
251
|
attr_accessor :value
|
251
252
|
def initialize(n=0) @value = n end
|
252
|
-
|
253
|
-
def +(n)
|
254
|
-
return Integer.new(@value + n.to_i)
|
253
|
+
|
254
|
+
def +(n)
|
255
|
+
return Integer.new(@value + n.to_i)
|
255
256
|
end
|
256
|
-
def -(n)
|
257
|
+
def -(n)
|
257
258
|
return Integer.new(@value - n.to_i)
|
258
259
|
end
|
259
|
-
def *(n)
|
260
|
+
def *(n)
|
260
261
|
return Integer.new(@value * n.to_i)
|
261
262
|
end
|
262
|
-
def /(n)
|
263
|
+
def /(n)
|
263
264
|
return Integer.new(@value / n.to_i)
|
264
265
|
end
|
265
|
-
def %(n)
|
266
|
+
def %(n)
|
266
267
|
return Integer.new(@value % n.to_i)
|
267
268
|
end
|
268
|
-
def **(n)
|
269
|
+
def **(n)
|
269
270
|
return Integer.new(@value ** n.to_i)
|
270
271
|
end
|
271
|
-
|
272
|
-
def |(n)
|
272
|
+
|
273
|
+
def |(n)
|
273
274
|
return Integer.new(@value | n.to_i)
|
274
275
|
end
|
275
|
-
def &(n)
|
276
|
+
def &(n)
|
276
277
|
return Integer.new(@value & n.to_i)
|
277
278
|
end
|
278
|
-
def ^(n)
|
279
|
+
def ^(n)
|
279
280
|
return Integer.new(@value ^ n.to_i)
|
280
281
|
end
|
281
|
-
def <<(n)
|
282
|
+
def <<(n)
|
282
283
|
return Integer.new(@value << n.to_i)
|
283
284
|
end
|
284
|
-
def >>(n)
|
285
|
+
def >>(n)
|
285
286
|
return Integer.new(@value >> n.to_i)
|
286
287
|
end
|
287
|
-
def >(n)
|
288
|
+
def >(n)
|
288
289
|
return @value > n.to_i
|
289
290
|
end
|
290
|
-
def >=(n)
|
291
|
+
def >=(n)
|
291
292
|
return @value >= n.to_i
|
292
293
|
end
|
293
|
-
def <(n)
|
294
|
+
def <(n)
|
294
295
|
return @value < n.to_i
|
295
296
|
end
|
296
|
-
def <=(n)
|
297
|
+
def <=(n)
|
297
298
|
return @value <= n.to_i
|
298
299
|
end
|
299
|
-
|
300
|
+
|
300
301
|
def <=>(n)
|
301
302
|
if @value < n.to_i
|
302
303
|
return -1
|
@@ -306,86 +307,86 @@ module Qt
|
|
306
307
|
return 0
|
307
308
|
end
|
308
309
|
end
|
309
|
-
|
310
|
+
|
310
311
|
def to_f() return @value.to_f end
|
311
312
|
def to_i() return @value.to_i end
|
312
313
|
def to_s() return @value.to_s end
|
313
|
-
|
314
|
+
|
314
315
|
def coerce(n)
|
315
316
|
[n, @value]
|
316
317
|
end
|
317
318
|
end
|
318
|
-
|
319
|
+
|
319
320
|
# If a C++ enum was converted to an ordinary ruby Integer, the
|
320
321
|
# name of the type is lost. The enum type name is needed for overloaded
|
321
322
|
# method resolution when two methods differ only by an enum type.
|
322
323
|
class Enum
|
323
324
|
attr_accessor :type, :value
|
324
325
|
def initialize(n, enum_type)
|
325
|
-
@value = n
|
326
|
+
@value = n
|
326
327
|
@type = enum_type
|
327
328
|
end
|
328
|
-
|
329
|
-
def +(n)
|
329
|
+
|
330
|
+
def +(n)
|
330
331
|
return @value + n.to_i
|
331
332
|
end
|
332
|
-
def -(n)
|
333
|
+
def -(n)
|
333
334
|
return @value - n.to_i
|
334
335
|
end
|
335
|
-
def *(n)
|
336
|
+
def *(n)
|
336
337
|
return @value * n.to_i
|
337
338
|
end
|
338
|
-
def /(n)
|
339
|
+
def /(n)
|
339
340
|
return @value / n.to_i
|
340
341
|
end
|
341
|
-
def %(n)
|
342
|
+
def %(n)
|
342
343
|
return @value % n.to_i
|
343
344
|
end
|
344
|
-
def **(n)
|
345
|
+
def **(n)
|
345
346
|
return @value ** n.to_i
|
346
347
|
end
|
347
|
-
|
348
|
-
def |(n)
|
348
|
+
|
349
|
+
def |(n)
|
349
350
|
return Enum.new(@value | n.to_i, @type)
|
350
351
|
end
|
351
|
-
def &(n)
|
352
|
+
def &(n)
|
352
353
|
return Enum.new(@value & n.to_i, @type)
|
353
354
|
end
|
354
|
-
def ^(n)
|
355
|
+
def ^(n)
|
355
356
|
return Enum.new(@value ^ n.to_i, @type)
|
356
357
|
end
|
357
|
-
def ~()
|
358
|
+
def ~()
|
358
359
|
return ~ @value
|
359
360
|
end
|
360
|
-
def <(n)
|
361
|
+
def <(n)
|
361
362
|
return @value < n.to_i
|
362
363
|
end
|
363
|
-
def <=(n)
|
364
|
+
def <=(n)
|
364
365
|
return @value <= n.to_i
|
365
366
|
end
|
366
|
-
def >(n)
|
367
|
+
def >(n)
|
367
368
|
return @value > n.to_i
|
368
369
|
end
|
369
|
-
def >=(n)
|
370
|
+
def >=(n)
|
370
371
|
return @value >= n.to_i
|
371
372
|
end
|
372
|
-
def <<(n)
|
373
|
+
def <<(n)
|
373
374
|
return Enum.new(@value << n.to_i, @type)
|
374
375
|
end
|
375
|
-
def >>(n)
|
376
|
+
def >>(n)
|
376
377
|
return Enum.new(@value >> n.to_i, @type)
|
377
378
|
end
|
378
|
-
|
379
|
+
|
379
380
|
def ==(n) return @value == n.to_i end
|
380
381
|
def to_i() return @value end
|
381
382
|
|
382
383
|
def to_f() return @value.to_f end
|
383
384
|
def to_s() return @value.to_s end
|
384
|
-
|
385
|
+
|
385
386
|
def coerce(n)
|
386
387
|
[n, @value]
|
387
388
|
end
|
388
|
-
|
389
|
+
|
389
390
|
def inspect
|
390
391
|
to_s
|
391
392
|
end
|
@@ -394,14 +395,14 @@ module Qt
|
|
394
395
|
pp.text "#<%s:0x%8.8x @type=%s, @value=%d>" % [self.class.name, object_id, type, value]
|
395
396
|
end
|
396
397
|
end
|
397
|
-
|
398
|
+
|
398
399
|
# Provides a mutable boolean class for passing to methods with
|
399
400
|
# C++ 'bool*' or 'bool&' arg types
|
400
401
|
class Boolean
|
401
402
|
attr_accessor :value
|
402
403
|
def initialize(b=false) @value = b end
|
403
|
-
def nil?
|
404
|
-
return !@value
|
404
|
+
def nil?
|
405
|
+
return !@value
|
405
406
|
end
|
406
407
|
end
|
407
408
|
|
@@ -427,19 +428,19 @@ module Qt
|
|
427
428
|
end
|
428
429
|
end
|
429
430
|
|
430
|
-
class AccessibleEvent < Qt::Base
|
431
|
+
class AccessibleEvent < Qt::Base
|
431
432
|
def type(*args)
|
432
433
|
method_missing(:type, *args)
|
433
434
|
end
|
434
435
|
end
|
435
436
|
|
436
|
-
class ActionEvent < Qt::Base
|
437
|
+
class ActionEvent < Qt::Base
|
437
438
|
def type(*args)
|
438
439
|
method_missing(:type, *args)
|
439
440
|
end
|
440
441
|
end
|
441
442
|
|
442
|
-
class Action < Qt::Base
|
443
|
+
class Action < Qt::Base
|
443
444
|
def setShortcut(arg)
|
444
445
|
if arg.kind_of?(String)
|
445
446
|
return super(Qt::KeySequence.new(arg))
|
@@ -454,19 +455,29 @@ module Qt
|
|
454
455
|
end
|
455
456
|
|
456
457
|
class Application < Qt::Base
|
458
|
+
attr_reader :thread_fix
|
459
|
+
|
457
460
|
def initialize(*args)
|
458
461
|
if args.length == 1 && args[0].kind_of?(Array)
|
459
462
|
super(args.length + 1, [$0] + args[0])
|
460
463
|
else
|
461
464
|
super(*args)
|
462
465
|
end
|
463
|
-
|
464
|
-
|
466
|
+
$qApp = self
|
467
|
+
@thread_fix = RubyThreadFix.new
|
468
|
+
end
|
469
|
+
|
470
|
+
def disable_threading
|
471
|
+
@thread_fix.stop if @thread_fix
|
472
|
+
@thread_fix = nil
|
473
|
+
end
|
474
|
+
|
465
475
|
# Delete the underlying C++ instance after exec returns
|
466
476
|
# Otherwise, rb_gc_call_finalizer_at_exit() can delete
|
467
477
|
# stuff that Qt::Application still needs for its cleanup.
|
468
478
|
def exec
|
469
479
|
method_missing(:exec)
|
480
|
+
disable_threading()
|
470
481
|
self.dispose
|
471
482
|
Qt::Internal.application_terminated = true
|
472
483
|
end
|
@@ -487,7 +498,7 @@ module Qt
|
|
487
498
|
method_missing(:id, *args)
|
488
499
|
end
|
489
500
|
end
|
490
|
-
|
501
|
+
|
491
502
|
class ByteArray < Qt::Base
|
492
503
|
def initialize(*args)
|
493
504
|
if args.size == 1 && args[0].kind_of?(String)
|
@@ -517,8 +528,8 @@ module Qt
|
|
517
528
|
method_missing(:split, *args)
|
518
529
|
end
|
519
530
|
end
|
520
|
-
|
521
|
-
class CheckBox < Qt::Base
|
531
|
+
|
532
|
+
class CheckBox < Qt::Base
|
522
533
|
def setShortcut(arg)
|
523
534
|
if arg.kind_of?(String)
|
524
535
|
return super(Qt::KeySequence.new(arg))
|
@@ -532,24 +543,24 @@ module Qt
|
|
532
543
|
end
|
533
544
|
end
|
534
545
|
|
535
|
-
class ChildEvent < Qt::Base
|
546
|
+
class ChildEvent < Qt::Base
|
536
547
|
def type(*args)
|
537
548
|
method_missing(:type, *args)
|
538
549
|
end
|
539
550
|
end
|
540
551
|
|
541
|
-
class CloseEvent < Qt::Base
|
552
|
+
class CloseEvent < Qt::Base
|
542
553
|
def type(*args)
|
543
554
|
method_missing(:type, *args)
|
544
555
|
end
|
545
556
|
end
|
546
|
-
|
557
|
+
|
547
558
|
class Color < Qt::Base
|
548
559
|
def inspect
|
549
560
|
str = super
|
550
561
|
str.sub(/>$/, " %s>" % name)
|
551
562
|
end
|
552
|
-
|
563
|
+
|
553
564
|
def pretty_print(pp)
|
554
565
|
str = to_s
|
555
566
|
pp.text str.sub(/>$/, " %s>" % name)
|
@@ -559,14 +570,14 @@ module Qt
|
|
559
570
|
method_missing(:name, *args)
|
560
571
|
end
|
561
572
|
end
|
562
|
-
|
573
|
+
|
563
574
|
class Connection < Qt::Base
|
564
575
|
def inspect
|
565
576
|
str = super
|
566
577
|
str.sub(/>$/, " memberName=%s, memberType=%s, object=%s>" %
|
567
578
|
[memberName.inspect, memberType == 1 ? "SLOT" : "SIGNAL", object.inspect] )
|
568
579
|
end
|
569
|
-
|
580
|
+
|
570
581
|
def pretty_print(pp)
|
571
582
|
str = to_s
|
572
583
|
pp.text str.sub(/>$/, "\n memberName=%s,\n memberType=%s,\n object=%s>" %
|
@@ -581,20 +592,29 @@ module Qt
|
|
581
592
|
end
|
582
593
|
|
583
594
|
class CoreApplication < Qt::Base
|
595
|
+
attr_reader :thread_fix
|
596
|
+
|
584
597
|
def initialize(*args)
|
585
598
|
if args.length == 1 && args[0].kind_of?(Array)
|
586
599
|
super(args.length + 1, [$0] + args[0])
|
587
600
|
else
|
588
601
|
super(*args)
|
589
602
|
end
|
590
|
-
|
591
|
-
|
603
|
+
$qApp = self
|
604
|
+
@thread_fix = RubyThreadFix.new
|
605
|
+
end
|
606
|
+
|
607
|
+
def disable_threading
|
608
|
+
@thread_fix.stop if @thread_fix
|
609
|
+
@thread_fix = nil
|
610
|
+
end
|
592
611
|
|
593
612
|
# Delete the underlying C++ instance after exec returns
|
594
613
|
# Otherwise, rb_gc_call_finalizer_at_exit() can delete
|
595
614
|
# stuff that Qt::Application still needs for its cleanup.
|
596
615
|
def exec
|
597
616
|
method_missing(:exec)
|
617
|
+
disable_threading()
|
598
618
|
self.dispose
|
599
619
|
Qt::Internal.application_terminated = true
|
600
620
|
end
|
@@ -607,25 +627,25 @@ module Qt
|
|
607
627
|
method_missing(:exit, *args)
|
608
628
|
end
|
609
629
|
end
|
610
|
-
|
630
|
+
|
611
631
|
class Cursor < Qt::Base
|
612
632
|
def inspect
|
613
633
|
str = super
|
614
634
|
str.sub(/>$/, " shape=%d>" % shape)
|
615
635
|
end
|
616
|
-
|
636
|
+
|
617
637
|
def pretty_print(pp)
|
618
638
|
str = to_s
|
619
639
|
pp.text str.sub(/>$/, " shape=%d>" % shape)
|
620
640
|
end
|
621
641
|
end
|
622
642
|
|
623
|
-
class CustomEvent < Qt::Base
|
643
|
+
class CustomEvent < Qt::Base
|
624
644
|
def type(*args)
|
625
645
|
method_missing(:type, *args)
|
626
646
|
end
|
627
647
|
end
|
628
|
-
|
648
|
+
|
629
649
|
class Date < Qt::Base
|
630
650
|
def initialize(*args)
|
631
651
|
if args.size == 1 && args[0].class.name == "Date"
|
@@ -639,7 +659,7 @@ module Qt
|
|
639
659
|
str = super
|
640
660
|
str.sub(/>$/, " %s>" % toString)
|
641
661
|
end
|
642
|
-
|
662
|
+
|
643
663
|
def pretty_print(pp)
|
644
664
|
str = to_s
|
645
665
|
pp.text str.sub(/>$/, " %s>" % toString)
|
@@ -649,14 +669,14 @@ module Qt
|
|
649
669
|
::Date.new! to_julian_day
|
650
670
|
end
|
651
671
|
end
|
652
|
-
|
672
|
+
|
653
673
|
class DateTime < Qt::Base
|
654
674
|
def initialize(*args)
|
655
675
|
if args.size == 1 && args[0].class.name == "DateTime"
|
656
|
-
return super( Qt::Date.new(args[0].year, args[0].month, args[0].day),
|
676
|
+
return super( Qt::Date.new(args[0].year, args[0].month, args[0].day),
|
657
677
|
Qt::Time.new(args[0].hour, args[0].min, args[0].sec) )
|
658
678
|
elsif args.size == 1 && args[0].class.name == "Time"
|
659
|
-
result = super( Qt::Date.new(args[0].year, args[0].month, args[0].day),
|
679
|
+
result = super( Qt::Date.new(args[0].year, args[0].month, args[0].day),
|
660
680
|
Qt::Time.new(args[0].hour, args[0].min, args[0].sec, args[0].usec / 1000) )
|
661
681
|
result.timeSpec = (args[0].utc? ? Qt::UTC : Qt::LocalTime)
|
662
682
|
return result
|
@@ -679,7 +699,7 @@ module Qt
|
|
679
699
|
str = super
|
680
700
|
str.sub(/>$/, " %s>" % toString)
|
681
701
|
end
|
682
|
-
|
702
|
+
|
683
703
|
def pretty_print(pp)
|
684
704
|
str = to_s
|
685
705
|
pp.text str.sub(/>$/, " %s>" % toString)
|
@@ -691,7 +711,7 @@ module Qt
|
|
691
711
|
str = super
|
692
712
|
str.sub(/>$/, " currentSignature='%s', atEnd=%s>" % [currentSignature, atEnd])
|
693
713
|
end
|
694
|
-
|
714
|
+
|
695
715
|
def pretty_print(pp)
|
696
716
|
str = to_s
|
697
717
|
pp.text str.sub(/>$/, " currentSignature='%s, atEnd=%s'>" % [currentSignature, atEnd])
|
@@ -708,7 +728,7 @@ module Qt
|
|
708
728
|
def serviceOwner(name)
|
709
729
|
return Qt::DBusReply.new(internalConstCall(Qt::DBus::AutoDetect, "GetNameOwner", [Qt::Variant.new(name)]))
|
710
730
|
end
|
711
|
-
|
731
|
+
|
712
732
|
def service_owner(name)
|
713
733
|
return serviceOwner(name)
|
714
734
|
end
|
@@ -762,13 +782,13 @@ module Qt
|
|
762
782
|
end
|
763
783
|
end
|
764
784
|
|
765
|
-
class DBusError < Qt::Base
|
785
|
+
class DBusError < Qt::Base
|
766
786
|
def type(*args)
|
767
787
|
method_missing(:type, *args)
|
768
788
|
end
|
769
789
|
end
|
770
790
|
|
771
|
-
class DBusInterface < Qt::Base
|
791
|
+
class DBusInterface < Qt::Base
|
772
792
|
def call(method_name, *args)
|
773
793
|
if args.length == 0
|
774
794
|
return super(method_name)
|
@@ -777,7 +797,7 @@ module Qt
|
|
777
797
|
qdbusArgs = args.collect {|arg| qVariantFromValue(arg)}
|
778
798
|
return super(method_name, opt, *qdbusArgs)
|
779
799
|
else
|
780
|
-
# If the method is Qt::DBusInterface.call(), create an Array
|
800
|
+
# If the method is Qt::DBusInterface.call(), create an Array
|
781
801
|
# 'dbusArgs' of Qt::Variants from '*args'
|
782
802
|
qdbusArgs = args.collect {|arg| qVariantFromValue(arg)}
|
783
803
|
return super(method_name, *qdbusArgs)
|
@@ -799,7 +819,7 @@ module Qt
|
|
799
819
|
end
|
800
820
|
end
|
801
821
|
|
802
|
-
class DBusMessage < Qt::Base
|
822
|
+
class DBusMessage < Qt::Base
|
803
823
|
def type(*args)
|
804
824
|
method_missing(:type, *args)
|
805
825
|
end
|
@@ -841,9 +861,9 @@ module Qt
|
|
841
861
|
@data = reply.arguments[0]
|
842
862
|
return
|
843
863
|
end
|
844
|
-
|
864
|
+
|
845
865
|
# error
|
846
|
-
@error = Qt::DBusError.new( Qt::DBusError::InvalidSignature,
|
866
|
+
@error = Qt::DBusError.new( Qt::DBusError::InvalidSignature,
|
847
867
|
"Unexpected reply signature" )
|
848
868
|
@data = Qt::Variant.new # clear it
|
849
869
|
end
|
@@ -921,13 +941,13 @@ module Qt
|
|
921
941
|
end
|
922
942
|
end
|
923
943
|
|
924
|
-
class DragEnterEvent < Qt::Base
|
944
|
+
class DragEnterEvent < Qt::Base
|
925
945
|
def type(*args)
|
926
946
|
method_missing(:type, *args)
|
927
947
|
end
|
928
948
|
end
|
929
949
|
|
930
|
-
class DragLeaveEvent < Qt::Base
|
950
|
+
class DragLeaveEvent < Qt::Base
|
931
951
|
def type(*args)
|
932
952
|
method_missing(:type, *args)
|
933
953
|
end
|
@@ -964,7 +984,7 @@ module Qt
|
|
964
984
|
end
|
965
985
|
end
|
966
986
|
|
967
|
-
class FileOpenEvent < Qt::Base
|
987
|
+
class FileOpenEvent < Qt::Base
|
968
988
|
def type(*args)
|
969
989
|
method_missing(:type, *args)
|
970
990
|
end
|
@@ -978,22 +998,22 @@ module Qt
|
|
978
998
|
end
|
979
999
|
end
|
980
1000
|
|
981
|
-
class FocusEvent < Qt::Base
|
1001
|
+
class FocusEvent < Qt::Base
|
982
1002
|
def type(*args)
|
983
1003
|
method_missing(:type, *args)
|
984
1004
|
end
|
985
1005
|
end
|
986
|
-
|
1006
|
+
|
987
1007
|
class Font < Qt::Base
|
988
1008
|
def inspect
|
989
1009
|
str = super
|
990
|
-
str.sub(/>$/, " family=%s, pointSize=%d, weight=%d, italic=%s, bold=%s, underline=%s, strikeOut=%s>" %
|
1010
|
+
str.sub(/>$/, " family=%s, pointSize=%d, weight=%d, italic=%s, bold=%s, underline=%s, strikeOut=%s>" %
|
991
1011
|
[family.inspect, pointSize, weight, italic, bold, underline, strikeOut])
|
992
1012
|
end
|
993
|
-
|
1013
|
+
|
994
1014
|
def pretty_print(pp)
|
995
1015
|
str = to_s
|
996
|
-
pp.text str.sub(/>$/, "\n family=%s,\n pointSize=%d,\n weight=%d,\n italic=%s,\n bold=%s,\n underline=%s,\n strikeOut=%s>" %
|
1016
|
+
pp.text str.sub(/>$/, "\n family=%s,\n pointSize=%d,\n weight=%d,\n italic=%s,\n bold=%s,\n underline=%s,\n strikeOut=%s>" %
|
997
1017
|
[family.inspect, pointSize, weight, italic, bold, underline, strikeOut])
|
998
1018
|
end
|
999
1019
|
end
|
@@ -1032,19 +1052,19 @@ module Qt
|
|
1032
1052
|
end
|
1033
1053
|
end
|
1034
1054
|
|
1035
|
-
class Gradient < Qt::Base
|
1055
|
+
class Gradient < Qt::Base
|
1036
1056
|
def type(*args)
|
1037
1057
|
method_missing(:type, *args)
|
1038
1058
|
end
|
1039
1059
|
end
|
1040
1060
|
|
1041
|
-
class GraphicsEllipseItem < Qt::Base
|
1061
|
+
class GraphicsEllipseItem < Qt::Base
|
1042
1062
|
def type(*args)
|
1043
1063
|
method_missing(:type, *args)
|
1044
1064
|
end
|
1045
1065
|
end
|
1046
1066
|
|
1047
|
-
class GraphicsItem < Qt::Base
|
1067
|
+
class GraphicsItem < Qt::Base
|
1048
1068
|
def type(*args)
|
1049
1069
|
method_missing(:type, *args)
|
1050
1070
|
end
|
@@ -1065,14 +1085,14 @@ module Qt
|
|
1065
1085
|
end
|
1066
1086
|
end
|
1067
1087
|
|
1068
|
-
class GraphicsPathItem < Qt::Base
|
1088
|
+
class GraphicsPathItem < Qt::Base
|
1069
1089
|
Type = 2
|
1070
1090
|
def type(*args)
|
1071
1091
|
method_missing(:type, *args)
|
1072
1092
|
end
|
1073
1093
|
end
|
1074
1094
|
|
1075
|
-
class GraphicsPixmapItem < Qt::Base
|
1095
|
+
class GraphicsPixmapItem < Qt::Base
|
1076
1096
|
def type(*args)
|
1077
1097
|
method_missing(:type, *args)
|
1078
1098
|
end
|
@@ -1092,57 +1112,57 @@ module Qt
|
|
1092
1112
|
end
|
1093
1113
|
end
|
1094
1114
|
|
1095
|
-
class GraphicsRectItem < Qt::Base
|
1115
|
+
class GraphicsRectItem < Qt::Base
|
1096
1116
|
Type = 3
|
1097
1117
|
def type(*args)
|
1098
1118
|
method_missing(:type, *args)
|
1099
1119
|
end
|
1100
1120
|
end
|
1101
1121
|
|
1102
|
-
class GraphicsSceneDragDropEvent < Qt::Base
|
1122
|
+
class GraphicsSceneDragDropEvent < Qt::Base
|
1103
1123
|
def type(*args)
|
1104
1124
|
method_missing(:type, *args)
|
1105
1125
|
end
|
1106
1126
|
end
|
1107
1127
|
|
1108
|
-
class GraphicsSceneMouseEvent < Qt::Base
|
1128
|
+
class GraphicsSceneMouseEvent < Qt::Base
|
1109
1129
|
def type(*args)
|
1110
1130
|
method_missing(:type, *args)
|
1111
1131
|
end
|
1112
1132
|
end
|
1113
1133
|
|
1114
|
-
class GraphicsSceneContextMenuEvent < Qt::Base
|
1134
|
+
class GraphicsSceneContextMenuEvent < Qt::Base
|
1115
1135
|
def type(*args)
|
1116
1136
|
method_missing(:type, *args)
|
1117
1137
|
end
|
1118
1138
|
end
|
1119
1139
|
|
1120
|
-
class GraphicsSceneHoverEvent < Qt::Base
|
1140
|
+
class GraphicsSceneHoverEvent < Qt::Base
|
1121
1141
|
def type(*args)
|
1122
1142
|
method_missing(:type, *args)
|
1123
1143
|
end
|
1124
1144
|
end
|
1125
1145
|
|
1126
|
-
class GraphicsSceneHelpEvent < Qt::Base
|
1146
|
+
class GraphicsSceneHelpEvent < Qt::Base
|
1127
1147
|
def type(*args)
|
1128
1148
|
method_missing(:type, *args)
|
1129
1149
|
end
|
1130
1150
|
end
|
1131
1151
|
|
1132
|
-
class GraphicsSceneWheelEvent < Qt::Base
|
1152
|
+
class GraphicsSceneWheelEvent < Qt::Base
|
1133
1153
|
def type(*args)
|
1134
1154
|
method_missing(:type, *args)
|
1135
1155
|
end
|
1136
1156
|
end
|
1137
1157
|
|
1138
|
-
class GraphicsSimpleTextItem < Qt::Base
|
1158
|
+
class GraphicsSimpleTextItem < Qt::Base
|
1139
1159
|
Type = 9
|
1140
1160
|
def type(*args)
|
1141
1161
|
method_missing(:type, *args)
|
1142
1162
|
end
|
1143
1163
|
end
|
1144
1164
|
|
1145
|
-
class GraphicsSvgItem < Qt::Base
|
1165
|
+
class GraphicsSvgItem < Qt::Base
|
1146
1166
|
Type = 13
|
1147
1167
|
def type(*args)
|
1148
1168
|
method_missing(:type, *args)
|
@@ -1163,19 +1183,19 @@ module Qt
|
|
1163
1183
|
end
|
1164
1184
|
end
|
1165
1185
|
|
1166
|
-
class HelpEvent < Qt::Base
|
1186
|
+
class HelpEvent < Qt::Base
|
1167
1187
|
def type(*args)
|
1168
1188
|
method_missing(:type, *args)
|
1169
1189
|
end
|
1170
1190
|
end
|
1171
1191
|
|
1172
|
-
class HideEvent < Qt::Base
|
1192
|
+
class HideEvent < Qt::Base
|
1173
1193
|
def type(*args)
|
1174
1194
|
method_missing(:type, *args)
|
1175
1195
|
end
|
1176
1196
|
end
|
1177
1197
|
|
1178
|
-
class HoverEvent < Qt::Base
|
1198
|
+
class HoverEvent < Qt::Base
|
1179
1199
|
def type(*args)
|
1180
1200
|
method_missing(:type, *args)
|
1181
1201
|
end
|
@@ -1197,19 +1217,19 @@ module Qt
|
|
1197
1217
|
end
|
1198
1218
|
end
|
1199
1219
|
|
1200
|
-
class IconDragEvent < Qt::Base
|
1220
|
+
class IconDragEvent < Qt::Base
|
1201
1221
|
def type(*args)
|
1202
1222
|
method_missing(:type, *args)
|
1203
1223
|
end
|
1204
1224
|
end
|
1205
1225
|
|
1206
|
-
class InputEvent < Qt::Base
|
1226
|
+
class InputEvent < Qt::Base
|
1207
1227
|
def type(*args)
|
1208
1228
|
method_missing(:type, *args)
|
1209
1229
|
end
|
1210
1230
|
end
|
1211
1231
|
|
1212
|
-
class InputMethodEvent < Qt::Base
|
1232
|
+
class InputMethodEvent < Qt::Base
|
1213
1233
|
def type(*args)
|
1214
1234
|
method_missing(:type, *args)
|
1215
1235
|
end
|
@@ -1291,8 +1311,8 @@ module Qt
|
|
1291
1311
|
method_missing(:select, *args)
|
1292
1312
|
end
|
1293
1313
|
end
|
1294
|
-
|
1295
|
-
class KeyEvent < Qt::Base
|
1314
|
+
|
1315
|
+
class KeyEvent < Qt::Base
|
1296
1316
|
def type(*args)
|
1297
1317
|
method_missing(:type, *args)
|
1298
1318
|
end
|
@@ -1310,7 +1330,7 @@ module Qt
|
|
1310
1330
|
str = super
|
1311
1331
|
str.sub(/>$/, " %s>" % toString)
|
1312
1332
|
end
|
1313
|
-
|
1333
|
+
|
1314
1334
|
def pretty_print(pp)
|
1315
1335
|
str = to_s
|
1316
1336
|
pp.text str.sub(/>$/, " %s>" % toString)
|
@@ -1342,7 +1362,7 @@ module Qt
|
|
1342
1362
|
str = super
|
1343
1363
|
str.sub(/>$/, " text='%s'>" % text)
|
1344
1364
|
end
|
1345
|
-
|
1365
|
+
|
1346
1366
|
def pretty_print(pp)
|
1347
1367
|
str = to_s
|
1348
1368
|
pp.text str.sub(/>$/, " text='%s'>" % text)
|
@@ -1392,7 +1412,7 @@ module Qt
|
|
1392
1412
|
str = super
|
1393
1413
|
str.sub(/>$/, " scope=%s, name=%s, keyValues=Array (%d element(s))>" % [scope, name, keyValues.length])
|
1394
1414
|
end
|
1395
|
-
|
1415
|
+
|
1396
1416
|
def pretty_print(pp)
|
1397
1417
|
str = to_s
|
1398
1418
|
pp.text str.sub(/>$/, " scope=%s, name=%s, keyValues=Array (%d element(s))>" % [scope, name, keyValues.length])
|
@@ -1421,7 +1441,7 @@ module Qt
|
|
1421
1441
|
def propertyNames(inherits = false)
|
1422
1442
|
res = []
|
1423
1443
|
if inherits
|
1424
|
-
for p in 0...propertyCount()
|
1444
|
+
for p in 0...propertyCount()
|
1425
1445
|
res.push property(p).name
|
1426
1446
|
end
|
1427
1447
|
else
|
@@ -1436,15 +1456,15 @@ module Qt
|
|
1436
1456
|
res = []
|
1437
1457
|
if inherits
|
1438
1458
|
for m in 0...methodCount()
|
1439
|
-
if method(m).methodType == Qt::MetaMethod::Slot
|
1440
|
-
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1459
|
+
if method(m).methodType == Qt::MetaMethod::Slot
|
1460
|
+
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1441
1461
|
method(m).signature]
|
1442
1462
|
end
|
1443
1463
|
end
|
1444
1464
|
else
|
1445
1465
|
for m in methodOffset()...methodCount()
|
1446
|
-
if method(m).methodType == Qt::MetaMethod::Slot
|
1447
|
-
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1466
|
+
if method(m).methodType == Qt::MetaMethod::Slot
|
1467
|
+
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1448
1468
|
method(m).signature]
|
1449
1469
|
end
|
1450
1470
|
end
|
@@ -1456,15 +1476,15 @@ module Qt
|
|
1456
1476
|
res = []
|
1457
1477
|
if inherits
|
1458
1478
|
for m in 0...methodCount()
|
1459
|
-
if method(m).methodType == Qt::MetaMethod::Signal
|
1460
|
-
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1479
|
+
if method(m).methodType == Qt::MetaMethod::Signal
|
1480
|
+
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1461
1481
|
method(m).signature]
|
1462
1482
|
end
|
1463
1483
|
end
|
1464
1484
|
else
|
1465
1485
|
for m in methodOffset()...methodCount()
|
1466
|
-
if method(m).methodType == Qt::MetaMethod::Signal
|
1467
|
-
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1486
|
+
if method(m).methodType == Qt::MetaMethod::Signal
|
1487
|
+
res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName,
|
1468
1488
|
method(m).signature]
|
1469
1489
|
end
|
1470
1490
|
end
|
@@ -1498,7 +1518,7 @@ module Qt
|
|
1498
1518
|
str.chop!
|
1499
1519
|
str << ">"
|
1500
1520
|
end
|
1501
|
-
|
1521
|
+
|
1502
1522
|
def pretty_print(pp)
|
1503
1523
|
str = to_s
|
1504
1524
|
str.sub!(/>$/, "")
|
@@ -1542,13 +1562,13 @@ module Qt
|
|
1542
1562
|
end
|
1543
1563
|
end
|
1544
1564
|
|
1545
|
-
class MouseEvent < Qt::Base
|
1565
|
+
class MouseEvent < Qt::Base
|
1546
1566
|
def type(*args)
|
1547
1567
|
method_missing(:type, *args)
|
1548
1568
|
end
|
1549
1569
|
end
|
1550
1570
|
|
1551
|
-
class MoveEvent < Qt::Base
|
1571
|
+
class MoveEvent < Qt::Base
|
1552
1572
|
def type(*args)
|
1553
1573
|
method_missing(:type, *args)
|
1554
1574
|
end
|
@@ -1575,7 +1595,7 @@ module Qt
|
|
1575
1595
|
end
|
1576
1596
|
end
|
1577
1597
|
|
1578
|
-
class PaintEvent < Qt::Base
|
1598
|
+
class PaintEvent < Qt::Base
|
1579
1599
|
def type(*args)
|
1580
1600
|
method_missing(:type, *args)
|
1581
1601
|
end
|
@@ -1604,25 +1624,25 @@ module Qt
|
|
1604
1624
|
method_missing(:load, *args)
|
1605
1625
|
end
|
1606
1626
|
end
|
1607
|
-
|
1627
|
+
|
1608
1628
|
class Point < Qt::Base
|
1609
1629
|
def inspect
|
1610
1630
|
str = super
|
1611
1631
|
str.sub(/>$/, " x=%d, y=%d>" % [self.x, self.y])
|
1612
1632
|
end
|
1613
|
-
|
1633
|
+
|
1614
1634
|
def pretty_print(pp)
|
1615
1635
|
str = to_s
|
1616
1636
|
pp.text str.sub(/>$/, "\n x=%d,\n y=%d>" % [self.x, self.y])
|
1617
1637
|
end
|
1618
1638
|
end
|
1619
|
-
|
1639
|
+
|
1620
1640
|
class PointF < Qt::Base
|
1621
1641
|
def inspect
|
1622
1642
|
str = super
|
1623
1643
|
str.sub(/>$/, " x=%f, y=%f>" % [self.x, self.y])
|
1624
1644
|
end
|
1625
|
-
|
1645
|
+
|
1626
1646
|
def pretty_print(pp)
|
1627
1647
|
str = to_s
|
1628
1648
|
pp.text str.sub(/>$/, "\n x=%f,\n y=%f>" % [self.x, self.y])
|
@@ -1686,8 +1706,8 @@ module Qt
|
|
1686
1706
|
method_missing(:abort, *args)
|
1687
1707
|
end
|
1688
1708
|
end
|
1689
|
-
|
1690
|
-
class PushButton < Qt::Base
|
1709
|
+
|
1710
|
+
class PushButton < Qt::Base
|
1691
1711
|
def setShortcut(arg)
|
1692
1712
|
if arg.kind_of?(String)
|
1693
1713
|
return super(Qt::KeySequence.new(arg))
|
@@ -1706,25 +1726,25 @@ module Qt
|
|
1706
1726
|
str = super
|
1707
1727
|
str.sub(/>$/, " x1=%d, y1=%d, x2=%d, y2=%d>" % [x1, y1, x2, y2])
|
1708
1728
|
end
|
1709
|
-
|
1729
|
+
|
1710
1730
|
def pretty_print(pp)
|
1711
1731
|
str = to_s
|
1712
1732
|
pp.text str.sub(/>$/, "\n x1=%d,\n y1=%d,\n x2=%d,\n y2=%d>" % [x1, y1, x2, y2])
|
1713
1733
|
end
|
1714
1734
|
end
|
1715
|
-
|
1735
|
+
|
1716
1736
|
class LineF < Qt::Base
|
1717
1737
|
def inspect
|
1718
1738
|
str = super
|
1719
1739
|
str.sub(/>$/, " x1=%f, y1=%f, x2=%f, y2=%f>" % [x1, y1, x2, y2])
|
1720
1740
|
end
|
1721
|
-
|
1741
|
+
|
1722
1742
|
def pretty_print(pp)
|
1723
1743
|
str = to_s
|
1724
1744
|
pp.text str.sub(/>$/, "\n x1=%f,\n y1=%f,\n x2=%f,\n y2=%f>" % [x1, y1, x2, y2])
|
1725
1745
|
end
|
1726
1746
|
end
|
1727
|
-
|
1747
|
+
|
1728
1748
|
class MetaType < Qt::Base
|
1729
1749
|
def self.type(*args)
|
1730
1750
|
method_missing(:type, *args)
|
@@ -1736,14 +1756,14 @@ module Qt
|
|
1736
1756
|
str = super
|
1737
1757
|
str.sub(/>$/, " valid?=%s, row=%s, column=%s>" % [valid?, row, column])
|
1738
1758
|
end
|
1739
|
-
|
1759
|
+
|
1740
1760
|
def pretty_print(pp)
|
1741
1761
|
str = to_s
|
1742
1762
|
pp.text str.sub(/>$/, "\n valid?=%s,\n row=%s,\n column=%s>" % [valid?, row, column])
|
1743
1763
|
end
|
1744
1764
|
end
|
1745
|
-
|
1746
|
-
class RadioButton < Qt::Base
|
1765
|
+
|
1766
|
+
class RadioButton < Qt::Base
|
1747
1767
|
def setShortcut(arg)
|
1748
1768
|
if arg.kind_of?(String)
|
1749
1769
|
return super(Qt::KeySequence.new(arg))
|
@@ -1762,26 +1782,26 @@ module Qt
|
|
1762
1782
|
str = super
|
1763
1783
|
str.sub(/>$/, " x=%d, y=%d, width=%d, height=%d>" % [self.x, self.y, width, height])
|
1764
1784
|
end
|
1765
|
-
|
1785
|
+
|
1766
1786
|
def pretty_print(pp)
|
1767
1787
|
str = to_s
|
1768
1788
|
pp.text str.sub(/>$/, "\n x=%d,\n y=%d,\n width=%d,\n height=%d>" % [self.x, self.y, width, height])
|
1769
1789
|
end
|
1770
1790
|
end
|
1771
|
-
|
1791
|
+
|
1772
1792
|
class RectF < Qt::Base
|
1773
1793
|
def inspect
|
1774
1794
|
str = super
|
1775
1795
|
str.sub(/>$/, " x=%f, y=%f, width=%f, height=%f>" % [self.x, self.y, width, height])
|
1776
1796
|
end
|
1777
|
-
|
1797
|
+
|
1778
1798
|
def pretty_print(pp)
|
1779
1799
|
str = to_s
|
1780
1800
|
pp.text str.sub(/>$/, "\n x=%f,\n y=%f,\n width=%f,\n height=%f>" % [self.x, self.y, width, height])
|
1781
1801
|
end
|
1782
1802
|
end
|
1783
1803
|
|
1784
|
-
class ResizeEvent < Qt::Base
|
1804
|
+
class ResizeEvent < Qt::Base
|
1785
1805
|
def type(*args)
|
1786
1806
|
method_missing(:type, *args)
|
1787
1807
|
end
|
@@ -1803,48 +1823,48 @@ module Qt
|
|
1803
1823
|
end
|
1804
1824
|
end
|
1805
1825
|
|
1806
|
-
class ShortcutEvent < Qt::Base
|
1826
|
+
class ShortcutEvent < Qt::Base
|
1807
1827
|
def type(*args)
|
1808
1828
|
method_missing(:type, *args)
|
1809
1829
|
end
|
1810
1830
|
end
|
1811
1831
|
|
1812
|
-
class ShowEvent < Qt::Base
|
1832
|
+
class ShowEvent < Qt::Base
|
1813
1833
|
def type(*args)
|
1814
1834
|
method_missing(:type, *args)
|
1815
1835
|
end
|
1816
1836
|
end
|
1817
|
-
|
1837
|
+
|
1818
1838
|
class Size < Qt::Base
|
1819
1839
|
def inspect
|
1820
1840
|
str = super
|
1821
1841
|
str.sub(/>$/, " width=%d, height=%d>" % [width, height])
|
1822
1842
|
end
|
1823
|
-
|
1843
|
+
|
1824
1844
|
def pretty_print(pp)
|
1825
1845
|
str = to_s
|
1826
1846
|
pp.text str.sub(/>$/, "\n width=%d,\n height=%d>" % [width, height])
|
1827
1847
|
end
|
1828
1848
|
end
|
1829
|
-
|
1849
|
+
|
1830
1850
|
class SizeF < Qt::Base
|
1831
1851
|
def inspect
|
1832
1852
|
str = super
|
1833
1853
|
str.sub(/>$/, " width=%f, height=%f>" % [width, height])
|
1834
1854
|
end
|
1835
|
-
|
1855
|
+
|
1836
1856
|
def pretty_print(pp)
|
1837
1857
|
str = to_s
|
1838
1858
|
pp.text str.sub(/>$/, "\n width=%f,\n height=%f>" % [width, height])
|
1839
1859
|
end
|
1840
1860
|
end
|
1841
|
-
|
1861
|
+
|
1842
1862
|
class SizePolicy < Qt::Base
|
1843
1863
|
def inspect
|
1844
1864
|
str = super
|
1845
1865
|
str.sub(/>$/, " horizontalPolicy=%d, verticalPolicy=%d>" % [horizontalPolicy, verticalPolicy])
|
1846
1866
|
end
|
1847
|
-
|
1867
|
+
|
1848
1868
|
def pretty_print(pp)
|
1849
1869
|
str = to_s
|
1850
1870
|
pp.text str.sub(/>$/, "\n horizontalPolicy=%d,\n verticalPolicy=%d>" % [horizontalPolicy, verticalPolicy])
|
@@ -1929,12 +1949,12 @@ module Qt
|
|
1929
1949
|
end
|
1930
1950
|
end
|
1931
1951
|
|
1932
|
-
class StandardItem < Qt::Base
|
1952
|
+
class StandardItem < Qt::Base
|
1933
1953
|
def inspect
|
1934
1954
|
str = super
|
1935
1955
|
str.sub(/>$/, " text='%s'>" % [text])
|
1936
1956
|
end
|
1937
|
-
|
1957
|
+
|
1938
1958
|
def pretty_print(pp)
|
1939
1959
|
str = to_s
|
1940
1960
|
pp.text str.sub(/>$/, "\n text='%s'>" % [text])
|
@@ -1949,13 +1969,13 @@ module Qt
|
|
1949
1969
|
end
|
1950
1970
|
end
|
1951
1971
|
|
1952
|
-
class StandardItemModel < Qt::Base
|
1972
|
+
class StandardItemModel < Qt::Base
|
1953
1973
|
def type(*args)
|
1954
1974
|
method_missing(:type, *args)
|
1955
1975
|
end
|
1956
1976
|
end
|
1957
1977
|
|
1958
|
-
class StatusTipEvent < Qt::Base
|
1978
|
+
class StatusTipEvent < Qt::Base
|
1959
1979
|
def type(*args)
|
1960
1980
|
method_missing(:type, *args)
|
1961
1981
|
end
|
@@ -1992,7 +2012,7 @@ module Qt
|
|
1992
2012
|
str = super
|
1993
2013
|
str.sub(/>$/, " text='%s'>" % text)
|
1994
2014
|
end
|
1995
|
-
|
2015
|
+
|
1996
2016
|
def pretty_print(pp)
|
1997
2017
|
str = to_s
|
1998
2018
|
pp.text str.sub(/>$/, " text='%s'>" % text)
|
@@ -2004,7 +2024,7 @@ module Qt
|
|
2004
2024
|
method_missing(:open, *args)
|
2005
2025
|
end
|
2006
2026
|
end
|
2007
|
-
|
2027
|
+
|
2008
2028
|
class TextCursor < Qt::Base
|
2009
2029
|
def select(*k)
|
2010
2030
|
method_missing(:select, *k)
|
@@ -2068,7 +2088,7 @@ module Qt
|
|
2068
2088
|
method_missing(:format, *args)
|
2069
2089
|
end
|
2070
2090
|
end
|
2071
|
-
|
2091
|
+
|
2072
2092
|
class Time < Qt::Base
|
2073
2093
|
def initialize(*args)
|
2074
2094
|
if args.size == 1 && args[0].class.name == "Time"
|
@@ -2082,19 +2102,25 @@ module Qt
|
|
2082
2102
|
str = super
|
2083
2103
|
str.sub(/>$/, " %s>" % toString)
|
2084
2104
|
end
|
2085
|
-
|
2105
|
+
|
2086
2106
|
def pretty_print(pp)
|
2087
2107
|
str = to_s
|
2088
2108
|
pp.text str.sub(/>$/, " %s>" % toString)
|
2089
2109
|
end
|
2090
2110
|
end
|
2091
2111
|
|
2092
|
-
class
|
2112
|
+
class Timer < Qt::Base
|
2113
|
+
def start(*args)
|
2114
|
+
method_missing(:start, *args)
|
2115
|
+
end
|
2116
|
+
end
|
2117
|
+
|
2118
|
+
class TimerEvent < Qt::Base
|
2093
2119
|
def type(*args)
|
2094
2120
|
method_missing(:type, *args)
|
2095
2121
|
end
|
2096
2122
|
end
|
2097
|
-
|
2123
|
+
|
2098
2124
|
class TimeLine < Qt::Base
|
2099
2125
|
def frameRange=(arg)
|
2100
2126
|
if arg.kind_of? Range
|
@@ -2104,8 +2130,8 @@ module Qt
|
|
2104
2130
|
end
|
2105
2131
|
end
|
2106
2132
|
end
|
2107
|
-
|
2108
|
-
class ToolButton < Qt::Base
|
2133
|
+
|
2134
|
+
class ToolButton < Qt::Base
|
2109
2135
|
def setShortcut(arg)
|
2110
2136
|
if arg.kind_of?(String)
|
2111
2137
|
return super(Qt::KeySequence.new(arg))
|
@@ -2142,7 +2168,7 @@ module Qt
|
|
2142
2168
|
|
2143
2169
|
def initialize(*args)
|
2144
2170
|
# There is not way to distinguish between the copy constructor
|
2145
|
-
# QTreeWidgetItem (const QTreeWidgetItem & other)
|
2171
|
+
# QTreeWidgetItem (const QTreeWidgetItem & other)
|
2146
2172
|
# and
|
2147
2173
|
# QTreeWidgetItem (QTreeWidgetItem * parent, const QStringList & strings, int type = Type)
|
2148
2174
|
# when the latter has a single argument. So force the second variant to be called
|
@@ -2162,7 +2188,7 @@ module Qt
|
|
2162
2188
|
end
|
2163
2189
|
str.sub!(/,?$/, ">")
|
2164
2190
|
end
|
2165
|
-
|
2191
|
+
|
2166
2192
|
def pretty_print(pp)
|
2167
2193
|
str = to_s
|
2168
2194
|
str.sub!(/>$/, "")
|
@@ -2202,7 +2228,7 @@ module Qt
|
|
2202
2228
|
str = super
|
2203
2229
|
str.sub(/>$/, " url=%s>" % toString)
|
2204
2230
|
end
|
2205
|
-
|
2231
|
+
|
2206
2232
|
def pretty_print(pp)
|
2207
2233
|
str = to_s
|
2208
2234
|
pp.text str.sub(/>$/, " url=%s>" % toString)
|
@@ -2214,7 +2240,7 @@ module Qt
|
|
2214
2240
|
method_missing(:name, *args)
|
2215
2241
|
end
|
2216
2242
|
end
|
2217
|
-
|
2243
|
+
|
2218
2244
|
class Uuid < Qt::Base
|
2219
2245
|
Time = Qt::Enum.new(1, "QUuid::Version")
|
2220
2246
|
end
|
@@ -2231,7 +2257,7 @@ module Qt
|
|
2231
2257
|
elsif args.size == 1 && args[0].class.name == "Date"
|
2232
2258
|
return super(Qt::Date.new(args[0]))
|
2233
2259
|
elsif args.size == 1 && args[0].class.name == "DateTime"
|
2234
|
-
return super(Qt::DateTime.new( Qt::Date.new(args[0].year, args[0].month, args[0].day),
|
2260
|
+
return super(Qt::DateTime.new( Qt::Date.new(args[0].year, args[0].month, args[0].day),
|
2235
2261
|
Qt::Time.new(args[0].hour, args[0].min, args[0].sec) ) )
|
2236
2262
|
elsif args.size == 1 && args[0].class.name == "Time"
|
2237
2263
|
return super(Qt::Time.new(args[0]))
|
@@ -2354,7 +2380,7 @@ module Qt
|
|
2354
2380
|
str = super
|
2355
2381
|
str.sub(/>$/, " typeName=%s>" % typeName)
|
2356
2382
|
end
|
2357
|
-
|
2383
|
+
|
2358
2384
|
def pretty_print(pp)
|
2359
2385
|
str = to_s
|
2360
2386
|
pp.text str.sub(/>$/, " typeName=%s>" % typeName)
|
@@ -2373,7 +2399,7 @@ module Qt
|
|
2373
2399
|
def initialize(value)
|
2374
2400
|
if value.kind_of? Qt::Variant
|
2375
2401
|
super(value)
|
2376
|
-
else
|
2402
|
+
else
|
2377
2403
|
super(Qt::Variant.new(value))
|
2378
2404
|
end
|
2379
2405
|
end
|
@@ -2474,7 +2500,7 @@ module Qt
|
|
2474
2500
|
end
|
2475
2501
|
return @smoke
|
2476
2502
|
end
|
2477
|
-
|
2503
|
+
|
2478
2504
|
def initialize(smoke, index)
|
2479
2505
|
@smoke = smoke
|
2480
2506
|
@index = index
|
@@ -2538,12 +2564,12 @@ module Qt
|
|
2538
2564
|
if typename =~ /^int&?$|^signed int&?$|^signed$|^qint32&?$/
|
2539
2565
|
return 6 + const_point
|
2540
2566
|
elsif typename =~ /^quint32&?$/
|
2541
|
-
return 4 + const_point
|
2567
|
+
return 4 + const_point
|
2542
2568
|
elsif typename =~ /^(?:short|ushort|unsigned short int|unsigned short|uchar|char|unsigned char|uint|long|ulong|unsigned long int|unsigned|float|double|WId|HBITMAP__\*|HDC__\*|HFONT__\*|HICON__\*|HINSTANCE__\*|HPALETTE__\*|HRGN__\*|HWND__\*|Q_PID|^quint16&?$|^qint16&?$)$/
|
2543
2569
|
return 4 + const_point
|
2544
2570
|
elsif typename =~ /^(quint|qint|qulong|qlong|qreal)/
|
2545
2571
|
return 4 + const_point
|
2546
|
-
else
|
2572
|
+
else
|
2547
2573
|
t = typename.sub(/^const\s+/, '')
|
2548
2574
|
t.sub!(/[&*]$/, '')
|
2549
2575
|
if isEnum(t)
|
@@ -2559,7 +2585,7 @@ module Qt
|
|
2559
2585
|
return 2 + const_point
|
2560
2586
|
elsif typename =~ /^(?:short|ushort|uint|long|ulong|signed|unsigned|float|double)$/
|
2561
2587
|
return 2 + const_point
|
2562
|
-
else
|
2588
|
+
else
|
2563
2589
|
t = typename.sub(/^const\s+/, '')
|
2564
2590
|
t.sub!(/[&*]$/, '')
|
2565
2591
|
if isEnum(t)
|
@@ -2618,7 +2644,7 @@ module Qt
|
|
2618
2644
|
return 4 + const_point
|
2619
2645
|
elsif classIsa(argtype, t)
|
2620
2646
|
return 2 + const_point
|
2621
|
-
elsif isEnum(argtype) and
|
2647
|
+
elsif isEnum(argtype) and
|
2622
2648
|
(t =~ /int|qint32|uint|quint32|long|ulong/ or isEnum(t))
|
2623
2649
|
return 2 + const_point
|
2624
2650
|
end
|
@@ -2629,9 +2655,9 @@ module Qt
|
|
2629
2655
|
def Internal.find_class(classname)
|
2630
2656
|
@@classes[classname]
|
2631
2657
|
end
|
2632
|
-
|
2658
|
+
|
2633
2659
|
# Runs the initializer as far as allocating the Qt C++ instance.
|
2634
|
-
# Then use a throw to jump back to here with the C++ instance
|
2660
|
+
# Then use a throw to jump back to here with the C++ instance
|
2635
2661
|
# wrapped in a new ruby variable of type T_DATA
|
2636
2662
|
def Internal.try_initialize(instance, *args)
|
2637
2663
|
initializer = instance.method(:initialize)
|
@@ -2639,7 +2665,7 @@ module Qt
|
|
2639
2665
|
initializer.call(*args)
|
2640
2666
|
end
|
2641
2667
|
end
|
2642
|
-
|
2668
|
+
|
2643
2669
|
# If a block was passed to the constructor, then
|
2644
2670
|
# run that now. Either run the context of the new instance
|
2645
2671
|
# if no args were passed to the block. Or otherwise,
|
@@ -2661,7 +2687,7 @@ module Qt
|
|
2661
2687
|
# klass - Ruby class object
|
2662
2688
|
# this - instance of class
|
2663
2689
|
# args - arguments to method call
|
2664
|
-
#
|
2690
|
+
#
|
2665
2691
|
def Internal.do_method_missing(package, method, klass, this, *args)
|
2666
2692
|
# Determine class name
|
2667
2693
|
if klass.class == Module
|
@@ -2681,19 +2707,19 @@ module Qt
|
|
2681
2707
|
end
|
2682
2708
|
end
|
2683
2709
|
end
|
2684
|
-
|
2685
|
-
# Modify constructor method name from new to the name of the Qt class
|
2686
|
-
# and remove any namespacing
|
2710
|
+
|
2711
|
+
# Modify constructor method name from new to the name of the Qt class
|
2712
|
+
# and remove any namespacing
|
2687
2713
|
if method == "new"
|
2688
|
-
method = classname.dup
|
2714
|
+
method = classname.dup
|
2689
2715
|
method.gsub!(/^.*::/,"")
|
2690
2716
|
end
|
2691
2717
|
|
2692
|
-
# If the method contains no letters it must be an operator, append "operator" to the
|
2718
|
+
# If the method contains no letters it must be an operator, append "operator" to the
|
2693
2719
|
# method name
|
2694
2720
|
method = "operator" + method.sub("@","") if method !~ /[a-zA-Z]+/
|
2695
2721
|
|
2696
|
-
# Change foobar= to setFoobar()
|
2722
|
+
# Change foobar= to setFoobar()
|
2697
2723
|
method = 'set' + method[0,1].upcase + method[1,method.length].sub("=", "") if method =~ /.*[^-+%\/|=]=$/ && method != 'operator='
|
2698
2724
|
|
2699
2725
|
# Build list of munged method names which is the methodname followed
|
@@ -2710,8 +2736,8 @@ module Qt
|
|
2710
2736
|
# For each nil arg encountered, triple the number of munged method
|
2711
2737
|
# templates, in order to cover all possible types that can match nil
|
2712
2738
|
temp = []
|
2713
|
-
methods.collect! do |meth|
|
2714
|
-
temp << meth + '?'
|
2739
|
+
methods.collect! do |meth|
|
2740
|
+
temp << meth + '?'
|
2715
2741
|
temp << meth + '#'
|
2716
2742
|
meth << '$'
|
2717
2743
|
end
|
@@ -2724,13 +2750,13 @@ module Qt
|
|
2724
2750
|
methods.collect! { |meth| meth << '$' }
|
2725
2751
|
end
|
2726
2752
|
end
|
2727
|
-
|
2728
|
-
# Create list of methodIds that match classname and munged method name
|
2753
|
+
|
2754
|
+
# Create list of methodIds that match classname and munged method name
|
2729
2755
|
methodIds = []
|
2730
2756
|
methods.collect { |meth| methodIds.concat( findMethod(classname, meth) ) }
|
2731
2757
|
|
2732
2758
|
# If we didn't find any methods and the method name contains an underscore
|
2733
|
-
# then convert to camelcase and try again
|
2759
|
+
# then convert to camelcase and try again
|
2734
2760
|
if method =~ /._./ && methodIds.length == 0
|
2735
2761
|
# If the method name contains underscores, convert to camel case
|
2736
2762
|
# form and try again
|
@@ -2746,12 +2772,12 @@ module Qt
|
|
2746
2772
|
puts "candidate list:"
|
2747
2773
|
prototypes = dumpCandidates(methodIds).split("\n")
|
2748
2774
|
line_len = (prototypes.collect { |p| p.length }).max
|
2749
|
-
prototypes.zip(methodIds) {
|
2750
|
-
|prototype,id| puts "#{prototype.ljust line_len} (smoke: #{id.smoke} index: #{id.index})"
|
2775
|
+
prototypes.zip(methodIds) {
|
2776
|
+
|prototype,id| puts "#{prototype.ljust line_len} (smoke: #{id.smoke} index: #{id.index})"
|
2751
2777
|
}
|
2752
2778
|
end
|
2753
|
-
|
2754
|
-
# Find the best match
|
2779
|
+
|
2780
|
+
# Find the best match
|
2755
2781
|
chosen = nil
|
2756
2782
|
if methodIds.length > 0
|
2757
2783
|
best_match = -1
|
@@ -2767,7 +2793,7 @@ module Qt
|
|
2767
2793
|
current_match += score
|
2768
2794
|
puts " #{typename} (#{argtype}) score: #{score}" if debug_level >= DebugLevel::High
|
2769
2795
|
end
|
2770
|
-
|
2796
|
+
|
2771
2797
|
# Note that if current_match > best_match, then chosen must be nil
|
2772
2798
|
if current_match > best_match
|
2773
2799
|
best_match = current_match
|
@@ -2818,27 +2844,27 @@ module Qt
|
|
2818
2844
|
@@classes['Qt::Boolean'] = Qt::Boolean
|
2819
2845
|
@@classes['Qt::Enum'] = Qt::Enum
|
2820
2846
|
end
|
2821
|
-
|
2847
|
+
|
2822
2848
|
def Internal.get_qinteger(num)
|
2823
2849
|
return num.value
|
2824
2850
|
end
|
2825
|
-
|
2851
|
+
|
2826
2852
|
def Internal.set_qinteger(num, val)
|
2827
2853
|
return num.value = val
|
2828
2854
|
end
|
2829
|
-
|
2855
|
+
|
2830
2856
|
def Internal.create_qenum(num, enum_type)
|
2831
2857
|
return Qt::Enum.new(num, enum_type)
|
2832
2858
|
end
|
2833
|
-
|
2859
|
+
|
2834
2860
|
def Internal.get_qenum_type(e)
|
2835
2861
|
return e.type
|
2836
2862
|
end
|
2837
|
-
|
2863
|
+
|
2838
2864
|
def Internal.get_qboolean(b)
|
2839
2865
|
return b.value
|
2840
2866
|
end
|
2841
|
-
|
2867
|
+
|
2842
2868
|
def Internal.set_qboolean(b, val)
|
2843
2869
|
return b.value = val
|
2844
2870
|
end
|
@@ -2850,11 +2876,11 @@ module Qt
|
|
2850
2876
|
getAllParents(c, res)
|
2851
2877
|
end
|
2852
2878
|
end
|
2853
|
-
|
2879
|
+
|
2854
2880
|
# Keeps a hash of strings against their corresponding offsets
|
2855
2881
|
# within the qt_meta_stringdata sequence of null terminated
|
2856
2882
|
# strings. Returns a proc to get an offset given a string.
|
2857
|
-
# That proc also adds new strings to the 'data' array, and updates
|
2883
|
+
# That proc also adds new strings to the 'data' array, and updates
|
2858
2884
|
# the corresponding 'pack_str' Array#pack template.
|
2859
2885
|
def Internal.string_table_handler(data, pack_str)
|
2860
2886
|
hsh = {}
|
@@ -2885,7 +2911,7 @@ module Qt
|
|
2885
2911
|
data = [1, # revision
|
2886
2912
|
string_table.call(classname), # classname
|
2887
2913
|
classinfos.length, classinfos.length > 0 ? 10 : 0, # classinfo
|
2888
|
-
signals.length + slots.length,
|
2914
|
+
signals.length + slots.length,
|
2889
2915
|
10 + (2*classinfos.length), # methods
|
2890
2916
|
0, 0, # properties
|
2891
2917
|
0, 0] # enums/sets
|
@@ -2923,7 +2949,7 @@ module Qt
|
|
2923
2949
|
|
2924
2950
|
return [stringdata.pack(pack_string), data]
|
2925
2951
|
end
|
2926
|
-
|
2952
|
+
|
2927
2953
|
def Internal.getMetaObject(klass, qobject)
|
2928
2954
|
if klass.nil?
|
2929
2955
|
klass = qobject.class
|
@@ -2936,19 +2962,19 @@ module Qt
|
|
2936
2962
|
|
2937
2963
|
meta = Meta[klass.name]
|
2938
2964
|
if meta.nil?
|
2939
|
-
meta = Qt::MetaInfo.new(klass)
|
2965
|
+
meta = Qt::MetaInfo.new(klass)
|
2940
2966
|
end
|
2941
2967
|
|
2942
2968
|
if meta.metaobject.nil? or meta.changed
|
2943
2969
|
stringdata, data = makeMetaData( qobject.class.name,
|
2944
|
-
meta.classinfos,
|
2970
|
+
meta.classinfos,
|
2945
2971
|
meta.dbus,
|
2946
|
-
meta.signals,
|
2972
|
+
meta.signals,
|
2947
2973
|
meta.slots )
|
2948
2974
|
meta.metaobject = make_metaObject(qobject, parentMeta, stringdata, data)
|
2949
2975
|
meta.changed = false
|
2950
2976
|
end
|
2951
|
-
|
2977
|
+
|
2952
2978
|
meta.metaobject
|
2953
2979
|
end
|
2954
2980
|
|
@@ -3001,9 +3027,9 @@ module Qt
|
|
3001
3027
|
end # Qt::Internal
|
3002
3028
|
|
3003
3029
|
Meta = {}
|
3004
|
-
|
3030
|
+
|
3005
3031
|
# An entry for each signal or slot
|
3006
|
-
# Example
|
3032
|
+
# Example
|
3007
3033
|
# int foobar(QString,bool)
|
3008
3034
|
# :name is 'foobar'
|
3009
3035
|
# :full_name is 'foobar(QString,bool)'
|
@@ -3025,7 +3051,7 @@ module Qt
|
|
3025
3051
|
@changed = false
|
3026
3052
|
Internal.addMetaObjectMethods(klass)
|
3027
3053
|
end
|
3028
|
-
|
3054
|
+
|
3029
3055
|
def add_signals(signal_list, access)
|
3030
3056
|
signal_names = []
|
3031
3057
|
signal_list.each do |signal|
|
@@ -3034,9 +3060,9 @@ module Qt
|
|
3034
3060
|
end
|
3035
3061
|
signal = Qt::MetaObject.normalizedSignature(signal).to_s
|
3036
3062
|
if signal =~ /^(([\w,<>:]*)\s+)?([^\s]*)\((.*)\)/
|
3037
|
-
@signals.push QObjectMember.new( $3,
|
3038
|
-
$3 + "(" + $4 + ")",
|
3039
|
-
$4,
|
3063
|
+
@signals.push QObjectMember.new( $3,
|
3064
|
+
$3 + "(" + $4 + ")",
|
3065
|
+
$4,
|
3040
3066
|
($2 == 'void' || $2.nil?) ? "" : $2,
|
3041
3067
|
access )
|
3042
3068
|
signal_names << $3
|
@@ -3046,7 +3072,7 @@ module Qt
|
|
3046
3072
|
end
|
3047
3073
|
Internal.addSignalMethods(@klass, signal_names)
|
3048
3074
|
end
|
3049
|
-
|
3075
|
+
|
3050
3076
|
# Return a list of signals, including inherited ones
|
3051
3077
|
def get_signals
|
3052
3078
|
all_signals = []
|
@@ -3060,7 +3086,7 @@ module Qt
|
|
3060
3086
|
end
|
3061
3087
|
return all_signals
|
3062
3088
|
end
|
3063
|
-
|
3089
|
+
|
3064
3090
|
def add_slots(slot_list, access)
|
3065
3091
|
slot_list.each do |slot|
|
3066
3092
|
if slot.kind_of? Symbol
|
@@ -3068,9 +3094,9 @@ module Qt
|
|
3068
3094
|
end
|
3069
3095
|
slot = Qt::MetaObject.normalizedSignature(slot).to_s
|
3070
3096
|
if slot =~ /^(([\w,<>:]*)\s+)?([^\s]*)\((.*)\)/
|
3071
|
-
@slots.push QObjectMember.new( $3,
|
3072
|
-
$3 + "(" + $4 + ")",
|
3073
|
-
$4,
|
3097
|
+
@slots.push QObjectMember.new( $3,
|
3098
|
+
$3 + "(" + $4 + ")",
|
3099
|
+
$4,
|
3074
3100
|
($2 == 'void' || $2.nil?) ? "" : $2,
|
3075
3101
|
access )
|
3076
3102
|
else
|
@@ -3088,7 +3114,7 @@ module Qt
|
|
3088
3114
|
end # Qt::MetaInfo
|
3089
3115
|
|
3090
3116
|
# These values are from the enum WindowType in qnamespace.h.
|
3091
|
-
# Some of the names such as 'Qt::Dialog', clash with QtRuby
|
3117
|
+
# Some of the names such as 'Qt::Dialog', clash with QtRuby
|
3092
3118
|
# class names. So add some constants here to use instead,
|
3093
3119
|
# renamed with an ending of 'Type'.
|
3094
3120
|
WidgetType = 0x00000000
|
@@ -3102,7 +3128,7 @@ module Qt
|
|
3102
3128
|
SplashScreenType = 0x0000000e | WindowType
|
3103
3129
|
DesktopType = 0x00000010 | WindowType
|
3104
3130
|
SubWindowType = 0x00000012
|
3105
|
-
|
3131
|
+
|
3106
3132
|
end # Qt
|
3107
3133
|
|
3108
3134
|
class Object
|
@@ -3138,7 +3164,7 @@ class Object
|
|
3138
3164
|
end unless defined? instance_exec
|
3139
3165
|
end
|
3140
3166
|
|
3141
|
-
class Proc
|
3167
|
+
class Proc
|
3142
3168
|
# Part of the Rails Object#instance_exec implementation
|
3143
3169
|
def bind(object)
|
3144
3170
|
block, time = self, Time.now
|
@@ -3194,7 +3220,7 @@ class Module
|
|
3194
3220
|
loop do
|
3195
3221
|
classid = Qt::Internal::find_pclassid(klass.name)
|
3196
3222
|
break if classid.index
|
3197
|
-
|
3223
|
+
|
3198
3224
|
klass = klass.superclass
|
3199
3225
|
if klass.nil?
|
3200
3226
|
return meths
|
@@ -3213,5 +3239,3 @@ class Module
|
|
3213
3239
|
return meths.uniq
|
3214
3240
|
end
|
3215
3241
|
end
|
3216
|
-
|
3217
|
-
# kate: space-indent false;
|