Implemented support to modify slot return type.
Included method type in DynamicQMetaObject metadata. Moved Signal/Slot objet to libpyside. Create unittest to signal class. Implemented disconnection function. Fixed emit method on signal object
This commit is contained in:
parent
d2a6f35ef9
commit
c5fd4d4830
11 changed files with 710 additions and 48 deletions
|
|
@ -24,8 +24,12 @@ class MyObject(QObject):
|
|||
def foo(self):
|
||||
self._slotCalledCount = self._slotCalledCount + 1
|
||||
|
||||
@Slot(QString)
|
||||
def mySlot4(self, a):
|
||||
@Slot(QString, int)
|
||||
def mySlot4(self, a, b):
|
||||
self._slotCalledCount = self._slotCalledCount + 1
|
||||
|
||||
@Slot(result=int)
|
||||
def mySlot5(self):
|
||||
self._slotCalledCount = self._slotCalledCount + 1
|
||||
|
||||
class StaticMetaObjectTest(unittest.TestCase):
|
||||
|
|
@ -37,7 +41,7 @@ class StaticMetaObjectTest(unittest.TestCase):
|
|||
self.assert_(m.indexOfSlot('mySlot2(int)') > 0)
|
||||
self.assert_(m.indexOfSlot('mySlot2(QString)') > 0)
|
||||
self.assert_(m.indexOfSlot('mySlot3()') > 0)
|
||||
self.assert_(m.indexOfSlot('mySlot4(QString)') > 0)
|
||||
self.assert_(m.indexOfSlot('mySlot4(QString,int)') > 0)
|
||||
|
||||
def testEmission(self):
|
||||
o = MyObject()
|
||||
|
|
@ -45,5 +49,12 @@ class StaticMetaObjectTest(unittest.TestCase):
|
|||
o.emit(SIGNAL("mySignal()"))
|
||||
self.assert_(o._slotCalledCount == 1)
|
||||
|
||||
def testResult(self):
|
||||
o = MyObject()
|
||||
mo = o.metaObject()
|
||||
i = mo.indexOfSlot('mySlot5()')
|
||||
m = mo.method(i)
|
||||
self.assertEqual(m.typeName(), "int")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue