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:
Hugo Parente Lima 2011-03-22 18:08:17 -03:00
commit 6f8f728241
3 changed files with 37 additions and 7 deletions

View file

@ -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()