notes_management_window.py 文件源码

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

项目:Enibar 作者: ENIB 项目源码 文件源码
def add_photo(self):
        """ Function called to add a photo. Open a QFileDialog and fill
            self.photo with the selected image
        """
        self.photo_selected = QtWidgets.QFileDialog(self).getOpenFileUrl(
            self, "Selectionnez une image", settings.IMG_BASE_DIR,
            "Image Files (*.png *.jpg *.bmp)")[0].path()

        if self.photo_selected:
            image = QtGui.QPixmap(self.photo_selected)

            if not image.isNull():
                self.photo.setPixmap(image.scaled(QtCore.QSize(120, 160)))
                self.on_change()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号