How can I make calendar not select any date but focus should be on calendar?
How can I make calendar not select any date but focus should be o开发者_如何学编程n calendar?
I am not sure it is possible. The calendar has to have a valid selected date. The only thing that comes to mind is some way to avoid drawing the selected date with the highlighted color. You can watch for "selectionChanged" and then turn off the special handler.
From the QCalendarWidget documentation: The rendering of the headers, weekdays or single days can be largely customized by setting QTextCharFormat's for some special weekday, a special date or for the rendering of the headers. Only a subset of the properties in QTextCharFormat are used by the calendar widget. Currently, the foreground, background and font properties are used to determine the rendering of individual cells in the widget.
精彩评论