lineyka_chat.py 文件源码

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

项目:lineyka 作者: volodya-renderberg 项目源码 文件源码
def chat_image_view_ui(self, button):
        if not button.img_path:
            return
        # make widjet
        ui_path = G.MW.chat_img_viewer_path
        # widget
        loader = QtUiTools.QUiLoader()
        file = QtCore.QFile(ui_path)
        #file.open(QtCore.QFile.ReadOnly)
        img_window = G.MW.chatImgViewer = loader.load(file, G.MW)
        file.close()


        # SHOW IMAGE
        image = QtGui.QImage(button.img_path)
        img_window.setWindowTitle(button.img_path)

        img_window.image_label.setBackgroundRole(QtGui.QPalette.Base)
        img_window.image_label.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
        img_window.image_label.setScaledContents(True)

        img_window.image_label.setPixmap(QtGui.QPixmap.fromImage(image))

        # connect button
        img_window.cansel_button.clicked.connect(partial(G.MW.close_window, img_window))

        img_window.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号