All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Signals | Public Member Functions
Qtilities::CoreGui::TaskSummaryWidget Class Reference

A widget which provides a summary of all registered global tasks. More...

#include <TaskSummaryWidget.h>

List of all members.

Public Types

enum  NoActiveTaskHandling { HideSummaryWidget = 0, ShowSummaryWidget = 1 }
 Indicates how the TaskSummaryWidget should be shown when no SingleTaskWidget items are present. More...
enum  TaskDisplayOptions { DisplayOnlyBusyTasks = 0, DisplayAllTasks = 1 }
 The possible ways that SingleTaskWidget widgets can be displayed in the summary widget. More...
enum  TaskRemoveOption {
  RemoveWhenDeleted = 0, RemoveWhenCompletedSuccessfully = 1, RemoveWhenCompletedSuccessfullyWithWarnings = 2, RemoveWhenFailed = 4,
  RemoveWhenStopped = 8
}
 The possible ways that SingleTaskWidget widgets can be removed from the summary widget. More...

Signals

void numberOfDisplayedTasksChanged (int number_of_visible_tasks)
 Signal which is emitted when the number of displayed tasks changed.

Public Member Functions

void clear ()
 Function which will clear all current tasks shown by the summary widget.
QList< int > displayedTasksFilter () const
 Gets the current displayed tasks filter.
void displayedTasksFilterAddId (int id)
 Adds a task ID to the displayed tasks filter.
void displayedTasksFilterRemoveId (int id)
 Adds a task ID to the displayed tasks filter.
void findCurrentTasks ()
 Function which will search for all tasks in the global object pool and show them according to how the widget is set up.
NoActiveTaskHandling noActiveTaskHandling () const
 Gets the NoActiveTaskHandling for this summary widget.
void setDisplayedTasksFilter (QList< int > displayed_task_ids)
 Sets a filter in order to only display tasks with IDs that match the filter.
void setNoActiveTaskHandling (NoActiveTaskHandling no_active_task_handling)
 Sets the NoActiveTaskHandling for this summary widget.
void setTaskDisplayOptions (TaskDisplayOptions task_display_options)
 Sets the TaskDisplayOptions for this summary widget.
void setTaskRemoveOptionFlags (TaskRemoveOptionFlags task_remove_option_flags)
 Sets the TaskRemoveOptionFlags for this summary widget.
void setTaskSummaryEnabled (bool enable)
 Sets if this task summary widget is enabled.
TaskDisplayOptions taskDisplayOptions () const
 Gets the TaskDisplayOptions for this summary widget.
TaskRemoveOptionFlags taskRemoveOptionFlags () const
 Gets the TaskRemoveOptionFlags for this summary widget.
bool taskSummaryEnabled () const
 Gets if this task summary widget is enabled.

Detailed Description

A widget which provides a summary of all registered global tasks.

Qtilities::CoreGui::TaskSummaryWidget provides the ability to display all tasks in an application and is customizable in order for your needs. It can for example only show active tasks, or all tasks (active and inactive).

To create a task summary widget is straight forward. For example:

TaskSummaryWidget task_summary_widget;
// Tell the widget that it should not hide itself when now active tasks are visible:
task_summary_widget.setNoActiveTaskHandling(TaskSummaryWidget::ShowSummaryWidget);
// Find all current tasks in the global object pool:
task_summary_widget.findCurrentTasks();
// All tasks registered in the global object pool from here on will automatically be displayed
// in the summary widget.

It is important to note that only tasks registered in the global object pool and set as global tasks (see Qtilities::Core::Interfaces::ITask::TaskGlobal) are shown in the task summary widget. The figure below shows a task summary widget which shows three active tasks. Note that the QTimer task can be stopped.

class_tasksummarywidget_screenshot.jpg
Task Summary Widget

When using Qtilities::CoreGui::QtilitiesMainWindow you can set it up to show a task summary information automatically for you. This makes it very easy to provide an overview of tasks in your application. The Tasking Example demonstrates this.

See the Tasking article for more information on tasking.

This class was added in Qtilities v1.0.


Member Enumeration Documentation

Indicates how the TaskSummaryWidget should be shown when no SingleTaskWidget items are present.

Default is HideSummaryWidget.

Enumerator:
HideSummaryWidget 

Hide the summary widget when no tasks are present.

ShowSummaryWidget 

Show the summary widget when no tasks are present.

The possible ways that SingleTaskWidget widgets can be displayed in the summary widget.

Default is DisplayOnlyBusyTasks.

Enumerator:
DisplayOnlyBusyTasks 

Only busy tasks and tasks which are not busy but can be started (canStart()) are shown will be displayed.

DisplayAllTasks 

All tasks registered in the global object pool will be displayed.

The possible ways that SingleTaskWidget widgets can be removed from the summary widget.

In addition to the available remove options listed, tasks will always be removed when they are deleted.

Note:
This setting has priority over Qtilities::Core::ITask::TaskRemoveAction.
Enumerator:
RemoveWhenDeleted 

Remove tasks when they are deleted. This is always true.

RemoveWhenCompletedSuccessfully 

Remove tasks when they complete without any warnings.

RemoveWhenCompletedSuccessfullyWithWarnings 

Remove tasks when they complete with warnings.

RemoveWhenFailed 

Remove tasks when they failed.

RemoveWhenStopped 

Remove tasks when they are stopped.


Member Function Documentation

QList< int > TaskSummaryWidget::displayedTasksFilter ( ) const

Gets the current displayed tasks filter.

See also:
setDisplayedTasksFilter(), displayedTasksFilterAddId(), displayedTasksFilterRemoveId()

This function was added in Qtilities v1.3.

void TaskSummaryWidget::displayedTasksFilterAddId ( int  id)

Adds a task ID to the displayed tasks filter.

See also:
displayedTasksFilter(), setDisplayedTasksFilter(), displayedTasksFilterRemoveId()

This function was added in Qtilities v1.3.

void TaskSummaryWidget::displayedTasksFilterRemoveId ( int  id)

Adds a task ID to the displayed tasks filter.

See also:
displayedTasksFilter(), setDisplayedTasksFilter(), displayedTasksFilterAddId()

This function was added in Qtilities v1.3.

void Qtilities::CoreGui::TaskSummaryWidget::numberOfDisplayedTasksChanged ( int  number_of_visible_tasks)
signal

Signal which is emitted when the number of displayed tasks changed.

This signal was added in Qtilities v1.3.

void TaskSummaryWidget::setDisplayedTasksFilter ( QList< int >  displayed_task_ids)

Sets a filter in order to only display tasks with IDs that match the filter.

When empty, all tasks are displayed. This is the default.

See also:
displayedTasksFilter(), displayedTasksFilterAddId(), displayedTasksFilterRemoveId()

This function was added in Qtilities v1.3.

void Qtilities::CoreGui::TaskSummaryWidget::setTaskSummaryEnabled ( bool  enable)

Sets if this task summary widget is enabled.

This function was added in Qtilities v1.1.

bool Qtilities::CoreGui::TaskSummaryWidget::taskSummaryEnabled ( ) const

Gets if this task summary widget is enabled.

This function was added in Qtilities v1.1.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé