Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QTask Class Reference
[QtMessagingModule, QtPimModule, QtTelephonyModule, QtUiModule]

The QTask class holds the data of a task (to-do list) entry. More...

    #include <QTask>

Inherits QPimRecord.

Public Types

Public Functions

Static Public Members

Additional Inherited Members


Detailed Description

The QTask class holds the data of a task (to-do list) entry.

A QTask stores several pieces of information about a task and its progress, including:

The progress of a task is tracked in a number of ways:

These progress fields are interrelated. Setting one field may cause a change in other fields, since QTask will manage the dependencies between them automatically. These dependencies include:

These dependencies work in both directions. For example:

See also Status, Priority, and Pim Library.


Member Type Documentation

enum QTask::Priority

These values describe the current priority() of the Task.

The values are:

ConstantValue
QTask::VeryHigh1
QTask::High2
QTask::Normal3
QTask::Low4
QTask::VeryLow5

enum QTask::Status

These values describe the current status() of the Task.

The values are:

ConstantValueDescription
QTask::NotStarted0the task has not been started yet (0% complete, no started or completed dates)
QTask::InProgress1the task has a startedDate (but no completedDate), and percentCompleted is between 0 and 99 inclusive
QTask::Completed2the task has a startedDate and a completedDate, and percentCompleted is 100
QTask::Waiting3similar to InProgress
QTask::Deferred4similar to InProgress


Member Function Documentation

QTask::QTask ()

Creates a new, empty task.

QTask::QTask ( const QTask & other )

Constructs a QTask as a copy of other.

QTask::~QTask ()   [virtual]

Destroys the task

void QTask::clearDueDate ()

Clears the due date of the task.

See also setDueDate().

QDate QTask::completedDate () const

Returns the date the task was completed. If the task is not completed, the returned date is null.

See also isCompleted() and setCompletedDate().

QString QTask::description () const

Returns the description of the task.

See also setDescription().

QDate QTask::dueDate () const

Returns the due date of the task.

See also setDueDate() and clearDueDate().

bool QTask::hasDueDate () const

Returns true if there is a due date set for the task. Otherwise returns false.

See also dueDate(), setDueDate(), and clearDueDate().

bool QTask::hasStartedDate () const

Returns true if the task has a started date.

See also startedDate() and setStartedDate().

bool QTask::isCompleted () const

Returns true if the task is completed. Otherwise returns false.

See also setCompleted().

bool QTask::match ( const QRegExp & r ) const

Returns true if this task matches regular expression r. Otherwise returns false.

This is intended to allow the user to enter text to find matching tasks.

The expression will be matched against the following fields:

QString QTask::notes () const   [virtual]

Returns the notes for the task.

Reimplemented from QPimRecord.

See also setNotes().

uint QTask::percentCompleted () const

Returns progress of the task as a percent completed. For tasks that have not been started, this will return 0, and for completed tasks, this function will always return 100.

See also setPercentCompleted() and status().

Priority QTask::priority () const

Returns the priority of the task.

See also setPriority().

QList<QTask> QTask::readVCalendar ( QIODevice * device )   [static]

Reads a list of vCalendars from the given device and returns the equivalent set of tasks.

See also writeVCalendar().

QList<QTask> QTask::readVCalendar ( const QString & filename )   [static]

This function is deprecated.

This is an overloaded member function, provided for convenience.

Reads the file specified by filename as a list of vCalendar objects and returns a list of QTasks that correspond to the data. Note that some vCalendar properties may not be supported by QTask.

See also writeVCalendar().

QList<QTask> QTask::readVCalendar ( const QByteArray & vcal )   [static]

This function is deprecated.

This is an overloaded member function, provided for convenience.

Reads the given vCalendar data in vcal and returns the list of corresponding QTasks.

See also writeVCalendar().

QList<QTask> QTask::readVCalendarData ( const char * data, unsigned long len )   [static]

This function is deprecated.

Reads the data of len bytes as a list of vCalendar objects and returns the list of corresponding QTasks.

See also writeVCalendar() and readVCalendar().

void QTask::setCompleted ( bool b )

If b is true, marks the task as completed, and otherwise marks the task as incomplete.

Several fields are dependent on the new completion state:

See also isCompleted() and completedDate().

void QTask::setCompletedDate ( const QDate & date )

Sets the tasks completed date to date. If date is null, and the task was previously completed, then the task will be marked as having status InProgress, and the percentage completed will be forced to 99%. In addition, if the task's started date was not previously set, it will be set to the supplied date.

See also isCompleted() and completedDate().

void QTask::setDescription ( const QString & description )

Sets the description of the task to description.

See also description().

void QTask::setDueDate ( const QDate & date )

Sets the due date of the task to date.

See also clearDueDate() and dueDate().

void QTask::setNotes ( const QString & notes )   [virtual]

Sets the notes of the task to notes.

Reimplemented from QPimRecord.

See also notes().

void QTask::setPercentCompleted ( uint percent )

Sets the tasks percent completed field to percent.

The task's status field depends on the new percentage complete value in the following ways:

See also percentCompleted() and status().

void QTask::setPriority ( Priority priority )

Sets the priority of the task to priority.

See also priority().

void QTask::setPriority ( int priority )

This is an overloaded member function, provided for convenience.

Sets the priority of the task to priority. This is a convenience wrapper function.

See also priority().

void QTask::setStartedDate ( const QDate & date )

Sets the tasks to have started on date. If date is null, then the task will be marked as having status NotStarted, any completed date will be cleared, and the percentage completed will be 0.

See also hasStartedDate() and startedDate().

void QTask::setStatus ( Status status )

Sets the Status of the task to status.

If the new status is NotStarted, the task's started date will be cleared. Otherwise, if the task was not previously started, the current date will be used as the task's starting date.

Similarly, if the new status Completed and the task was not previously completed, then the current date will be used as the task's completed date. Otherwise, if the new status is not Completed, the completed date will be cleared.

If a task's status is Completed, the percent completed will be set to 100%. Otherwise, the percent completed is limited to a maximum of 99%.

See also status().

void QTask::setStatus ( int status )

This is an overloaded member function, provided for convenience.

Sets the Status of the task to status. This is a convenience wrapper function.

See also status().

QDate QTask::startedDate () const

Returns the date the task was started. If the task has not yet been started, the returned date is null.

See also hasStartedDate() and setStartedDate().

Status QTask::status () const

Returns the Status of the task.

See also setStatus().

QString QTask::statusToText ( Status status )   [static]

Returns the translated text for the the task status status.

QString QTask::toRichText () const

Returns a rich text formatted QString of the QTask.

bool QTask::writeVCalendar ( QIODevice * device, const QList<QTask> & tasks )   [static]

Writes the given list of tasks to the given device as vCalendars.

Returns true on success.

See also readVCalendar().

bool QTask::writeVCalendar ( QIODevice * device, const QTask & task )   [static]

This is an overloaded member function, provided for convenience.

Writes the given task to the given device as vCalendars.

Returns true on success.

See also readVCalendar().

void QTask::writeVCalendar ( const QString & filename, const QList<QTask> & tasks )   [static]

This function is deprecated.

This is an overloaded member function, provided for convenience.

Write the list of tasks as vCalendar objects to the file specified by filename.

See also readVCalendar().

void QTask::writeVCalendar ( const QString & filename, const QTask & task )   [static]

This function is deprecated.

This is an overloaded member function, provided for convenience.

Write the task as a vCalendar to the file specified by filename.

See also readVCalendar().

void QTask::writeVCalendar ( const QString & filename ) const

This function is deprecated.

This is an overloaded member function, provided for convenience.

Writes this task as a vCalendar object to the file specified by filename.

See also readVCalendar().

void QTask::writeVCalendar ( QFile & file ) const

This function is deprecated.

This is an overloaded member function, provided for convenience.

Writes this task as a vCalendar object to the given file, which must be already open for writing.

See also readVCalendar().

void QTask::writeVCalendar ( QDataStream * stream ) const

This function is deprecated.

This is an overloaded member function, provided for convenience.

Writes this task as a vCalendar object to the given stream, which must be writable.

See also readVCalendar().

bool QTask::operator!= ( const QTask & other ) const

Returns false if other is identical to this task. Otherwise return true.

QTask & QTask::operator= ( const QTask & other )

Sets the task to be a copy of other.

bool QTask::operator== ( const QTask & other ) const

Returns true if other is identical to this task. Otherwise return false.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3