def chat_add_img_to_line(self, button):
rand = hex(random.randint(0, 1000000000)).replace('0x', '')
img_path = os.path.join(G.MW.db_chat.tmp_folder, ('tmp_image_' + rand + '.png')).replace('\\','/')
clipboard = QtGui.QApplication.clipboard()
img = clipboard.image()
if img:
img.save(img_path)
else:
G.MW.message('Cannot Image!', 2)
return(False, 'Cannot Image!')
button.setIcon(QtGui.QIcon(img_path))
button.setIconSize(QtCore.QSize(100, 100))
button.setText('')
button.img_path = img_path
return(True, 'Ok!')
评论列表
文章目录