コード例 #1
0
 def testToolBar(self):
     self._actionDestroyed = False
     w = QWidget()
     toolBar = QToolBar(w)
     act = toolBar.addAction("MENU")
     _ref = weakref.ref(act, self.actionDestroyed)
     act = None
     self.assertFalse(self._actionDestroyed)
     toolBar.clear()
     self.assertTrue(self._actionDestroyed)
コード例 #2
0
ファイル: action_clear.py プロジェクト: Hasimir/PySide
 def testToolBar(self):
     self._actionDestroyed = False
     w = QWidget()
     toolBar = QToolBar(w)
     act = toolBar.addAction("MENU")
     _ref = weakref.ref(act, self.actionDestroyed)
     act = None
     self.assertFalse(self._actionDestroyed)
     toolBar.clear()
     self.assertTrue(self._actionDestroyed)
コード例 #3
0
ファイル: bug_711.py プロジェクト: Hasimir/PySide
    def testReference(self):
        toolbar = QToolBar()

        for i in xrange(20):
            toolbar.addAction(QAction("Action %d" % i, None))

        buttons = toolbar.findChildren(QToolButton, "")
        toolbar.clear()

        for b in buttons:
            self.assertRaises(RuntimeError, b.objectName)
コード例 #4
0
ファイル: bug_711.py プロジェクト: pymor/pyside_wheelbuilder
    def testReference(self):
        toolbar = QToolBar()

        for i in xrange(20):
            toolbar.addAction(QAction("Action %d" % i, None))

        buttons = toolbar.findChildren(QToolButton, "")
        toolbar.clear()

        for b in buttons:
            self.assertRaises(RuntimeError, b.objectName)