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
|
'\" t
.TH TQDateEdit 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQDateEdit \- Date editor
.SH SYNOPSIS
\fC#include <tqdatetimeedit.h>\fR
.PP
Inherits TQDateTimeEditBase.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQDateEdit\fR ( TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fBTQDateEdit\fR ( const TQDate & date, TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fB~TQDateEdit\fR ()"
.br
.ti -1c
.BI "enum \fBOrder\fR { DMY, MDY, YMD, YDM }"
.br
.ti -1c
.BI "TQDate \fBdate\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetOrder\fR ( Order order )"
.br
.ti -1c
.BI "Order \fBorder\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetAutoAdvance\fR ( bool advance )"
.br
.ti -1c
.BI "bool \fBautoAdvance\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetMinValue\fR ( const TQDate & d )"
.br
.ti -1c
.BI "TQDate \fBminValue\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetMaxValue\fR ( const TQDate & d )"
.br
.ti -1c
.BI "TQDate \fBmaxValue\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetRange\fR ( const TQDate & min, const TQDate & max )"
.br
.ti -1c
.BI "TQString \fBseparator\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetSeparator\fR ( const TQString & s )"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "virtual void \fBsetDate\fR ( const TQDate & date )"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBvalueChanged\fR ( const TQDate & date )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "bool \fBautoAdvance\fR - whether the editor automatically advances to the next section"
.br
.ti -1c
.BI "TQDate \fBdate\fR - the editor's date value"
.br
.ti -1c
.BI "TQDate \fBmaxValue\fR - the editor's maximum value"
.br
.ti -1c
.BI "TQDate \fBminValue\fR - the editor's minimum value"
.br
.ti -1c
.BI "Order \fBorder\fR - the order in which the " "year" ", month and day appear"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual TQString \fBsectionFormattedText\fR ( int sec )"
.br
.ti -1c
.BI "virtual void \fBsetYear\fR ( int year )"
.br
.ti -1c
.BI "virtual void \fBsetMonth\fR ( int month )"
.br
.ti -1c
.BI "virtual void \fBsetDay\fR ( int day )"
.br
.ti -1c
.BI "virtual void \fBfix\fR ()"
.br
.in -1c
.SS "Protected Slots"
.in +1c
.ti -1c
.BI "void \fBupdateButtons\fR ()"
.br
.in -1c
.SH DESCRIPTION
The TQDateEdit class provides a date editor.
.PP
TQDateEdit allows the user to edit dates by using the keyboard or the arrow keys to increase/decrease date values. The arrow keys can be used to move from section to section within the TQDateEdit box. Dates appear in accordance with the local date/time settings or in year, month, day order if the system doesn't provide this information. It is recommended that the TQDateEdit be initialised with a date, e.g.
.PP
.nf
.br
TQDateEdit *dateEdit = new TQDateEdit( TQDate::currentDate(), this );
.br
dateEdit->setRange( TQDate::currentDate().addDays( -365 ),
.br
TQDate::currentDate().addDays( 365 ) );
.br
dateEdit->setOrder( TQDateEdit::MDY );
.br
dateEdit->setAutoAdvance( TRUE );
.br
.fi
.PP
Here we've created a new TQDateEdit object initialised with today's date and restricted the valid date range to today plus or minus 365 days. We've set the order to month, day, year. If the auto advance property is TRUE (as we've set it here) when the user completes a section of the date, e.g. enters two digits for the month, they are automatically taken to the next section.
.PP
The maximum and minimum values for a date value in the date editor default to the maximum and minimum values for a TQDate. You can change this by calling setMinValue(), setMaxValue() or setRange().
.PP
Terminology: A TQDateEdit widget comprises three 'sections', one each for the year, month and day. You can change the separator character using TQDateTimeEditor::setSeparator(), by default the separator will be taken from the systems settings. If that is not possible, it defaults to "-".
.PP
<center>
.ce 1
.B "[Image Omitted]"
.PP
</center>
.PP
See also TQDate, TQTimeEdit, TQDateTimeEdit, Advanced Widgets, and Time and Date.
.SS "Member Type Documentation"
.SH "TQDateEdit::Order"
This enum defines the order in which the sections that comprise a date appear.
.TP
\fCTQDateEdit::MDY\fR - month-day-year
.TP
\fCTQDateEdit::DMY\fR - day-month-year
.TP
\fCTQDateEdit::YMD\fR - year-month-day (the default)
.TP
\fCTQDateEdit::YDM\fR - year-day-month (included for completeness; but should not be used)
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQDateEdit::TQDateEdit ( TQWidget * parent = 0, const char * name = 0 )"
Constructs an empty date editor which is a child of \fIparent\fR and called name \fIname\fR.
.SH "TQDateEdit::TQDateEdit ( const TQDate & date, TQWidget * parent = 0, const char * name = 0 )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Constructs a date editor with the initial value \fIdate\fR, parent \fIparent\fR and called \fIname\fR.
.PP
The date editor is initialized with \fIdate\fR.
.SH "TQDateEdit::~TQDateEdit ()"
Destroys the object and frees any allocated resources.
.SH "bool TQDateEdit::autoAdvance () const"
Returns TRUE if the editor automatically advances to the next section; otherwise returns FALSE. See the "autoAdvance" property for details.
.SH "TQDate TQDateEdit::date () const"
Returns the editor's date value. See the "date" property for details.
.SH "void TQDateEdit::fix ()\fC [virtual protected]\fR"
Attempts to fix any invalid date entries.
.PP
The rules applied are as follows:
.TP
If the year has four digits it is left unchanged.
.TP
If the year has two digits, the year will be changed to four digits in the range current year - 70 to current year + 29.
.TP
If the year has three digits in the range 100..999, the current millennium, i.e. 2000, will be added giving a year in the range 2100..2999.
.TP
If the day or month is 0 then it will be set to 1 or the minimum valid day\\month in the range.
.SH "TQDate TQDateEdit::maxValue () const"
Returns the editor's maximum value. See the "maxValue" property for details.
.SH "TQDate TQDateEdit::minValue () const"
Returns the editor's minimum value. See the "minValue" property for details.
.SH "Order TQDateEdit::order () const"
Returns the order in which the year, month and day appear. See the "order" property for details.
.SH "TQString TQDateEdit::sectionFormattedText ( int sec )\fC [virtual protected]\fR"
Returns the formatted number for section \fIsec\fR. This will correspond to either the year, month or day section, depending on the current display order.
.PP
See also order.
.SH "TQString TQDateEdit::separator () const"
Returns the editor's separator.
.SH "void TQDateEdit::setAutoAdvance ( bool advance )\fC [virtual]\fR"
Sets whether the editor automatically advances to the next section to \fIadvance\fR. See the "autoAdvance" property for details.
.SH "void TQDateEdit::setDate ( const TQDate & date )\fC [virtual slot]\fR"
Sets the editor's date value to \fIdate\fR. See the "date" property for details.
.SH "void TQDateEdit::setDay ( int day )\fC [virtual protected]\fR"
Sets the day to \fIday\fR, which must be a valid day. The function will ensure that the \fIday\fR set is valid for the month and year.
.SH "void TQDateEdit::setMaxValue ( const TQDate & d )\fC [virtual]\fR"
Sets the editor's maximum value to \fId\fR. See the "maxValue" property for details.
.SH "void TQDateEdit::setMinValue ( const TQDate & d )\fC [virtual]\fR"
Sets the editor's minimum value to \fId\fR. See the "minValue" property for details.
.SH "void TQDateEdit::setMonth ( int month )\fC [virtual protected]\fR"
Sets the month to \fImonth\fR, which must be a valid month, i.e. between 1 and 12.
.SH "void TQDateEdit::setOrder ( Order order )\fC [virtual]\fR"
Sets the order in which the year, month and day appear to \fIorder\fR. See the "order" property for details.
.SH "void TQDateEdit::setRange ( const TQDate & min, const TQDate & max )\fC [virtual]\fR"
Sets the valid input range for the editor to be from \fImin\fR to \fImax\fR inclusive. If \fImin\fR is invalid no minimum date will be set. Similarly, if \fImax\fR is invalid no maximum date will be set.
.SH "void TQDateEdit::setSeparator ( const TQString & s )\fC [virtual]\fR"
Sets the separator to \fIs\fR. Note that currently only the first character of \fIs\fR is used.
.SH "void TQDateEdit::setYear ( int year )\fC [virtual protected]\fR"
Sets the year to \fIyear\fR, which must be a valid year. The range currently supported is from 1752 to 8000.
.PP
See also TQDate.
.SH "void TQDateEdit::updateButtons ()\fC [protected slot]\fR"
Enables/disables the push buttons according to the min/max date for this widget.
.SH "void TQDateEdit::valueChanged ( const TQDate & date )\fC [signal]\fR"
This signal is emitted whenever the editor's value changes. The \fIdate\fR parameter is the new value.
.SS "Property Documentation"
.SH "bool autoAdvance"
This property holds whether the editor automatically advances to the next section.
.PP
If autoAdvance is TRUE, the editor will automatically advance focus to the next date section if a user has completed a section. The default is FALSE.
.PP
Set this property's value with setAutoAdvance() and get this property's value with autoAdvance().
.SH "TQDate date"
This property holds the editor's date value.
.PP
If the date property is not valid, the editor displays all zeroes and TQDateEdit::date() will return an invalid date. It is strongly recommended that the editor is given a default date value (e.g. currentDate()). That way, attempts to set the date property to an invalid date will fail.
.PP
When changing the date property, if the date is less than minValue(), or is greater than maxValue(), nothing happens.
.PP
Set this property's value with setDate() and get this property's value with date().
.SH "TQDate maxValue"
This property holds the editor's maximum value.
.PP
Setting the maximum date value for the editor is equivalent to calling TQDateEdit::setRange( minValue(), \fId\fR ), where \fId\fR is the maximum date. The default maximum date is 8000-12-31.
.PP
See also minValue and setRange().
.PP
Set this property's value with setMaxValue() and get this property's value with maxValue().
.SH "TQDate minValue"
This property holds the editor's minimum value.
.PP
Setting the minimum date value is equivalent to calling TQDateEdit::setRange( \fId\fR, maxValue() ), where \fId\fR is the minimum date. The default minimum date is 1752-09-14.
.PP
See also maxValue and setRange().
.PP
Set this property's value with setMinValue() and get this property's value with minValue().
.SH "Order order"
This property holds the order in which the year, month and day appear.
.PP
The default order is locale dependent.
.PP
See also Order.
.PP
Set this property's value with setOrder() and get this property's value with order().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqdateedit.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqdateedit.3qt) and the Qt
version (3.3.8).
|