Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

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

  • enum Priority { VeryHigh, High, Normal, Low, VeryLow }
  • enum Status { NotStarted, InProgress, Completed, Waiting, Deferred }

Public Functions

Static Public Members

  • QList<QTask> readVCalendar ( QIODevice * device )
  • QList<QTask> readVCalendar ( const QString & filename )   (deprecated)
  • QList<QTask> readVCalendar ( const QByteArray & vcal )   (deprecated)
  • QList<QTask> readVCalendarData ( const char * data, unsigned long len )   (deprecated)
  • QString statusToText ( Status status )
  • bool writeVCalendar ( QIODevice * device, const QList<QTask> & tasks )
  • bool writeVCalendar ( QIODevice * device, const QTask & task )
  • void writeVCalendar ( const QString & filename, const QList<QTask> & tasks )   (deprecated)
  • void writeVCalendar ( const QString & filename, const QTask & task )   (deprecated)

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:

  • a description
  • a priority (see Priority)
  • a due date for the task (optional)
  • the progress of a task
  • notes associated with the task (optional)

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

  • the status of a task (Status)
  • the date a task was started (can be null)
  • the date a task was finished (can be null)
  • a percentage completed

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:

  • startedDate - only set if status is not NotStarted
  • completedDate - only set if status is Completed, and vice versa
  • percentCompleted - 0 if status is NotStarted, 100 if status is Completed, otherwise between 0 and 99 inclusive

These dependencies work in both directions. For example:

  • setting the percentCompleted to 0 will force the status to become NotStarted, and the startedDate and completedDate will be set to null
  • setting the status to NotStarted will force the startedDate and completedDate to become null, and the percentCompleted to be 0
  • setting the percentCompleted to 99 will force the status to become InProgress (unless it is currently Deferred or Waiting), sets the startedDate to be the current date (if it was previously null), and clears the completedDate

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:

  • the task's priority (as a number)
  • the task's due date, if valid
  • the task's description
  • the task's start date, if valid
  • the task's completed date, if valid
  • the task's percentage complete, if the task has been started but not finished.
  • the task's notes.
  • the task's status, as a translated string.

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:

  • If the task is not marked as complete, then the completed date is cleared, and the percentage complete is limited to a maximum of 99%.
  • if the task is marked as complete, the percentage complete will be forced to 100%, and the completed date will be set to the current date if it was not previously set.

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:

  • If percent is greater than 99, then a value of 100 is used, and this function will also set the task's status to Completed.
  • If percent is 0, this function will set the task's status to InProgress (if the task's startedDate is not null) or NotStarted
  • Otherwise, the task's status will be set to InProgress if it was not Deferred or Waiting.

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.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web