PyQt5 之QCommandLinkButton

QCommandLinkButton 继承自 QPushButton ,是Vista 引入的新控件。

一、案例

from PyQt5.Qt import *
import sys

class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('QCommandLinkButton-使用')
        self.resize(500, 400)
        self.setup_ui()
    
    def setup_ui(self):
        btn = QCommandLinkButton(self)
        btn.setText('主标题')
        btn.setDescription('按钮描述')
        btn.setIcon(QIcon('xxx.png'))
        
        
if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = Window()
    window.show()
    sys.exit(app.exec_())

猜你喜欢

转载自www.cnblogs.com/yang-2018/p/12894584.html
今日推荐