GraphicsItem.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:NeoAnalysis 作者: neoanalysis 项目源码 文件源码
def getViewWidget(self):
        """
        Return the view widget for this item. 

        If the scene has multiple views, only the first view is returned.
        The return value is cached; clear the cached value with forgetViewWidget().
        If the view has been deleted by Qt, return None.
        """
        if self._viewWidget is None:
            scene = self.scene()
            if scene is None:
                return None
            views = scene.views()
            if len(views) < 1:
                return None
            self._viewWidget = weakref.ref(self.scene().views()[0])

        v = self._viewWidget()
        if v is not None and not isQObjectAlive(v):
            return None

        return v
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号