File: qcalendarwidget.html

package info (click to toggle)
python-qt4 4.12.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,300 kB
  • ctags: 6,185
  • sloc: python: 125,988; cpp: 13,291; xml: 292; makefile: 246; php: 27; sh: 2
file content (355 lines) | stat: -rw-r--r-- 35,561 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QCalendarWidget Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QCalendarWidget Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QCalendarWidget class provides a monthly based calendar
widget allowing the user to select a date. <a href="#details">More...</a></p>

<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a></b> { NoHorizontalHeader, SingleLetterDayNames, ShortDayNames, LongDayNames }</li><li><div class="fn" />enum <b><a href="qcalendarwidget.html#SelectionMode-enum">SelectionMode</a></b> { NoSelection, SingleSelection }</li><li><div class="fn" />enum <b><a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a></b> { NoVerticalHeader, ISOWeekNumbers }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qcalendarwidget.html#QCalendarWidget">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />int <b><a href="qcalendarwidget.html#dateEditAcceptDelay">dateEditAcceptDelay</a></b> (<i>self</i>)</li><li><div class="fn" />unknown-type <b><a href="qcalendarwidget.html#dateTextFormat">dateTextFormat</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCharFormat <b><a href="qcalendarwidget.html#dateTextFormat-2">dateTextFormat</a></b> (<i>self</i>, QDate&#160;<i>date</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#eventFilter">eventFilter</a></b> (<i>self</i>, QObject&#160;<i>watched</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" />Qt.DayOfWeek <b><a href="qcalendarwidget.html#firstDayOfWeek">firstDayOfWeek</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCharFormat <b><a href="qcalendarwidget.html#headerTextFormat">headerTextFormat</a></b> (<i>self</i>)</li><li><div class="fn" />HorizontalHeaderFormat <b><a href="qcalendarwidget.html#horizontalHeaderFormat">horizontalHeaderFormat</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#isDateEditEnabled">isDateEditEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#isGridVisible">isGridVisible</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#isHeaderVisible">isHeaderVisible</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#isNavigationBarVisible">isNavigationBarVisible</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent&#160;<i>event</i>)</li><li><div class="fn" />QDate <b><a href="qcalendarwidget.html#maximumDate">maximumDate</a></b> (<i>self</i>)</li><li><div class="fn" />QDate <b><a href="qcalendarwidget.html#minimumDate">minimumDate</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qcalendarwidget.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qcalendarwidget.html#monthShown">monthShown</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#paintCell">paintCell</a></b> (<i>self</i>, QPainter&#160;<i>painter</i>, QRect&#160;<i>rect</i>, QDate&#160;<i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent&#160;<i>event</i>)</li><li><div class="fn" />QDate <b><a href="qcalendarwidget.html#selectedDate">selectedDate</a></b> (<i>self</i>)</li><li><div class="fn" />SelectionMode <b><a href="qcalendarwidget.html#selectionMode">selectionMode</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a></b> (<i>self</i>, int&#160;<i>year</i>, int&#160;<i>month</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateEditAcceptDelay">setDateEditAcceptDelay</a></b> (<i>self</i>, int&#160;<i>delay</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateEditEnabled">setDateEditEnabled</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateRange">setDateRange</a></b> (<i>self</i>, QDate&#160;<i>min</i>, QDate&#160;<i>max</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateTextFormat">setDateTextFormat</a></b> (<i>self</i>, QDate&#160;<i>date</i>, QTextCharFormat&#160;<i>color</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setFirstDayOfWeek">setFirstDayOfWeek</a></b> (<i>self</i>, Qt.DayOfWeek&#160;<i>dayOfWeek</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setGridVisible">setGridVisible</a></b> (<i>self</i>, bool&#160;<i>show</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setHeaderTextFormat">setHeaderTextFormat</a></b> (<i>self</i>, QTextCharFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setHeaderVisible">setHeaderVisible</a></b> (<i>self</i>, bool&#160;<i>show</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setHorizontalHeaderFormat">setHorizontalHeaderFormat</a></b> (<i>self</i>, HorizontalHeaderFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setMaximumDate">setMaximumDate</a></b> (<i>self</i>, QDate&#160;<i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setMinimumDate">setMinimumDate</a></b> (<i>self</i>, QDate&#160;<i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setNavigationBarVisible">setNavigationBarVisible</a></b> (<i>self</i>, bool&#160;<i>visible</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setSelectedDate">setSelectedDate</a></b> (<i>self</i>, QDate&#160;<i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setSelectionMode">setSelectionMode</a></b> (<i>self</i>, SelectionMode&#160;<i>mode</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setVerticalHeaderFormat">setVerticalHeaderFormat</a></b> (<i>self</i>, VerticalHeaderFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setWeekdayTextFormat">setWeekdayTextFormat</a></b> (<i>self</i>, Qt.DayOfWeek&#160;<i>dayOfWeek</i>, QTextCharFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#showNextMonth">showNextMonth</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#showNextYear">showNextYear</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#showPreviousMonth">showPreviousMonth</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#showPreviousYear">showPreviousYear</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#showSelectedDate">showSelectedDate</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#showToday">showToday</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qcalendarwidget.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#updateCell">updateCell</a></b> (<i>self</i>, QDate&#160;<i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#updateCells">updateCells</a></b> (<i>self</i>)</li><li><div class="fn" />VerticalHeaderFormat <b><a href="qcalendarwidget.html#verticalHeaderFormat">verticalHeaderFormat</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCharFormat <b><a href="qcalendarwidget.html#weekdayTextFormat">weekdayTextFormat</a></b> (<i>self</i>, Qt.DayOfWeek&#160;<i>dayOfWeek</i>)</li><li><div class="fn" />int <b><a href="qcalendarwidget.html#yearShown">yearShown</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qcalendarwidget.html#activated">activated</a></b> (const  ::QDate&amp;)</li><li><div class="fn" />void <b><a href="qcalendarwidget.html#clicked">clicked</a></b> (const  ::QDate&amp;)</li><li><div class="fn" />void <b><a href="qcalendarwidget.html#currentPageChanged">currentPageChanged</a></b> (int,int)</li><li><div class="fn" />void <b><a href="qcalendarwidget.html#selectionChanged">selectionChanged</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QCalendarWidget class provides a monthly based calendar
widget allowing the user to select a date.</p>
<p class="centerAlign"><img alt="" src="images/cleanlooks-calendarwidget.png" /></p>
<p>The widget is initialized with the current month and year, but
QCalendarWidget provides several public slots to change the year
and month that is shown.</p>
<p>By default, today's date is selected, and the user can select a
date using both mouse and keyboard. The currently selected date can
be retrieved using the <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a>()
function. It is possible to constrain the user selection to a given
date range by setting the <a href="qcalendarwidget.html#minimumDate-prop">minimumDate</a> and
<a href="qcalendarwidget.html#maximumDate-prop">maximumDate</a>
properties. Alternatively, both properties can be set in one go
using the <a href="qcalendarwidget.html#setDateRange">setDateRange</a>() convenience
slot. Set the <a href="qcalendarwidget.html#selectionMode-prop">selectionMode</a>
property to <a href="qcalendarwidget.html#SelectionMode-enum">NoSelection</a> to
prohibit the user from selecting at all. Note that a date also can
be selected programmatically using the <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>()
slot.</p>
<p>The currently displayed month and year can be retrieved using
the <a href="qcalendarwidget.html#monthShown">monthShown</a>() and
<a href="qcalendarwidget.html#yearShown">yearShown</a>() functions,
respectively.</p>
<p>A newly created calendar widget uses abbreviated day names, and
both Saturdays and Sundays are marked in red. The calendar grid is
not visible. The week numbers are displayed, and the first column
day is Sunday.</p>
<p>The notation of the days can be altered to a single letter
abbreviations ("M" for "Monday") by setting the <a href="qcalendarwidget.html#horizontalHeaderFormat-prop">horizontalHeaderFormat</a>
property to <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">QCalendarWidget.SingleLetterDayNames</a>.
Setting the same property to <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">QCalendarWidget.LongDayNames</a>
makes the header display the complete day names. The week numbers
can be removed by setting the <a href="qcalendarwidget.html#verticalHeaderFormat-prop">verticalHeaderFormat</a>
property to <a href="qcalendarwidget.html#VerticalHeaderFormat-enum">QCalendarWidget.NoVerticalHeader</a>.
The calendar grid can be turned on by setting the <a href="qcalendarwidget.html#gridVisible-prop">gridVisible</a> property to
true using the <a href="qcalendarwidget.html#gridVisible-prop">setGridVisible</a>()
function:</p>
<table class="generic">
<tr class="odd" valign="top">
<td>
<p class="centerAlign"><img alt="" src="images/qcalendarwidget-grid.png" /></p>
</td>
</tr>
<tr class="even" valign="top">
<td>
<pre class="cpp">
 <span class="type">QCalendarWidget</span> <span class="operator">*</span>calendar;
 calendar<span class="operator">-</span><span class="operator">&gt;</span><a href="qcalendarwidget.html#gridVisible-prop">setGridVisible</a>(<span class="keyword">true</span>);
</pre></td>
</tr>
</table>
<p>Finally, the day in the first column can be altered using the
<a href="qcalendarwidget.html#firstDayOfWeek-prop">setFirstDayOfWeek</a>()
function.</p>
<p>The QCalendarWidget class also provides three signals, <a href="qcalendarwidget.html#selectionChanged">selectionChanged</a>(),
<a href="qcalendarwidget.html#activated">activated</a>() and
<a href="qcalendarwidget.html#currentPageChanged">currentPageChanged</a>()
making it possible to respond to user interaction.</p>
<p>The rendering of the headers, weekdays or single days can be
largely customized by setting <a href="qtextcharformat.html">QTextCharFormat</a>'s for some special
weekday, a special date or for the rendering of the headers.</p>
<p>Only a subset of the properties in <a href="qtextcharformat.html">QTextCharFormat</a> 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.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="HorizontalHeaderFormat-enum" />QCalendarWidget.HorizontalHeaderFormat</h3><p>This enum type defines the various formats the horizontal header
can display.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign">
<tt>QCalendarWidget.SingleLetterDayNames</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The header displays a single letter
abbreviation for day names (e.g. M for Monday).</td>
</tr>
<tr>
<td class="topAlign"><tt>QCalendarWidget.ShortDayNames</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The header displays a short abbreviation for
day names (e.g. Mon for Monday).</td>
</tr>
<tr>
<td class="topAlign"><tt>QCalendarWidget.LongDayNames</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The header displays complete day names (e.g.
Monday).</td>
</tr>
<tr>
<td class="topAlign">
<tt>QCalendarWidget.NoHorizontalHeader</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The header is hidden.</td>
</tr>
</table>
<p><b>See also</b> <a href="qcalendarwidget.html#horizontalHeaderFormat-prop">horizontalHeaderFormat</a>()
and <a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a>.</p>


<h3 class="fn"><a name="SelectionMode-enum" />QCalendarWidget.SelectionMode</h3><p>This enum describes the types of selection offered to the user
for selecting dates in the calendar.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QCalendarWidget.NoSelection</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Dates cannot be selected.</td>
</tr>
<tr>
<td class="topAlign"><tt>QCalendarWidget.SingleSelection</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Single dates can be selected.</td>
</tr>
</table>
<p><b>See also</b> <a href="qcalendarwidget.html#selectionMode-prop">selectionMode</a>.</p>


<h3 class="fn"><a name="VerticalHeaderFormat-enum" />QCalendarWidget.VerticalHeaderFormat</h3><p>This enum type defines the various formats the vertical header
can display.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QCalendarWidget.ISOWeekNumbers</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The header displays ISO week numbers as
described by <a href="qdate.html#weekNumber">QDate.weekNumber</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QCalendarWidget.NoVerticalHeader</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The header is hidden.</td>
</tr>
</table>
<p><b>See also</b> <a href="qcalendarwidget.html#verticalHeaderFormat-prop">verticalHeaderFormat</a>()
and <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QCalendarWidget" />QCalendarWidget.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a calendar widget with the given <i>parent</i>.</p>
<p>The widget is initialized with the current month and year, and
the currently selected date is today.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>


<h3 class="fn"><a name="dateEditAcceptDelay" />int QCalendarWidget.dateEditAcceptDelay (<i>self</i>)</h3><h3 class="fn"><a name="dateTextFormat" />unknown-type QCalendarWidget.dateTextFormat (<i>self</i>)</h3><p>Returns a <a href="qmap.html">QMap</a> from <a href="qdate.html">QDate</a> to <a href="qtextcharformat.html">QTextCharFormat</a> showing all dates that
use a special format that alters their rendering.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#setDateTextFormat">setDateTextFormat</a>().</p>


<h3 class="fn"><a name="dateTextFormat-2" /><a href="qtextcharformat.html">QTextCharFormat</a> QCalendarWidget.dateTextFormat (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>date</i>)</h3><p>Returns a <a href="qtextcharformat.html">QTextCharFormat</a> for
<i>date</i>. The char format can be be empty if the date is not
renderd specially.</p>


<h3 class="fn"><a name="event" />bool QCalendarWidget.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="eventFilter" />bool QCalendarWidget.eventFilter (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>watched</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qobject.html#eventFilter">QObject.eventFilter</a>().</p>


<h3 class="fn"><a name="firstDayOfWeek" /><a href="qt.html#DayOfWeek-enum">Qt.DayOfWeek</a> QCalendarWidget.firstDayOfWeek (<i>self</i>)</h3><h3 class="fn"><a name="headerTextFormat" /><a href="qtextcharformat.html">QTextCharFormat</a> QCalendarWidget.headerTextFormat (<i>self</i>)</h3><p>Returns the text char format for rendering the header.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#setHeaderTextFormat">setHeaderTextFormat</a>().</p>


<h3 class="fn"><a name="horizontalHeaderFormat" /><a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a> QCalendarWidget.horizontalHeaderFormat (<i>self</i>)</h3><h3 class="fn"><a name="isDateEditEnabled" />bool QCalendarWidget.isDateEditEnabled (<i>self</i>)</h3><h3 class="fn"><a name="isGridVisible" />bool QCalendarWidget.isGridVisible (<i>self</i>)</h3><h3 class="fn"><a name="isHeaderVisible" />bool QCalendarWidget.isHeaderVisible (<i>self</i>)</h3><h3 class="fn"><a name="isNavigationBarVisible" />bool QCalendarWidget.isNavigationBarVisible (<i>self</i>)</h3><h3 class="fn"><a name="keyPressEvent" />QCalendarWidget.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget.keyPressEvent</a>().</p>


<h3 class="fn"><a name="maximumDate" /><a href="qdate.html">QDate</a> QCalendarWidget.maximumDate (<i>self</i>)</h3><h3 class="fn"><a name="minimumDate" /><a href="qdate.html">QDate</a> QCalendarWidget.minimumDate (<i>self</i>)</h3><h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QCalendarWidget.minimumSizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget.minimumSizeHint</a>().</p>


<h3 class="fn"><a name="monthShown" />int QCalendarWidget.monthShown (<i>self</i>)</h3><p>Returns the currently displayed month. Months are numbered from
1 to 12.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#yearShown">yearShown</a>() and <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>


<h3 class="fn"><a name="mousePressEvent" />QCalendarWidget.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>


<h3 class="fn"><a name="paintCell" />QCalendarWidget.paintCell (<i>self</i>, <a href="qpainter.html">QPainter</a>&#160;<i>painter</i>, <a href="qrect.html">QRect</a>&#160;<i>rect</i>, <a href="qdate.html">QDate</a>&#160;<i>date</i>)</h3><p>Paints the cell specified by the given <i>date</i>, using the
given <i>painter</i> and <i>rect</i>.</p>


<h3 class="fn"><a name="resizeEvent" />QCalendarWidget.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>


<h3 class="fn"><a name="selectedDate" /><a href="qdate.html">QDate</a> QCalendarWidget.selectedDate (<i>self</i>)</h3><h3 class="fn"><a name="selectionMode" /><a href="qcalendarwidget.html#SelectionMode-enum">SelectionMode</a> QCalendarWidget.selectionMode (<i>self</i>)</h3><h3 class="fn"><a name="setCurrentPage" />QCalendarWidget.setCurrentPage (<i>self</i>, int&#160;<i>year</i>, int&#160;<i>month</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentPage(int,int)</tt>.</p><p>Displays the given <i>month</i> of the given <i>year</i> without
changing the selected date. Use the <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>()
function to alter the selected date.</p>
<p>The currently displayed month and year can be retrieved using
the <a href="qcalendarwidget.html#monthShown">monthShown</a>() and
<a href="qcalendarwidget.html#yearShown">yearShown</a>() functions
respectively.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#yearShown">yearShown</a>(), <a href="qcalendarwidget.html#monthShown">monthShown</a>(), <a href="qcalendarwidget.html#showPreviousMonth">showPreviousMonth</a>(),
<a href="qcalendarwidget.html#showNextMonth">showNextMonth</a>(),
<a href="qcalendarwidget.html#showPreviousYear">showPreviousYear</a>(), and
<a href="qcalendarwidget.html#showNextYear">showNextYear</a>().</p>


<h3 class="fn"><a name="setDateEditAcceptDelay" />QCalendarWidget.setDateEditAcceptDelay (<i>self</i>, int&#160;<i>delay</i>)</h3><h3 class="fn"><a name="setDateEditEnabled" />QCalendarWidget.setDateEditEnabled (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setDateRange" />QCalendarWidget.setDateRange (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>min</i>, <a href="qdate.html">QDate</a>&#160;<i>max</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setDateRange(const  ::QDate&amp;,const  ::QDate&amp;)</tt>.</p><p>Defines a date range by setting the <a href="qcalendarwidget.html#minimumDate-prop">minimumDate</a> and
<a href="qcalendarwidget.html#maximumDate-prop">maximumDate</a>
properties.</p>
<p>The date range restricts the user selection, i.e. the user can
only select dates within the specified date range. Note that</p>
<pre class="cpp">
 <span class="type"><a href="qcalendarwidget.html">QCalendarWidget</a></span> <span class="operator">*</span>calendar;

 calendar<span class="operator">-</span><span class="operator">&gt;</span>setDateRange(min<span class="operator">,</span> max);
</pre>
<p>is analogous to</p>
<pre class="cpp">
 <span class="type"><a href="qcalendarwidget.html">QCalendarWidget</a></span> <span class="operator">*</span>calendar;

 calendar<span class="operator">-</span><span class="operator">&gt;</span><a href="qcalendarwidget.html#minimumDate-prop">setMinimumDate</a>(min);
 calendar<span class="operator">-</span><span class="operator">&gt;</span><a href="qcalendarwidget.html#maximumDate-prop">setMaximumDate</a>(max);
</pre>
<p>If either the <i>min</i> or <i>max</i> parameters are not valid
<a href="qdate.html">QDate</a> objects, this function does
nothing.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#minimumDate-prop">setMinimumDate</a>() and
<a href="qcalendarwidget.html#maximumDate-prop">setMaximumDate</a>().</p>


<h3 class="fn"><a name="setDateTextFormat" />QCalendarWidget.setDateTextFormat (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>date</i>, <a href="qtextcharformat.html">QTextCharFormat</a>&#160;<i>color</i>)</h3><p>Sets the format used to render the given <i>date</i> to that
specified by <i>format</i>.</p>
<p>If <i>date</i> is null, all date formats are cleared.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#dateTextFormat">dateTextFormat</a>().</p>


<h3 class="fn"><a name="setFirstDayOfWeek" />QCalendarWidget.setFirstDayOfWeek (<i>self</i>, <a href="qt.html#DayOfWeek-enum">Qt.DayOfWeek</a>&#160;<i>dayOfWeek</i>)</h3><h3 class="fn"><a name="setGridVisible" />QCalendarWidget.setGridVisible (<i>self</i>, bool&#160;<i>show</i>)</h3><h3 class="fn"><a name="setHeaderTextFormat" />QCalendarWidget.setHeaderTextFormat (<i>self</i>, <a href="qtextcharformat.html">QTextCharFormat</a>&#160;<i>format</i>)</h3><p>Sets the text char format for rendering the header to
<i>format</i>. If you also set a weekday text format, this format's
foreground and background color will take precedence over the
header's format. The other formatting information will still be
decided by the header's format.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#headerTextFormat">headerTextFormat</a>().</p>


<h3 class="fn"><a name="setHeaderVisible" />QCalendarWidget.setHeaderVisible (<i>self</i>, bool&#160;<i>show</i>)</h3><h3 class="fn"><a name="setHorizontalHeaderFormat" />QCalendarWidget.setHorizontalHeaderFormat (<i>self</i>, <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a>&#160;<i>format</i>)</h3><h3 class="fn"><a name="setMaximumDate" />QCalendarWidget.setMaximumDate (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>date</i>)</h3><h3 class="fn"><a name="setMinimumDate" />QCalendarWidget.setMinimumDate (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>date</i>)</h3><h3 class="fn"><a name="setNavigationBarVisible" />QCalendarWidget.setNavigationBarVisible (<i>self</i>, bool&#160;<i>visible</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setNavigationBarVisible(bool)</tt>.</p><h3 class="fn"><a name="setSelectedDate" />QCalendarWidget.setSelectedDate (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>date</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setSelectedDate(const  ::QDate&amp;)</tt>.</p><h3 class="fn"><a name="setSelectionMode" />QCalendarWidget.setSelectionMode (<i>self</i>, <a href="qcalendarwidget.html#SelectionMode-enum">SelectionMode</a>&#160;<i>mode</i>)</h3><h3 class="fn"><a name="setVerticalHeaderFormat" />QCalendarWidget.setVerticalHeaderFormat (<i>self</i>, <a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a>&#160;<i>format</i>)</h3><h3 class="fn"><a name="setWeekdayTextFormat" />QCalendarWidget.setWeekdayTextFormat (<i>self</i>, <a href="qt.html#DayOfWeek-enum">Qt.DayOfWeek</a>&#160;<i>dayOfWeek</i>, <a href="qtextcharformat.html">QTextCharFormat</a>&#160;<i>format</i>)</h3><p>Sets the text char format for rendering of day in the week
<i>dayOfWeek</i> to <i>format</i>. The format will take precedence
over the header format in case of foreground and background color.
Other text formatting information is taken from the headers
format.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#weekdayTextFormat">weekdayTextFormat</a>()
and <a href="qcalendarwidget.html#setHeaderTextFormat">setHeaderTextFormat</a>().</p>


<h3 class="fn"><a name="showNextMonth" />QCalendarWidget.showNextMonth (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showNextMonth()</tt>.</p><p>Shows the next month relative to the currently displayed month.
Note that the selected date is not changed.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#showPreviousMonth">showPreviousMonth</a>(),
<a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(),
and <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>


<h3 class="fn"><a name="showNextYear" />QCalendarWidget.showNextYear (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showNextYear()</tt>.</p><p>Shows the currently displayed month in the <i>next</i> year
relative to the currently displayed year. Note that the selected
date is not changed.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#showPreviousYear">showPreviousYear</a>(),
<a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(),
and <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>


<h3 class="fn"><a name="showPreviousMonth" />QCalendarWidget.showPreviousMonth (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showPreviousMonth()</tt>.</p><p>Shows the previous month relative to the currently displayed
month. Note that the selected date is not changed.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#showNextMonth">showNextMonth</a>(), <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(), and
<a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>


<h3 class="fn"><a name="showPreviousYear" />QCalendarWidget.showPreviousYear (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showPreviousYear()</tt>.</p><p>Shows the currently displayed month in the <i>previous</i> year
relative to the currently displayed year. Note that the selected
date is not changed.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#showNextYear">showNextYear</a>(), <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(), and
<a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>


<h3 class="fn"><a name="showSelectedDate" />QCalendarWidget.showSelectedDate (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showSelectedDate()</tt>.</p><p>Shows the month of the selected date.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a>() and
<a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>


<h3 class="fn"><a name="showToday" />QCalendarWidget.showToday (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showToday()</tt>.</p><p>Shows the month of the today's date.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a>() and
<a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>


<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QCalendarWidget.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>


<h3 class="fn"><a name="updateCell" />QCalendarWidget.updateCell (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>date</i>)</h3><p>Updates the cell specified by the given <i>date</i> unless
updates are disabled or the cell is hidden.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#updateCells">updateCells</a>(), <a href="qcalendarwidget.html#yearShown">yearShown</a>(), and <a href="qcalendarwidget.html#monthShown">monthShown</a>().</p>


<h3 class="fn"><a name="updateCells" />QCalendarWidget.updateCells (<i>self</i>)</h3><p>Updates all visible cells unless updates are disabled.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#updateCell">updateCell</a>().</p>


<h3 class="fn"><a name="verticalHeaderFormat" /><a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a> QCalendarWidget.verticalHeaderFormat (<i>self</i>)</h3><h3 class="fn"><a name="weekdayTextFormat" /><a href="qtextcharformat.html">QTextCharFormat</a> QCalendarWidget.weekdayTextFormat (<i>self</i>, <a href="qt.html#DayOfWeek-enum">Qt.DayOfWeek</a>&#160;<i>dayOfWeek</i>)</h3><p>Returns the text char format for rendering of day in the week
<i>dayOfWeek</i>.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#setWeekdayTextFormat">setWeekdayTextFormat</a>()
and <a href="qcalendarwidget.html#headerTextFormat">headerTextFormat</a>().</p>


<h3 class="fn"><a name="yearShown" />int QCalendarWidget.yearShown (<i>self</i>)</h3><p>Returns the year of the currently displayed month. Months are
numbered from 1 to 12.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#monthShown">monthShown</a>() and <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="activated" />void activated (const  ::QDate&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the user presses the Return or
Enter key or double-clicks a <i>date</i> in the calendar
widget.</p>


<h3 class="fn"><a name="clicked" />void clicked (const  ::QDate&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a mouse button is clicked. The date
the mouse was clicked on is specified by <i>date</i>. The signal is
only emitted when clicked on a valid date, e.g., dates are not
outside the <a href="qcalendarwidget.html#minimumDate-prop">minimumDate</a>() and
<a href="qcalendarwidget.html#maximumDate-prop">maximumDate</a>().
If the selection mode is <a href="qcalendarwidget.html#SelectionMode-enum">NoSelection</a>, this
signal will not be emitted.</p>


<h3 class="fn"><a name="currentPageChanged" />void currentPageChanged (int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the currently shown month is
changed. The new <i>year</i> and <i>month</i> are passed as
parameters.</p>
<p><b>See also</b> <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>


<h3 class="fn"><a name="selectionChanged" />void selectionChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the currently selected date is
changed.</p>
<p>The currently selected date can be changed by the user using the
mouse or keyboard, or by the programmer using <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>
<p><b>See also</b> <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.12.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt&#160;4.8.7</td></tr></table></div></address></body></html>