아미(아름다운미소)

Python PyQt5 setStyleSheet 적용 방법 본문

랭귀지/python

Python PyQt5 setStyleSheet 적용 방법

유키공 2018. 12. 21. 16:45

Python PyQt5 선택한 날짜에 setStyleSheet backgroundcolor #33ccff 적용

'''
Created on 2018. 12. 19.

@author: bhm
'''
from PyQt5 import QtWidgets

QSS = '''
QCalendarWidget QAbstractItemView
{ 
    selection-background-color: #33ccff; 
    selection-color: white;
}
'''
class CalendarWidget(QtWidgets.QCalendarWidget):
    def __init__(self, parent=None):
        super(CalendarWidget, self).__init__(parent,
            verticalHeaderFormat=QtWidgets.QCalendarWidget.NoVerticalHeader,
            gridVisible=False)

if __name__ == '__main__':
    import sys
    app = QtWidgets.QApplication(sys.argv)
    app.setStyleSheet(QSS)
    w = CalendarWidget()
    w.show()
    sys.exit(app.exec_())




Comments