~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qcalendarwidget.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-10-12 23:14:14 UTC
  • mto: (15.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20061012231414-y2oqbom5dy389os0
Tags: upstream-4.2.0
ImportĀ upstreamĀ versionĀ 4.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.2.0-qt-1159540607313/qt-x11-opensource-src-4.2.0/src/gui/widgets/qcalendarwidget.cpp -->
 
6
<head>
 
7
  <title>Qt 4.2: QCalendarWidget Class Reference</title>
 
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
 
9
</head>
 
10
<body>
 
11
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
12
<tr>
 
13
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
 
14
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
15
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QCalendarWidget Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
 
16
<p>The QCalendarWidget class provides a monthly based calendar widget allowing the user to select a date. <a href="#details">More...</a></p>
 
17
<pre> #include &lt;QCalendarWidget&gt;</pre><p>Inherits <a href="qwidget.html">QWidget</a>.</p>
 
18
<p>This class was introduced in Qt 4.2.</p>
 
19
<ul>
 
20
<li><a href="qcalendarwidget-members.html">List of all members, including inherited members</a></li>
 
21
</ul>
 
22
<a name="public-types"></a>
 
23
<h3>Public Types</h3>
 
24
<ul>
 
25
<li><div class="fn"/>enum <b><a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a></b> { SingleLetterDayNames, ShortDayNames, LongDayNames, NoHorizontalHeader }</li>
 
26
<li><div class="fn"/>enum <b><a href="qcalendarwidget.html#SelectionMode-enum">SelectionMode</a></b> { NoSelection, SingleSelection }</li>
 
27
<li><div class="fn"/>enum <b><a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a></b> { ISOWeekNumbers, NoVerticalHeader }</li>
 
28
</ul>
 
29
<a name="properties"></a>
 
30
<h3>Properties</h3>
 
31
<p><table width="100%" border="0" cellpadding="0" cellspacing="0">
 
32
<tr><td width="45%" valign="top"><ul>
 
33
<li><div class="fn"/><b><a href="qcalendarwidget.html#firstDayOfWeek-prop">firstDayOfWeek</a></b> : Qt::DayOfWeek</li>
 
34
<li><div class="fn"/><b><a href="qcalendarwidget.html#gridVisible-prop">gridVisible</a></b> : bool</li>
 
35
<li><div class="fn"/><b><a href="qcalendarwidget.html#headerVisible-prop">headerVisible</a></b> : bool</li>
 
36
<li><div class="fn"/><b><a href="qcalendarwidget.html#horizontalHeaderFormat-prop">horizontalHeaderFormat</a></b> : HorizontalHeaderFormat</li>
 
37
<li><div class="fn"/><b><a href="qcalendarwidget.html#maximumDate-prop">maximumDate</a></b> : QDate</li>
 
38
</ul></td><td valign="top"><ul>
 
39
<li><div class="fn"/><b><a href="qcalendarwidget.html#minimumDate-prop">minimumDate</a></b> : QDate</li>
 
40
<li><div class="fn"/><b><a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a></b> : QDate</li>
 
41
<li><div class="fn"/><b><a href="qcalendarwidget.html#selectionMode-prop">selectionMode</a></b> : SelectionMode</li>
 
42
<li><div class="fn"/><b><a href="qcalendarwidget.html#verticalHeaderFormat-prop">verticalHeaderFormat</a></b> : VerticalHeaderFormat</li>
 
43
</ul>
 
44
</td></tr>
 
45
</table></p>
 
46
<ul>
 
47
<li><div class="fn"/>55 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
48
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
49
</ul>
 
50
<a name="public-functions"></a>
 
51
<h3>Public Functions</h3>
 
52
<ul>
 
53
<li><div class="fn"/><b><a href="qcalendarwidget.html#QCalendarWidget">QCalendarWidget</a></b> ( QWidget * <i>parent</i> = 0 )</li>
 
54
<li><div class="fn"/><b><a href="qcalendarwidget.html#dtor.QCalendarWidget">~QCalendarWidget</a></b> ()</li>
 
55
<li><div class="fn"/>QMap&lt;QDate, QTextCharFormat&gt; <b><a href="qcalendarwidget.html#dateTextFormat">dateTextFormat</a></b> () const</li>
 
56
<li><div class="fn"/>QTextCharFormat <b><a href="qcalendarwidget.html#dateTextFormat-2">dateTextFormat</a></b> ( const QDate &amp; <i>date</i> ) const</li>
 
57
<li><div class="fn"/>Qt::DayOfWeek <b><a href="qcalendarwidget.html#firstDayOfWeek-prop">firstDayOfWeek</a></b> () const</li>
 
58
<li><div class="fn"/>QTextCharFormat <b><a href="qcalendarwidget.html#headerTextFormat">headerTextFormat</a></b> () const</li>
 
59
<li><div class="fn"/>HorizontalHeaderFormat <b><a href="qcalendarwidget.html#horizontalHeaderFormat-prop">horizontalHeaderFormat</a></b> () const</li>
 
60
<li><div class="fn"/>bool <b><a href="qcalendarwidget.html#gridVisible-prop">isGridVisible</a></b> () const</li>
 
61
<li><div class="fn"/>bool <b><a href="qcalendarwidget.html#headerVisible-prop">isHeaderVisible</a></b> () const</li>
 
62
<li><div class="fn"/>QDate <b><a href="qcalendarwidget.html#maximumDate-prop">maximumDate</a></b> () const</li>
 
63
<li><div class="fn"/>QDate <b><a href="qcalendarwidget.html#minimumDate-prop">minimumDate</a></b> () const</li>
 
64
<li><div class="fn"/>int <b><a href="qcalendarwidget.html#monthShown">monthShown</a></b> () const</li>
 
65
<li><div class="fn"/>QDate <b><a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a></b> () const</li>
 
66
<li><div class="fn"/>SelectionMode <b><a href="qcalendarwidget.html#selectionMode-prop">selectionMode</a></b> () const</li>
 
67
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#setDateTextFormat">setDateTextFormat</a></b> ( const QDate &amp; <i>date</i>, const QTextCharFormat &amp; <i>format</i> )</li>
 
68
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#firstDayOfWeek-prop">setFirstDayOfWeek</a></b> ( Qt::DayOfWeek <i>dayOfWeek</i> )</li>
 
69
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#gridVisible-prop">setGridVisible</a></b> ( bool <i>show</i> )</li>
 
70
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#setHeaderTextFormat">setHeaderTextFormat</a></b> ( const QTextCharFormat &amp; <i>format</i> )</li>
 
71
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#headerVisible-prop">setHeaderVisible</a></b> ( bool <i>show</i> )</li>
 
72
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#horizontalHeaderFormat-prop">setHorizontalHeaderFormat</a></b> ( HorizontalHeaderFormat <i>format</i> )</li>
 
73
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#maximumDate-prop">setMaximumDate</a></b> ( const QDate &amp; <i>date</i> )</li>
 
74
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#minimumDate-prop">setMinimumDate</a></b> ( const QDate &amp; <i>date</i> )</li>
 
75
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#selectionMode-prop">setSelectionMode</a></b> ( SelectionMode <i>mode</i> )</li>
 
76
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#verticalHeaderFormat-prop">setVerticalHeaderFormat</a></b> ( VerticalHeaderFormat <i>format</i> )</li>
 
77
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#setWeekdayTextFormat">setWeekdayTextFormat</a></b> ( Qt::DayOfWeek <i>dayOfWeek</i>, const QTextCharFormat &amp; <i>format</i> )</li>
 
78
<li><div class="fn"/>VerticalHeaderFormat <b><a href="qcalendarwidget.html#verticalHeaderFormat-prop">verticalHeaderFormat</a></b> () const</li>
 
79
<li><div class="fn"/>QTextCharFormat <b><a href="qcalendarwidget.html#weekdayTextFormat">weekdayTextFormat</a></b> ( Qt::DayOfWeek <i>dayOfWeek</i> ) const</li>
 
80
<li><div class="fn"/>int <b><a href="qcalendarwidget.html#yearShown">yearShown</a></b> () const</li>
 
81
</ul>
 
82
<ul>
 
83
<li><div class="fn"/>195 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
84
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
85
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
86
</ul>
 
87
<a name="public-slots"></a>
 
88
<h3>Public Slots</h3>
 
89
<ul>
 
90
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a></b> ( int <i>year</i>, int <i>month</i> )</li>
 
91
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#setDateRange">setDateRange</a></b> ( const QDate &amp; <i>min</i>, const QDate &amp; <i>max</i> )</li>
 
92
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a></b> ( const QDate &amp; <i>date</i> )</li>
 
93
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#showNextMonth">showNextMonth</a></b> ()</li>
 
94
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#showNextYear">showNextYear</a></b> ()</li>
 
95
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#showPreviousMonth">showPreviousMonth</a></b> ()</li>
 
96
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#showPreviousYear">showPreviousYear</a></b> ()</li>
 
97
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#showSelectedDate">showSelectedDate</a></b> ()</li>
 
98
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#showToday">showToday</a></b> ()</li>
 
99
</ul>
 
100
<ul>
 
101
<li><div class="fn"/>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
102
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
103
</ul>
 
104
<a name="signals"></a>
 
105
<h3>Signals</h3>
 
106
<ul>
 
107
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#activated">activated</a></b> ( const QDate &amp; <i>date</i> )</li>
 
108
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#clicked">clicked</a></b> ( const QDate &amp; <i>date</i> )</li>
 
109
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#currentPageChanged">currentPageChanged</a></b> ( int <i>year</i>, int <i>month</i> )</li>
 
110
<li><div class="fn"/>void <b><a href="qcalendarwidget.html#selectionChanged">selectionChanged</a></b> ()</li>
 
111
</ul>
 
112
<ul>
 
113
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
114
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
115
</ul>
 
116
<a name="protected-functions"></a>
 
117
<h3>Protected Functions</h3>
 
118
<ul>
 
119
<li><div class="fn"/>virtual void <b><a href="qcalendarwidget.html#paintCell">paintCell</a></b> ( QPainter * <i>painter</i>, const QRect &amp; <i>rect</i>, const QDate &amp; <i>date</i> ) const</li>
 
120
</ul>
 
121
<ul>
 
122
<li><div class="fn"/>38 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
123
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
124
<li><div class="fn"/>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
 
125
</ul>
 
126
<h3>Additional Inherited Members</h3>
 
127
<ul>
 
128
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
129
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
130
<li><div class="fn"/>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
 
131
</ul>
 
132
<a name="details"></a>
 
133
<hr />
 
134
<h2>Detailed Description</h2>
 
135
<p>The QCalendarWidget class provides a monthly based calendar widget allowing the user to select a date.</p>
 
136
<p align="center"><img 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. The currently displayed month and year can be retrieved using the currentPageMonth() and currentPageYear() functions, respectively.</p>
 
137
<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>
 
138
<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>
 
139
<p>The notation of the days can be altered to a single letter abbreviations (&quot;M&quot; for &quot;Monday&quot;) 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>
 
140
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
 
141
<tr valign="top" class="odd"><td><p align="center"><img src="images/qcalendarwidget-grid.png" /></p></td></tr>
 
142
<tr valign="top" class="even"><td><pre> QCalendarWidget *calendar;
 
143
 calendar-&gt;setGridVisible(true);</pre>
 
144
</td></tr>
 
145
</table></p>
 
146
<p>Finally, the day in the first column can be altered using the <a href="qcalendarwidget.html#firstDayOfWeek-prop">setFirstDayOfWeek</a>() function.</p>
 
147
<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>
 
148
<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>
 
149
<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>
 
150
<p>See also <a href="qdate.html">QDate</a>, <a href="qdateedit.html">QDateEdit</a>, and <a href="qtextcharformat.html">QTextCharFormat</a>.</p>
 
151
<hr />
 
152
<h2>Member Type Documentation</h2>
 
153
<h3 class="fn"><a name="HorizontalHeaderFormat-enum"></a>enum QCalendarWidget::HorizontalHeaderFormat</h3>
 
154
<p>This enum type defines the various formats the horizontal header can display.</p>
 
155
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
 
156
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
157
<tr><td valign="top"><tt>QCalendarWidget::SingleLetterDayNames</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The header displays a single letter abbreviation for day names (e.g. M for Monday).</td></tr>
 
158
<tr><td valign="top"><tt>QCalendarWidget::ShortDayNames</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The header displays a short abbreviation for day names (e.g. Mon for Monday).</td></tr>
 
159
<tr><td valign="top"><tt>QCalendarWidget::LongDayNames</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">The header displays complete day names (e.g. Monday).</td></tr>
 
160
<tr><td valign="top"><tt>QCalendarWidget::NoHorizontalHeader</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The header is hidden.</td></tr>
 
161
</table></p>
 
162
<p>See also <a href="qcalendarwidget.html#horizontalHeaderFormat-prop">horizontalHeaderFormat</a>() and <a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a>.</p>
 
163
<h3 class="fn"><a name="SelectionMode-enum"></a>enum QCalendarWidget::SelectionMode</h3>
 
164
<p>This enum describes the types of selection offered to the user for selecting dates in the calendar.</p>
 
165
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
 
166
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
167
<tr><td valign="top"><tt>QCalendarWidget::NoSelection</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Dates cannot be selected.</td></tr>
 
168
<tr><td valign="top"><tt>QCalendarWidget::SingleSelection</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Single dates can be selected.</td></tr>
 
169
</table></p>
 
170
<p>See also <a href="qcalendarwidget.html#selectionMode-prop">selectionMode</a>.</p>
 
171
<h3 class="fn"><a name="VerticalHeaderFormat-enum"></a>enum QCalendarWidget::VerticalHeaderFormat</h3>
 
172
<p>This enum type defines the various formats the vertical header can display.</p>
 
173
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
 
174
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
175
<tr><td valign="top"><tt>QCalendarWidget::ISOWeekNumbers</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The header displays a ISO week numbers <a href="qdate.html#weekNumber">QDate::weekNumber</a>().</td></tr>
 
176
<tr><td valign="top"><tt>QCalendarWidget::NoVerticalHeader</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The header is hidden.</td></tr>
 
177
</table></p>
 
178
<p>See also <a href="qcalendarwidget.html#verticalHeaderFormat-prop">verticalHeaderFormat</a>() and <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a>.</p>
 
179
<hr />
 
180
<h2>Property Documentation</h2>
 
181
<h3 class="fn"><a name="firstDayOfWeek-prop"></a>firstDayOfWeek : <a href="qt.html#DayOfWeek-enum">Qt::DayOfWeek</a></h3>
 
182
<p>This property holds a value identifying the day displayed in the first column.</p>
 
183
<p>By default, the day displayed in the first column is Sunday</p>
 
184
<p>Access functions:</p>
 
185
<ul>
 
186
<li><div class="fn"/><b>Qt::DayOfWeek firstDayOfWeek () const</b></li>
 
187
<li><div class="fn"/><b>void setFirstDayOfWeek ( Qt::DayOfWeek <i>dayOfWeek</i> )</b></li>
 
188
</ul>
 
189
<h3 class="fn"><a name="gridVisible-prop"></a>gridVisible : bool</h3>
 
190
<p>This property holds whether the table grid is displayed.</p>
 
191
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
 
192
<tr valign="top" class="odd"><td><img src="images/qcalendarwidget-grid.png" /></td></tr>
 
193
<tr valign="top" class="even"><td><pre> QCalendarWidget *calendar;
 
194
 calendar-&gt;setGridVisible(true);</pre>
 
195
</td></tr>
 
196
</table></p>
 
197
<p>The default value is false.</p>
 
198
<p>Access functions:</p>
 
199
<ul>
 
200
<li><div class="fn"/><b>bool isGridVisible () const</b></li>
 
201
<li><div class="fn"/><b>void setGridVisible ( bool <i>show</i> )</b></li>
 
202
</ul>
 
203
<h3 class="fn"><a name="headerVisible-prop"></a>headerVisible : bool</h3>
 
204
<p>This property holds whether the Header is shown or not.</p>
 
205
<p>When this property is set to true the next month, previous month, month selection, year selection controls are shown on top</p>
 
206
<p>When the property is set to false, these controls are hidden.</p>
 
207
<p>The default value is true.</p>
 
208
<p>Access functions:</p>
 
209
<ul>
 
210
<li><div class="fn"/><b>bool isHeaderVisible () const</b></li>
 
211
<li><div class="fn"/><b>void setHeaderVisible ( bool <i>show</i> )</b></li>
 
212
</ul>
 
213
<h3 class="fn"><a name="horizontalHeaderFormat-prop"></a>horizontalHeaderFormat : <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">HorizontalHeaderFormat</a></h3>
 
214
<p>This property holds the format of the horizontal header.</p>
 
215
<p>The default value is <a href="qcalendarwidget.html#HorizontalHeaderFormat-enum">QCalendarWidget::ShortDayNames</a>.</p>
 
216
<p>Access functions:</p>
 
217
<ul>
 
218
<li><div class="fn"/><b>HorizontalHeaderFormat horizontalHeaderFormat () const</b></li>
 
219
<li><div class="fn"/><b>void setHorizontalHeaderFormat ( HorizontalHeaderFormat <i>format</i> )</b></li>
 
220
</ul>
 
221
<h3 class="fn"><a name="maximumDate-prop"></a>maximumDate : <a href="qdate.html">QDate</a></h3>
 
222
<p>This property holds the maximum date of the currently specified date range.</p>
 
223
<p>The user will not be able to select a date which is after the currently set maximum date.</p>
 
224
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
 
225
<tr valign="top" class="odd"><td><p align="center"><img src="images/qcalendarwidget-maximum.png" /></p></td></tr>
 
226
<tr valign="top" class="even"><td><pre> QCalendarWidget *calendar;
 
227
 calendar-&gt;setGridVisible(true);
 
228
 calendar-&gt;setMaximumDate(QDate(2006, 7, 3));</pre>
 
229
</td></tr>
 
230
</table></p>
 
231
<p>By default, the maximum date is the last day the <a href="qdate.html">QDate</a> class can handle.</p>
 
232
<p>When setting a maximum date, the <a href="qcalendarwidget.html#minimumDate-prop">minimumDate</a> and <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a> properties are adjusted if the selection range becomes invalid. If the provided date is not a valid <a href="qdate.html">QDate</a> object, the setMaximumDate() function does nothing.</p>
 
233
<p>Access functions:</p>
 
234
<ul>
 
235
<li><div class="fn"/><b>QDate maximumDate () const</b></li>
 
236
<li><div class="fn"/><b>void setMaximumDate ( const QDate &amp; <i>date</i> )</b></li>
 
237
</ul>
 
238
<p>See also <a href="qcalendarwidget.html#setDateRange">setDateRange</a>().</p>
 
239
<h3 class="fn"><a name="minimumDate-prop"></a>minimumDate : <a href="qdate.html">QDate</a></h3>
 
240
<p>This property holds the minimum date of the currently specified date range.</p>
 
241
<p>The user will not be able to select a date that is before the currently set minimum date.</p>
 
242
<p><table align="center" cellpadding="2" cellspacing="1" border="0">
 
243
<tr valign="top" class="odd"><td><p align="center"><img src="images/qcalendarwidget-minimum.png" /></p></td></tr>
 
244
<tr valign="top" class="even"><td><pre> QCalendarWidget *calendar;
 
245
 calendar-&gt;setGridVisible(true);
 
246
 calendar-&gt;setMinimumDate(QDate(2006, 6, 19));</pre>
 
247
</td></tr>
 
248
</table></p>
 
249
<p>By default, the minimum date is the earliest date that the <a href="qdate.html">QDate</a> class can handle.</p>
 
250
<p>When setting a minimum date, the <a href="qcalendarwidget.html#maximumDate-prop">maximumDate</a> and <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a> properties are adjusted if the selection range becomes invalid. If the provided date is not a valid <a href="qdate.html">QDate</a> object, the setMinimumDate() function does nothing.</p>
 
251
<p>Access functions:</p>
 
252
<ul>
 
253
<li><div class="fn"/><b>QDate minimumDate () const</b></li>
 
254
<li><div class="fn"/><b>void setMinimumDate ( const QDate &amp; <i>date</i> )</b></li>
 
255
</ul>
 
256
<p>See also <a href="qcalendarwidget.html#setDateRange">setDateRange</a>().</p>
 
257
<h3 class="fn"><a name="selectedDate-prop"></a>selectedDate : <a href="qdate.html">QDate</a></h3>
 
258
<p>This property holds the currently selected date.</p>
 
259
<p>The selected date must be within the date range specified by the <a href="qcalendarwidget.html#minimumDate-prop">minimumDate</a> and <a href="qcalendarwidget.html#maximumDate-prop">maximumDate</a> properties. By default, the selected date is the current date.</p>
 
260
<p>Access functions:</p>
 
261
<ul>
 
262
<li><div class="fn"/><b>QDate selectedDate () const</b></li>
 
263
<li><div class="fn"/><b>void setSelectedDate ( const QDate &amp; <i>date</i> )</b></li>
 
264
</ul>
 
265
<p>See also <a href="qcalendarwidget.html#setDateRange">setDateRange</a>().</p>
 
266
<h3 class="fn"><a name="selectionMode-prop"></a>selectionMode : <a href="qcalendarwidget.html#SelectionMode-enum">SelectionMode</a></h3>
 
267
<p>This property holds the type of selection the user can make in the calendar.</p>
 
268
<p>When this property is set to <a href="qcalendarwidget.html#SelectionMode-enum">SingleSelection</a>, the user can select a date within the minimum and maximum allowed dates, using either the mouse or the keyboard.</p>
 
269
<p>When the property is set to <a href="qcalendarwidget.html#SelectionMode-enum">NoSelection</a>, the user will be unable to select dates, but they can still be selected programmatically.</p>
 
270
<p>The default value is <a href="qcalendarwidget.html#SelectionMode-enum">SingleSelection</a>.</p>
 
271
<p>Access functions:</p>
 
272
<ul>
 
273
<li><div class="fn"/><b>SelectionMode selectionMode () const</b></li>
 
274
<li><div class="fn"/><b>void setSelectionMode ( SelectionMode <i>mode</i> )</b></li>
 
275
</ul>
 
276
<h3 class="fn"><a name="verticalHeaderFormat-prop"></a>verticalHeaderFormat : <a href="qcalendarwidget.html#VerticalHeaderFormat-enum">VerticalHeaderFormat</a></h3>
 
277
<p>This property holds the format of the vertical header.</p>
 
278
<p>The default value is QCalendarWidget::ISOWeekNumber.</p>
 
279
<p>Access functions:</p>
 
280
<ul>
 
281
<li><div class="fn"/><b>VerticalHeaderFormat verticalHeaderFormat () const</b></li>
 
282
<li><div class="fn"/><b>void setVerticalHeaderFormat ( VerticalHeaderFormat <i>format</i> )</b></li>
 
283
</ul>
 
284
<hr />
 
285
<h2>Member Function Documentation</h2>
 
286
<h3 class="fn"><a name="QCalendarWidget"></a>QCalendarWidget::QCalendarWidget ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
 
287
<p>Constructs a calendar widget with the given <i>parent</i>.</p>
 
288
<p>The widget is initialized with the current month and year, and the currently selected date is today.</p>
 
289
<p>See also <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>
 
290
<h3 class="fn"><a name="dtor.QCalendarWidget"></a>QCalendarWidget::~QCalendarWidget ()</h3>
 
291
<p>Destroys the calendar widget.</p>
 
292
<h3 class="fn"><a name="activated"></a>void QCalendarWidget::activated ( const <a href="qdate.html">QDate</a> &amp; <i>date</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
293
<p>This signal is emitted whenever the user presses the Return or Enter key, the space bar or double-clicks a <i>date</i> in the calendar widget.</p>
 
294
<h3 class="fn"><a name="clicked"></a>void QCalendarWidget::clicked ( const <a href="qdate.html">QDate</a> &amp; <i>date</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
295
<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.</p>
 
296
<h3 class="fn"><a name="currentPageChanged"></a>void QCalendarWidget::currentPageChanged ( int <i>year</i>, int <i>month</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
297
<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>
 
298
<p>See also <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>
 
299
<h3 class="fn"><a name="dateTextFormat"></a><a href="qmap.html">QMap</a>&lt;<a href="qdate.html">QDate</a>, <a href="qtextcharformat.html">QTextCharFormat</a>&gt; QCalendarWidget::dateTextFormat () const</h3>
 
300
<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>
 
301
<p>See also <a href="qcalendarwidget.html#setDateTextFormat">setDateTextFormat</a>().</p>
 
302
<h3 class="fn"><a name="dateTextFormat-2"></a><a href="qtextcharformat.html">QTextCharFormat</a> QCalendarWidget::dateTextFormat ( const <a href="qdate.html">QDate</a> &amp; <i>date</i> ) const</h3>
 
303
<p>This is an overloaded member function, provided for convenience.</p>
 
304
<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>
 
305
<h3 class="fn"><a name="headerTextFormat"></a><a href="qtextcharformat.html">QTextCharFormat</a> QCalendarWidget::headerTextFormat () const</h3>
 
306
<p>Returns the text char format for rendering the header.</p>
 
307
<p>See also <a href="qcalendarwidget.html#setHeaderTextFormat">setHeaderTextFormat</a>().</p>
 
308
<h3 class="fn"><a name="monthShown"></a>int QCalendarWidget::monthShown () const</h3>
 
309
<p>Returns the currently displayed month.</p>
 
310
<p>See also <a href="qcalendarwidget.html#yearShown">yearShown</a>() and <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>
 
311
<h3 class="fn"><a name="paintCell"></a>void QCalendarWidget::paintCell ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qrect.html">QRect</a> &amp; <i>rect</i>, const <a href="qdate.html">QDate</a> &amp; <i>date</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
312
<p>Paints the cell specified by the given <i>date</i>, using the given <i>painter</i> and <i>rect</i>.</p>
 
313
<h3 class="fn"><a name="selectionChanged"></a>void QCalendarWidget::selectionChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
314
<p>This signal is emitted when the currently selected date is changed.</p>
 
315
<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>
 
316
<p>See also <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a>().</p>
 
317
<h3 class="fn"><a name="setCurrentPage"></a>void QCalendarWidget::setCurrentPage ( int <i>year</i>, int <i>month</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
318
<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>
 
319
<p>The currently displayed month and year can be retrieved using the currentPageMonth() and currentPageYear() functions respectively.</p>
 
320
<p>See also <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>
 
321
<h3 class="fn"><a name="setDateRange"></a>void QCalendarWidget::setDateRange ( const <a href="qdate.html">QDate</a> &amp; <i>min</i>, const <a href="qdate.html">QDate</a> &amp; <i>max</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
322
<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>
 
323
<p>The date range restricts the user selection, i.e. the user can only select dates within the specified date range. Note that</p>
 
324
<pre> QCalendarWidget *calendar;
 
325
 
 
326
 calendar-&gt;setDateRange(min, max);</pre>
 
327
<p>is analogous to</p>
 
328
<pre> QCalendarWidget *calendar;
 
329
 
 
330
 calendar-&gt;setMinimumDate(min);
 
331
 calendar-&gt;setMaximumDate(max);</pre>
 
332
<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>
 
333
<p>See also <a href="qcalendarwidget.html#minimumDate-prop">setMinimumDate</a>() and <a href="qcalendarwidget.html#maximumDate-prop">setMaximumDate</a>().</p>
 
334
<h3 class="fn"><a name="setDateTextFormat"></a>void QCalendarWidget::setDateTextFormat ( const <a href="qdate.html">QDate</a> &amp; <i>date</i>, const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>format</i> )</h3>
 
335
<p>Sets <i>format</i> to render <i>date</i>.</p>
 
336
<p>See also <a href="qcalendarwidget.html#dateTextFormat">dateTextFormat</a>().</p>
 
337
<h3 class="fn"><a name="setHeaderTextFormat"></a>void QCalendarWidget::setHeaderTextFormat ( const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>format</i> )</h3>
 
338
<p>Sets the text char format for rendering the header to <i>format</i>.</p>
 
339
<p>See also <a href="qcalendarwidget.html#headerTextFormat">headerTextFormat</a>().</p>
 
340
<h3 class="fn"><a name="setWeekdayTextFormat"></a>void QCalendarWidget::setWeekdayTextFormat ( <a href="qt.html#DayOfWeek-enum">Qt::DayOfWeek</a> <i>dayOfWeek</i>, const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>format</i> )</h3>
 
341
<p>Sets the text char format for rendering of day in the week <i>dayOfWeek</i> to <i>format</i>.</p>
 
342
<p>See also <a href="qcalendarwidget.html#weekdayTextFormat">weekdayTextFormat</a>() and <a href="qcalendarwidget.html#setHeaderTextFormat">setHeaderTextFormat</a>().</p>
 
343
<h3 class="fn"><a name="showNextMonth"></a>void QCalendarWidget::showNextMonth ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
344
<p>Shows the next month relative to the currently displayed month. Note that the selected date is not changed.</p>
 
345
<p>See also <a href="qcalendarwidget.html#showPreviousMonth">showPreviousMonth</a>(), <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(), and <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>
 
346
<h3 class="fn"><a name="showNextYear"></a>void QCalendarWidget::showNextYear ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
347
<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>
 
348
<p>See also <a href="qcalendarwidget.html#showPreviousYear">showPreviousYear</a>(), <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(), and <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>
 
349
<h3 class="fn"><a name="showPreviousMonth"></a>void QCalendarWidget::showPreviousMonth ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
350
<p>Shows the previous month relative to the currently displayed month. Note that the selected date is not changed.</p>
 
351
<p>See also <a href="qcalendarwidget.html#showNextMonth">showNextMonth</a>(), <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(), and <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>
 
352
<h3 class="fn"><a name="showPreviousYear"></a>void QCalendarWidget::showPreviousYear ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
353
<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>
 
354
<p>See also <a href="qcalendarwidget.html#showNextYear">showNextYear</a>(), <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>(), and <a href="qcalendarwidget.html#selectedDate-prop">setSelectedDate</a>().</p>
 
355
<h3 class="fn"><a name="showSelectedDate"></a>void QCalendarWidget::showSelectedDate ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
356
<p>Shows the month of the selected date.</p>
 
357
<p>See also <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a>() and <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>
 
358
<h3 class="fn"><a name="showToday"></a>void QCalendarWidget::showToday ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
359
<p>Shows the month of the today's date.</p>
 
360
<p>See also <a href="qcalendarwidget.html#selectedDate-prop">selectedDate</a>() and <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>
 
361
<h3 class="fn"><a name="weekdayTextFormat"></a><a href="qtextcharformat.html">QTextCharFormat</a> QCalendarWidget::weekdayTextFormat ( <a href="qt.html#DayOfWeek-enum">Qt::DayOfWeek</a> <i>dayOfWeek</i> ) const</h3>
 
362
<p>Returns the text char format for rendering of day in the week <i>dayOfWeek</i>.</p>
 
363
<p>See also <a href="qcalendarwidget.html#setWeekdayTextFormat">setWeekdayTextFormat</a>() and <a href="qcalendarwidget.html#headerTextFormat">headerTextFormat</a>().</p>
 
364
<h3 class="fn"><a name="yearShown"></a>int QCalendarWidget::yearShown () const</h3>
 
365
<p>Returns the year of the currently displayed month.</p>
 
366
<p>See also <a href="qcalendarwidget.html#monthShown">monthShown</a>() and <a href="qcalendarwidget.html#setCurrentPage">setCurrentPage</a>().</p>
 
367
<p /><address><hr /><div align="center">
 
368
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
369
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
 
370
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
371
<td width="30%" align="right"><div align="right">Qt 4.2.0</div></td>
 
372
</tr></table></div></address></body>
 
373
</html>