pyqt5-008

QCommandLinkButton:

  描述:

    命令链接是window vista引入的新控件

    它的用途类似于单选按钮的用途,因为它用于在一组互斥选项之间进行选择

    命令链接按钮不应单独使用,而应作为向导和对话框中单选按钮的替代选项

    外观通常类似于平面按钮的外观,但除了普通按钮文本之外,它还允许描述性文本

  继承:

    QPushButton

  功能作用:

    创建命令链接按钮:

      QCommandLinkButton(parent)

      QCommandLinkButton(text, parent)

      QCommandLinkButton(text, description, parent)

    描述设置:

      setDescription(str)

      description()

  信号:按钮通用信号

 

from PyQt5.Qt import *
import sys
app = QApplication(sys.argv)
window = QWidget()
window.resize(300,300)
window.setWindowTitle('QCommandLinkButton学习')


btn = QCommandLinkButton('标题', '描述', window)
btn.setText('标题2')
btn.setDescription('细节')
btn.setIcon(QIcon('click.jpg'))

print(btn.description)

window.show()
sys.exit(app.exec_())

 

posted @ 2020-05-14 16:40  King~~~  阅读(112)  评论(0编辑  收藏  举报