Class: Qt::MetaObject

Inherits:
Base show all
Defined in:
lib/Qt/qtruby4.rb

Instance Method Summary collapse

Methods inherited from Base

#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #QCOMPARE, #QEXPECT_FAIL, #QFAIL, #QSKIP, #QTEST, #QVERIFY, #QVERIFY2, #QWARN, #^, ancestors, #is_a?, #methods, private_slots, #protected_methods, #public_methods, q_classinfo, q_signal, q_slot, signals, #singleton_methods, slots, #|, #~

Instance Method Details

#enumerators(inherits = false) ⇒ Object



1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
# File 'lib/Qt/qtruby4.rb', line 1441

def enumerators(inherits = false)
	res = []
	if inherits
		for e in 0...enumeratorCount()
			res.push enumerator(e)
		end
	else
		for e in enumeratorOffset()...enumeratorCount()
			res.push enumerator(e)
		end
	end
	return res
end

#inspectObject



1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
# File 'lib/Qt/qtruby4.rb', line 1455

def inspect
	str = super
	str.sub!(/>$/, "")
	str << " className=%s," % className
	str << " propertyNames=Array (%d element(s))," % propertyNames.length unless propertyNames.length == 0
	str << " signalNames=Array (%d element(s))," % signalNames.length unless signalNames.length == 0
	str << " slotNames=Array (%d element(s))," % slotNames.length unless slotNames.length == 0
	str << " enumerators=Array (%d element(s))," % enumerators.length unless enumerators.length == 0
	str << " superClass=%s," % superClass.inspect unless superClass == nil
	str.chop!
	str << ">"
end

#method(*args) ⇒ Object



1376
1377
1378
1379
1380
1381
1382
# File 'lib/Qt/qtruby4.rb', line 1376

def method(*args)
          if args.length == 1 && args[0].kind_of?(Symbol)
		super(*args)
	else
		method_missing(:method, *args)
	end
end

#pretty_print(pp) ⇒ Object



1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
# File 'lib/Qt/qtruby4.rb', line 1468

def pretty_print(pp)
	str = to_s
	str.sub!(/>$/, "")
	str << "\n className=%s," % className
	str << "\n propertyNames=Array (%d element(s))," % propertyNames.length unless propertyNames.length == 0
	str << "\n signalNames=Array (%d element(s))," % signalNames.length unless signalNames.length == 0
	str << "\n slotNames=Array (%d element(s))," % slotNames.length unless slotNames.length == 0
	str << "\n enumerators=Array (%d element(s))," % enumerators.length unless enumerators.length == 0
	str << "\n superClass=%s," % superClass.inspect unless superClass == nil
	str << "\n methodCount=%d," % methodCount
	str << "\n methodOffset=%d," % methodOffset
	str << "\n propertyCount=%d," % propertyCount
	str << "\n propertyOffset=%d," % propertyOffset
	str << "\n enumeratorCount=%d," % enumeratorCount
	str << "\n enumeratorOffset=%d," % enumeratorOffset
	str.chop!
	str << ">"
	pp.text str
end

#propertyNames(inherits = false) ⇒ Object

Add three methods, ‘propertyNames()’, ‘slotNames()’ and ‘signalNames()’ from Qt3, as they are very useful when debugging



1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
# File 'lib/Qt/qtruby4.rb', line 1387

def propertyNames(inherits = false)
	res = []
	if inherits
		for p in 0...propertyCount() 
			res.push property(p).name
		end
	else
		for p in propertyOffset()...propertyCount()
			res.push property(p).name
		end
	end
	return res
end

#signalNames(inherits = false) ⇒ Object



1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
# File 'lib/Qt/qtruby4.rb', line 1421

def signalNames(inherits = false)
	res = []
	if inherits
		for m in 0...methodCount()
			if method(m).methodType == Qt::MetaMethod::Signal 
				res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName, 
									method(m).signature]
			end
		end
	else
		for m in methodOffset()...methodCount()
			if method(m).methodType == Qt::MetaMethod::Signal 
				res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName, 
									method(m).signature]
			end
		end
	end
	return res
end

#slotNames(inherits = false) ⇒ Object



1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
# File 'lib/Qt/qtruby4.rb', line 1401

def slotNames(inherits = false)
	res = []
	if inherits
		for m in 0...methodCount()
			if method(m).methodType == Qt::MetaMethod::Slot 
				res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName, 
									method(m).signature]
			end
		end
	else
		for m in methodOffset()...methodCount()
			if method(m).methodType == Qt::MetaMethod::Slot 
				res.push "%s %s" % [method(m).typeName == "" ? "void" : method(m).typeName, 
									method(m).signature]
			end
		end
	end
	return res
end