天天看點

pyqt5 月曆設計 QSS

pyqt5 月曆設計 QSS

上圖的QSS代碼: 

/*月曆*/
QCalendarWidget QToolButton {
    height: 30px;
    width: 80px;
    color: white;
    font: 50px Microsoft YaHei;
}
QCalendarWidget QTableView {
    alternate-background-color: rgb(72,72,78);
}
QCalendarWidget QMenu {
    width: 120px;
    left: 50px;
    color: gray;
    font-size: 12px;
    background-color: rgb(72,72,78);
	border: 1px solid #3C3C3C!important;
	selection-background-color: rgba(33,37,38,0.2);
	selection-color: #2962ff;
}
QCalendarWidget QHeaderView {
    qproperty-minimumSectionSize:0;
	border-radius:10px;
}
#qt_calendar_calendarview {
    background-color:rgb(33,37,38);
    border: 2px solid #3C3C3C!important;
    font: 12px;
}
#qt_calendar_monthbutton {
	font: 14px;
	background-color:transparent;
  	font-family:Microsoft YaHei;
  	font-weight:500px;
  	outline:10px;
}
#qt_calendar_yearbutton {
	font: 14px;
	background-color:transparent;
}
#qt_calendar_yearedit {
	font: 14px;
    background-color: transparent;
}
#qt_calendar_navigationbar {
    background-color: rgb(72,72,78);
	border: 2px solid #3C3C3C!important;
	border-top-right-radius:10px;
	border-top-left-radius:10px;
}
QToolButton#qt_calendar_prevmonth {
	icon-size:20px;
    background: transparent;
    border: none;
    qproperty-icon: url(E:\\Host\\images\\left2.png);
}
QToolButton#qt_calendar_nextmonth {
	icon-size:20px;
    background: transparent;
    border: none;
    qproperty-icon: url(E:\\Host\\images\\right2.png);
}
QCalendarWidget QAbstractItemView {
    color: transparent;
    selection-background-color: rgb(72,72,78);
    selection-color: #2962ff;
}
QCalendarWidget QAbstractItemView:disabled{
  	color:rgb(72,72,78);
}
QCalendarWidget QAbstractItemView:enabled{
  	color:#D3D3D3;
}
           

注意:url(XXX)中的路徑,需要根據你自己的左右箭頭圖檔存放路徑進行修改 

左右箭頭資源包:https://download.csdn.net/download/qq_40155090/15561592

繼續閱讀