示例#1
0
    def test(self):
        """Test functions of silx.gui.qt.inspect module"""
        self.assertIsNotNone(qt_inspect)

        parent = qt.QObject()

        self.assertTrue(qt_inspect.isValid(parent))
        self.assertTrue(qt_inspect.createdByPython(parent))
        self.assertTrue(qt_inspect.ownedByPython(parent))

        obj = qt.QObject(parent)

        self.assertTrue(qt_inspect.isValid(obj))
        self.assertTrue(qt_inspect.createdByPython(obj))
        self.assertFalse(qt_inspect.ownedByPython(obj))

        del parent
        self.assertFalse(qt_inspect.isValid(obj))
示例#2
0
文件: test.py 项目: t20100/silx
 def testOneObject(self):
     """Test blockSignals context manager with a single QObject"""
     self._test(qt.QObject())
示例#3
0
文件: test.py 项目: t20100/silx
 def testManyObjects(self):
     """Test blockSignals with 2 QObjects"""
     self._test(qt.QObject(), qt.QObject())
示例#4
0
文件: test_qt.py 项目: WuZifan/silx
 def testQObject(self):
     """Test that QObject is there."""
     obj = qt.QObject()
     self.assertTrue(obj is not None)