As requested here is my stylesheet. It was customized for color and icons, mainly I needed larger selectors (arrows, and tool menu) since I am using a touchscreen and not a mouse. When I touch the month, the pop menu appears.
I had a difficult time getting the next/previous months icons working so qt supported suggested this.
QToolButton *btn
= calendar
->findChild<QToolButton
*>
("qt_calendar_prevmonth");
btn->setIcon(icon);
btn = calendar->findChild<QToolButton *>("qt_calendar_nextmonth");
....
QToolButton *btn = calendar->findChild<QToolButton *>("qt_calendar_prevmonth");
QIcon icon;
icon.addPixmap(QPixmap(QString::fromUtf8(PREVMONTHBUTTON_N)), QIcon::Normal, QIcon::On);
icon.addPixmap(QPixmap(QString::fromUtf8(PREVMONTHBUTTON_S)), QIcon::Active, QIcon::On);
icon.addPixmap(QPixmap(QString::fromUtf8(PREVMONTHBUTTON_S)), QIcon::Selected, QIcon::On);
btn->setIcon(icon);
btn = calendar->findChild<QToolButton *>("qt_calendar_nextmonth");
....
To copy to clipboard, switch view to plain text mode
StyleSheet, there are some style widgets that are blank, just ignore them.
calendar->setStyleSheet("QMenu { font-size:16px; width: 150px; left: 20px; background-
color:qlineargradient(x1:0, y1:0, x2:0, y2:1, stop: 0 #cccccc, stop: 1 #333333);}
QToolButton {icon-size: 48px, 48px;background-color: qlineargradient(x1:0, y1:0, x2:0,
y2:1, stop: 0 #cccccc, stop: 1 #333333);
height: 100px; width: 200px;}
QAbstractItemView {selection-background-color: rgb(255, 174, 0);}
QToolButton::menu-arrow {}
QToolButton::menu-button {}
QToolButton::menu-indicator{width: 50px;}
QToolButton::menu-indicator:pressed,
QToolButton::menu-indicator:open{top:10px; left: 10px;}
QListView {background-color:white;}
QSpinBox {width:200px; border-width: 2px;}
QSpinBox::up-button { subcontrol-origin: border;
subcontrol-position: top right; width:50px; border-image: url(icons:arrow_up_n.png);}
QSpinBox::down-button {subcontrol-origin: border; subcontrol-position: bottom right;
border-width: 1px; width:50px;}
QSpinBox::down-arrow { width:26px; height:17px;
image: url(icons:arrow_down_n.png); } ")
calendar->setStyleSheet("QMenu { font-size:16px; width: 150px; left: 20px; background-
color:qlineargradient(x1:0, y1:0, x2:0, y2:1, stop: 0 #cccccc, stop: 1 #333333);}
QToolButton {icon-size: 48px, 48px;background-color: qlineargradient(x1:0, y1:0, x2:0,
y2:1, stop: 0 #cccccc, stop: 1 #333333);
height: 100px; width: 200px;}
QAbstractItemView {selection-background-color: rgb(255, 174, 0);}
QToolButton::menu-arrow {}
QToolButton::menu-button {}
QToolButton::menu-indicator{width: 50px;}
QToolButton::menu-indicator:pressed,
QToolButton::menu-indicator:open{top:10px; left: 10px;}
QListView {background-color:white;}
QSpinBox {width:200px; border-width: 2px;}
QSpinBox::up-button { subcontrol-origin: border;
subcontrol-position: top right; width:50px; border-image: url(icons:arrow_up_n.png);}
QSpinBox::down-button {subcontrol-origin: border; subcontrol-position: bottom right;
border-width: 1px; width:50px;}
QSpinBox::down-arrow { width:26px; height:17px;
image: url(icons:arrow_down_n.png); } ")
To copy to clipboard, switch view to plain text mode
Bookmarks