combobox tableview tablewidget 单选按钮 美化

本文详细介绍如何使用Qt为各种控件定制样式,包括组合框、表格视图及单选按钮等,通过设置样式表来改变其外观特性,如边框、背景颜色及字体样式等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ui->comboBox_2->setStyleSheet("QComboBox{border:1px ;border-image: url(:/new/prefix1/resource/dropbox_normal.png);}\
                                QComboBox::drop-down {width:25px;image: url(:/new/prefix1/resource/droparrow_normal.png) }\
                                QComboBox::drop-down:pressed {width:25px;image: url(:/new/prefix1/resource/droparrow_press.png) }\
                                QComboBox:hover{border:1px ;border-image: url(:/new/prefix1/resource/dropbox_press.png);}\

                                QAbstractItemView{background-color:rgb(189,211,233);color:black;selection-color:black}");


ui->tableView->setStyleSheet("QHeaderView::section{ font-weight:900;color: black;height:30px;padding-left:5px;border-image: url(:/new/prefix1/resource/listheadbg_31.png);font-family:\"华文宋体\";font-size:16px;}\
                                    QTableView::section {background: red;border:2px outset red;}");


ui->radioButton->setStyleSheet("QRadioButton::indicator::checked {border-image: url(:/new/prefix1/resource/radio_press.png);}QRadioButton::indicator{border-image: url(:/new/prefix1/resource/radio_normal.png);}");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值