QWidget快速美化-蓝色边框圆角按钮

将代码复制进QPushButton的样式表
效果:
请添加图片描述
代码:

QPushButton{	
	color:#52DCFE;
	border:2px solid #52DCFE;
	border-radius:5px;
}

QPushButton::hover{
	background-color:#52DCFE;
	color:#ffffff;
}

QPushButton::pressed,QPushButton::checked{
	background-color:#52DCFE;
	color:#ffffff;
}

QPushButton::disabled{
	background-color:transparent;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
button_layout = QGridLayout() button1 = QPushButton('当日员工工资') button1.setFixedSize(200, 50) button1.setStyleSheet('QPushButton {background-color: #A3C1DA; color: black; font-weight: bold;}') button1.clicked.connect(self.show_query1_result) button_layout.addWidget(button1, 0, 0) button2 = QPushButton('当日鸡爪领取记录') button2.setFixedSize(200, 50) button2.setStyleSheet('QPushButton {background-color: #A3C1DA; color: black; font-weight: bold;}') button2.clicked.connect(self.show_query2_result) button_layout.addWidget(button2, 0, 1) button3 = QPushButton('查询历史员工工资') button3.setFixedSize(200, 50) button3.setStyleSheet('QPushButton {background-color: #A3C1DA; color: black; font-weight: bold;}') button3.clicked.connect(self.show_query3_result) button_layout.addWidget(button3, 1, 0) button4 = QPushButton('查询历史鸡爪领取记录') button4.setFixedSize(200, 50) button4.setStyleSheet('QPushButton {background-color: #A3C1DA; color: black; font-weight: bold;}') button4.clicked.connect(self.show_query4_result) button_layout.addWidget(button4, 1, 1) button5 = QPushButton('按员工ID查询员工工资') button5.setFixedSize(200, 50) button5.setStyleSheet('QPushButton {background-color: #A3C1DA; color: black; font-weight: bold;}') button5.clicked.connect(self.show_query5_result) button_layout.addWidget(button5, 2, 0) button6 = QPushButton('按员工ID查询鸡爪领取记录') button6.setFixedSize(200, 50) button6.setStyleSheet('QPushButton {background-color: #A3C1DA; color: black; font-weight: bold;}') button6.clicked.connect(self.show_query6_result) button_layout.addWidget(button6, 2, 1) button_layout.setColumnStretch(2, 1) # 添加空白列来填充布局 v_layout = QVBoxLayout() v_layout.addStretch() # 添加弹性空间,使按钮布局垂直居中 v_layout.addLayout(button_layout) v_layout.addStretch() # 再添加一次弹性空间 widget = QWidget() widget.setLayout(v_layout) self.setCentralWidget(widget)怎么美化一下
05-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值