PyQt6 QCommandLinkButton命令链接按钮控件

​锋哥原创的PyQt6视频教程:

2024版 PyQt6 Python桌面开发 视频教程(无废话版) 玩命更新中~_哔哩哔哩_bilibili2024版 PyQt6 Python桌面开发 视频教程(无废话版) 玩命更新中~共计32条视频,包括:2024版 PyQt6 Python桌面开发 视频教程(无废话版) 玩命更新中~、第2讲 PyQt6库和工具库QTDesigner安装与配置、第3讲 PyQt6第一个程序HelloWorld实现等,UP主更多精彩视频,请关注UP账号。icon-default.png?t=N7T8https://www.bilibili.com/video/BV11C4y1P7fj/

CommandLinkButton对应类为QCommandLinkButton,实际上是从pushButton继承过来的一种按钮, 外观像是一个被设置了扁平化的 QPushButton,与PushButton不同主要有如下:

  • 可以在按钮上显示双行文本,首行是QAbstractButton的text显示,次行类似于副标题,是通过CommandLinkButton的description属性来设置的;

  • 默认情况下,它还会带有一个向右的箭头图标,该图标实际上就是QAbstractButton的ICon设置图标,只是填了一个右箭头作为缺省值;

  • 默认类似于一个扁平化自动凸起的按钮。
     

参考代码:

# Form implementation generated from reading ui file 'QCommandLinkButton命令链接按钮控件.ui'
#
# Created by: PyQt6 UI code generator 6.4.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt6 import QtCore, QtGui, QtWidgets


class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.commandLinkButton = QtWidgets.QCommandLinkButton(parent=Form)
        self.commandLinkButton.setGeometry(QtCore.QRect(120, 100, 231, 91))
        self.commandLinkButton.setDescription("python知识分享网")
        self.commandLinkButton.setObjectName("commandLinkButton")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.commandLinkButton.setText(_translate("Form", "http://www.python222.com"))

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值