Added all original pyside unit tests to the shiboken version.
This commit is contained in:
parent
aa12538d63
commit
9af36fbb64
160 changed files with 6616 additions and 12 deletions
25
tests/qtgui/parent_method_test.py
Normal file
25
tests/qtgui/parent_method_test.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
import unittest
|
||||
|
||||
from PySide.QtCore import QObject, QTimer, QThread
|
||||
from PySide.QtGui import *
|
||||
|
||||
class Foo(QTableView):
|
||||
def __init__(self, parent=None):
|
||||
QTableView.__init__(self, parent)
|
||||
|
||||
from helper import UsesQApplication
|
||||
|
||||
class TestParentType(UsesQApplication):
|
||||
|
||||
def testParentType(self):
|
||||
# Test the problem with calling QObject.parent from a QWidget
|
||||
# when the parent is a python class derived from a QWidget-derived
|
||||
# class. The method was returning the last C++ class in the hierarchy
|
||||
parent = Foo()
|
||||
w2 = QWidget(parent)
|
||||
self.assert_(isinstance(w2.parentWidget(), Foo))
|
||||
self.assert_(isinstance(w2.parent(), Foo))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue