【QSS样式表 - ⑪】:QDateTimeEdit控件样式

QDateTimeEdit控件样式

  1. QDateTimeEdit 子控件
    在这里插入图片描述

  2. QCalendarWidget 的子控件
    在这里插入图片描述
    在这里插入图片描述

  3. 属性选择器
    在这里插入图片描述

QSS示例

  1. 新建一个 QMainWindow ,并在窗口中放置 QDateTimeEdit 和 QCalendarWidget 控件。对 QDateTimeEdit控件的设置如下:
    在这里插入图片描述
    在这里插入图片描述

  2. 如下图所示。

    QDateTimeEdit{
    	border: 1px solid black;
    	font-size: 20px;
    	selection-color: red;
    	selection-background-color: yellow;
    	padding-left: 10px;
    }
    
    /* 带日历的模式,右侧下拉按钮的容器 */
    QDateTimeEdit[calendarPopup=true]::drop-down{
    	border: none;
    	width: 30px;
    }
    
    /* 带日历的模式,下拉箭头*/
    QDateTimeEdit[calendarPopup=true]::down-arrow {
    	image: url(:/images/images/calendar.png);
    }
    
    /* 按钮的菜单指示 */
    QCalendarWidget QToolButton:menu-indicator{
    	image: None;
    }
    
    /* 顶部导航条 */
    QCalendarWidget QWidget#qt_calendar_navigationbar{
    	font-size: 20px;
    	background-color: blue;
    	border: 2px solid yellow;
    }
    
    /* QCalendarWidget 上左箭头图片 */
    QCalendarWidget QToolButton#qt_calendar_prevmonth{
    	qproperty-icon: url(:/images/images/left-arrow.png);
    }
    
    /* QCalendarWidget 上右箭头图片 */
    QCalendarWidget QToolButton#qt_calendar_nextmonth{
    	qproperty-icon: url(:/images/images/right-arrow.png);
    }
    
    /* 日历视图的效果 */
    QCalendarWidget QAbstractItemView {
    	color: black;
    	selection-color: blue;
    	selection-background-color: red;
    	font-size: 12px;
    }
    

    在这里插入图片描述

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

街 三 仔

你的鼓励是我创作的最大动力~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值