prompts.py 文件源码

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

项目:axopy 作者: ucdrascal 项目源码 文件源码
def paintEvent(self, event):
        """
        Overrides the QLabel method. Shouldn't need to be called directly.
        """
        super().paintEvent(event)

        if self._pixmap_src is None:
            return

        self._pixmap = self._pixmap_src.scaled(
            self.size(), QtCore.Qt.KeepAspectRatio)

        x = (self.width() - self._pixmap.width())/2
        y = (self.height() - self._pixmap.height())/2

        painter = QtGui.QPainter(self)
        painter.drawPixmap(x, y, self._pixmap)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号