Нужна помощь с Style Sheet для объекта QDateEdit и QCalendarWidget
Есть такой style Sheet (собран с разных примеров и подогнан, на сколько было понятно, под проект):
QDateEdit{
background-color: rgb(27, 29, 35);
border-radius: 5px;
border: 2px solid rgb(33, 37, 43);
padding: 5px;
padding-left: 10px;
color: rgb(113, 126, 149)
}
QDateEdit:hover{
border: 2px solid rgb(64, 71, 88);
}
QDateEdit::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 25px;
border-left-width: 3px;
border-left-color: rgba(39, 44, 54, 150);
border-left-style: solid;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
background-image: url(:/icons/images/icons/cil-arrow-bottom.png);
background-position: center;
background-repeat: no-reperat;
}
QDateEdit QAbstractItemView {
color: rgb(255, 121, 198);
background-color: rgb(33, 37, 43);
padding: 10px;
selection-background-color: rgb(39, 44, 54);
}
/* Кнопка последнего месяца и кнопка следующего месяца
(имя объекта найдено из источника/objectName) */
#qt_calendar_prevmonth, #qt_calendar_nextmonth {
border: none; /* убрать границу */
font-weight: bold; /* шрифт полужирный */
/* Удалить стандартное изображение клавиши со стрелкой.
Вы также можете настроить */
qproperty-icon: none;
background-color: rgb(27,29,35)
}
QCalendarWidget QWidget { alternate-background-color: rgb(27,29,35);}
#qt_calendar_prevmonth {
qproperty-text: "<"; /* Изменить текст кнопки */
}
#qt_calendar_nextmonth {
qproperty-text: ">";
}
#qt_calendar_prevmonth:hover, #qt_calendar_nextmonth:hover {
background-color: rgba(225, 225, 225, 100);
}
#qt_calendar_prevmonth:pressed, #qt_calendar_nextmonth:pressed {
background-color: rgba(235, 235, 235, 100);
}
#qt_calendar_yearbutton, #qt_calendar_monthbutton {
color: rgb(113,126,149);
background-color:rgb(27,29,35);
min-width: 60px;
border-radius: 30px;
}
#qt_calendar_yearbutton:hover, #qt_calendar_monthbutton:hover {
background-color: rgba(225, 225, 225, 100);
}
#qt_calendar_yearbutton:pressed, #qt_calendar_monthbutton:pressed {
background-color: rgba(235, 235, 235, 100);
}
/* Поле ввода года */
#qt_calendar_yearedit {
color: rgb(113,126,149);
background: transparent; /* Сделать фон окна ввода прозрачным */
}
#qt_calendar_yearedit::up-button { /* Кнопка вверх */
color: rgb(27,29,35);
width: 20px;
subcontrol-position: right;
}
#qt_calendar_yearedit::down-button { /* Кнопка вниз */
color: rgb(27,29,35);
width: 20px;
subcontrol-position: left;
}
/* меню выбора месяца */
CalendarWidget QToolButton QMenu {
background-color: rgb(33,37,43);
}
CalendarWidget QToolButton QMenu::item {
padding: 10px;
}
CalendarWidget QToolButton QMenu::item:selected:enabled {
background-color: rgb(230, 230, 230);
}
CalendarWidget QToolButton::menu-indicator {
image: none;
}
/* ниже календарной формы */
#qt_calendar_calendarview {
outline: 0px; /* Удалить выделенную пунктирную рамку */
selection-background-color: rgb(255,121,198); /* Выберите цвет фона */
color:rgb(113, 126, 149);
border-radius: 5px;
}
- Как пофиксить проблему что часть дней обрезана:
- Стрелочка выбора месяца не заходила на текст и была дальше:
- При редактировании года он полностью отображался:
Источник: Stack Overflow на русском