<?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">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <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 <i>parent</i> = None)</li><li><div class="fn" />int <b><a href="qcalendarwidget.html#dateEditAcceptDelay">dateEditAcceptDelay</a></b> (<i>self</i>)</li><li><div class="fn" />dict-of-QDate-QTextCharFormat <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 <i>date</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#event">event</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" />bool <b><a href="qcalendarwidget.html#eventFilter">eventFilter</a></b> (<i>self</i>, QObject <i>watched</i>, QEvent <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 <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 <i>event</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#paintCell">paintCell</a></b> (<i>self</i>, QPainter <i>painter</i>, QRect <i>rect</i>, QDate <i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent <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 <i>year</i>, int <i>month</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateEditAcceptDelay">setDateEditAcceptDelay</a></b> (<i>self</i>, int <i>delay</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateEditEnabled">setDateEditEnabled</a></b> (<i>self</i>, bool <i>enable</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateRange">setDateRange</a></b> (<i>self</i>, QDate <i>min</i>, QDate <i>max</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setDateTextFormat">setDateTextFormat</a></b> (<i>self</i>, QDate <i>date</i>, QTextCharFormat <i>color</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setFirstDayOfWeek">setFirstDayOfWeek</a></b> (<i>self</i>, Qt.DayOfWeek <i>dayOfWeek</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setGridVisible">setGridVisible</a></b> (<i>self</i>, bool <i>show</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setHeaderTextFormat">setHeaderTextFormat</a></b> (<i>self</i>, QTextCharFormat <i>format</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setHeaderVisible">setHeaderVisible</a></b> (<i>self</i>, bool <i>show</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setHorizontalHeaderFormat">setHorizontalHeaderFormat</a></b> (<i>self</i>, HorizontalHeaderFormat <i>format</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setMaximumDate">setMaximumDate</a></b> (<i>self</i>, QDate <i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setMinimumDate">setMinimumDate</a></b> (<i>self</i>, QDate <i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setNavigationBarVisible">setNavigationBarVisible</a></b> (<i>self</i>, bool <i>visible</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setSelectedDate">setSelectedDate</a></b> (<i>self</i>, QDate <i>date</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setSelectionMode">setSelectionMode</a></b> (<i>self</i>, SelectionMode <i>mode</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setVerticalHeaderFormat">setVerticalHeaderFormat</a></b> (<i>self</i>, VerticalHeaderFormat <i>format</i>)</li><li><div class="fn" /><b><a href="qcalendarwidget.html#setWeekdayTextFormat">setWeekdayTextFormat</a></b> (<i>self</i>, Qt.DayOfWeek <i>dayOfWeek</i>, QTextCharFormat <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 <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 <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&)</li><li><div class="fn" />void <b><a href="qcalendarwidget.html#clicked">clicked</a></b> (const QDate&)</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">></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> <i>parent</i> = 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" />dict-of-QDate-QTextCharFormat 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> <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> <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> <i>watched</i>, <a href="qevent.html">QEvent</a> <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> <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> <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> <i>painter</i>, <a href="qrect.html">QRect</a> <i>rect</i>, <a href="qdate.html">QDate</a> <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> <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 <i>year</i>, int <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 <i>delay</i>)</h3><h3 class="fn"><a name="setDateEditEnabled" />QCalendarWidget.setDateEditEnabled (<i>self</i>, bool <i>enable</i>)</h3><h3 class="fn"><a name="setDateRange" />QCalendarWidget.setDateRange (<i>self</i>, <a href="qdate.html">QDate</a> <i>min</i>, <a href="qdate.html">QDate</a> <i>max</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setDateRange(const QDate&,const QDate&)</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">></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">></span><a href="qcalendarwidget.html#minimumDate-prop">setMinimumDate</a>(min); calendar<span class="operator">-</span><span class="operator">></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> <i>date</i>, <a href="qtextcharformat.html">QTextCharFormat</a> <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> <i>dayOfWeek</i>)</h3><h3 class="fn"><a name="setGridVisible" />QCalendarWidget.setGridVisible (<i>self</i>, bool <i>show</i>)</h3><h3 class="fn"><a name="setHeaderTextFormat" />QCalendarWidget.setHeaderTextFormat (<i>self</i>, <a href="qtextcharformat.html">QTextCharFormat</a> <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 <i>show</i>)</h3><h3 class="fn"><a name="setHorizontalHeaderFormat" />QCalendarWidget.setHorizontalHeaderFormat (<i>self</i>, <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a> <i>format</i>)</h3><h3 class="fn"><a name="setMaximumDate" />QCalendarWidget.setMaximumDate (<i>self</i>, <a href="qdate.html">QDate</a> <i>date</i>)</h3><h3 class="fn"><a name="setMinimumDate" />QCalendarWidget.setMinimumDate (<i>self</i>, <a href="qdate.html">QDate</a> <i>date</i>)</h3><h3 class="fn"><a name="setNavigationBarVisible" />QCalendarWidget.setNavigationBarVisible (<i>self</i>, bool <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> <i>date</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setSelectedDate(const QDate&)</tt>.</p><h3 class="fn"><a name="setSelectionMode" />QCalendarWidget.setSelectionMode (<i>self</i>, <a href="qcalendarwidget.html#SelectionMode-enum">SelectionMode</a> <i>mode</i>)</h3><h3 class="fn"><a name="setVerticalHeaderFormat" />QCalendarWidget.setVerticalHeaderFormat (<i>self</i>, <a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a> <i>format</i>)</h3><h3 class="fn"><a name="setWeekdayTextFormat" />QCalendarWidget.setWeekdayTextFormat (<i>self</i>, <a href="qt.html#DayOfWeek-enum">Qt.DayOfWeek</a> <i>dayOfWeek</i>, <a href="qtextcharformat.html">QTextCharFormat</a> <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> <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> <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&)</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&)</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 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>