aprendizaje QCommandLinkButton

aprendizaje QCommandLinkButton

from PyQt5.Qt import *
import sys
class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('QAbstracButton的学习')
        self.resize(500, 500)
        self.setup_ui()

    def setup_ui(self):
        btn=QCommandLinkButton("标题","描述",self)
        btn.move(50,50)
        #修改标题
        btn.setText("标题2")
        #修改描述
        btn.setDescription("社会我顺哥")
        btn.setIcon(QIcon("code.png"))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = Window()
    window.show()
    sys.exit(app.exec_())



Publicado 41 artículos originales · ganado elogios 0 · Vistas 791

Supongo que te gusta

Origin blog.csdn.net/qestion_yz_10086/article/details/104515727
Recomendado
Clasificación