Fix bug 685 - "The second arg. of QObject.findChildren doesn't have a default value and doesn't support regexes."
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
c1f507f87a
commit
e360a53087
3 changed files with 37 additions and 7 deletions
|
|
@ -4,7 +4,7 @@
|
|||
import unittest
|
||||
from sys import getrefcount
|
||||
|
||||
from PySide.QtCore import QObject, QTimer
|
||||
from PySide.QtCore import *
|
||||
|
||||
class ParentRefCountCase(unittest.TestCase):
|
||||
'''Test case for the refcount changes of setParent'''
|
||||
|
|
@ -108,6 +108,15 @@ class ParentCase(unittest.TestCase):
|
|||
|
||||
self.assertEqual(sorted(target_children), sorted(test_children))
|
||||
|
||||
# test findChildren default value
|
||||
res = parent.findChildren(QTimer)
|
||||
self.assertEqual(len(res), 20)
|
||||
|
||||
# test findChildre with a regex
|
||||
res = parent.findChildren(QObject, QRegExp("^fo+"))
|
||||
self.assertEqual(sorted(res), sorted(test_children))
|
||||
|
||||
|
||||
def testParentEquality(self):
|
||||
#QObject.parent() == parent
|
||||
parent = QObject()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue