pyqt在line_edit左边加入icon

        img_path='icon/loginuser.png'
        action = QAction(self.lineEdit)
        action.setIcon(QtGui.QIcon(img_path))
        self.lineEdit.addAction(action,QLineEdit.LeadingPosition)

        img_path='icon/loginsuo.png'
        action = QAction(self.lineEdit)
        action.setIcon(QtGui.QIcon(img_path))
        self.lineEdit_2.addAction(action,QLineEdit.LeadingPosition)
posted @ 2023-05-14 11:17  祥瑞哈哈哈  阅读(119)  评论(0编辑  收藏  举报