Logo Search packages:      
Sourcecode: qtodo version File versions  Download package

QTodoDateTimeEdit Class Reference

List of all members.

Detailed Description

The QTodoDateTimeEdit class combines a QTodoDateEdit and QTodoTimeEdit widget into a single widget for editing datetimes.

QTodoDateTimeEdit consists of a QTodoDateEdit and QTodoTimeEdit widget placed side by side and offers the functionality of both. The user can edit the date and time by using the keyboard or the arrow keys to increase/decrease date or time values. The Tab key can be used to move from section to section within the QTodoDateTimeEdit widget, and the user can be moved automatically when they complete a section using setAutoAdvance(). The datetime can be set with setDateTime().

The date format is read from the system's locale settings. It is set to year, month, day order if that is not possible. See QTodoDateEdit::setOrder() to change this. Times appear in the order hours, minutes, seconds using the 24 hour clock.

It is recommended that the QTodoDateTimeEdit is initialised with a datetime, e.g.

    QTodoDateTimeEdit *dateTimeEdit = new QTodoDateTimeEdit( QDateTime::currentDateTime(), this );
    dateTimeEdit->dateEdit()->setRange( QDateTime::currentDate(),
                              QDateTime::currentDate().addDays( 7 ) );
Here we've created a new QTodoDateTimeEdit set to the current date and time, and set the date to have a minimum date of now and a maximum date of a week from now.

Terminology: A QTodoDateEdit widget consists of three 'sections', one each for the year, month and day. Similarly a QTodoTimeEdit consists of three sections, one each for the hour, minute and second. The character that separates each date section is specified with setDateSeparator(); similarly setTimeSeparator() is used for the time sections.

datetimewidgets.png Date Time Widgets

See also:
QTodoDateEdit QTodoTimeEdit

Definition at line 317 of file qtodo_datetimeedit.h.

Public Slots

virtual void setDateTime (const QDateTime &dt)


void valueChanged (const QDateTime &datetime)

Public Member Functions

bool autoAdvance () const
QTodoDateEditdateEdit ()
QDateTime dateTime () const
QSize minimumSizeHint () const
 QTodoDateTimeEdit (const QDateTime &datetime, QWidget *parent=0, const char *name=0)
 QTodoDateTimeEdit (QWidget *parent=0, const char *name=0)
virtual void setAutoAdvance (bool advance)
QSize sizeHint () const
QTodoTimeEdittimeEdit ()
 ~QTodoDateTimeEdit ()

Protected Slots

void newValue (const QTime &t)
void newValue (const QDate &d)

Protected Member Functions

void init ()
void resizeEvent (QResizeEvent *)


QDateTime dateTime
 the editor's datetime value

Private Member Functions

QTodoDateTimeEditoperator= (const QTodoDateTimeEdit &)
 QTodoDateTimeEdit (const QTodoDateTimeEdit &)

Private Attributes

QTodoDateTimeEditPrivate * d

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index