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

A widget provides an overview of a single task. More...

#include <SingleTaskWidget.h>

List of all members.

Public Slots

void setPauseButtonEnabled (bool enabled)
 Sets if the pause task button is enabled.
void setPauseButtonVisible (bool is_visible)
 Sets if the pause task button must be visible.
void setStartButtonEnabled (bool enabled)
 Sets if the start task button is enabled.
void setStartButtonVisible (bool is_visible)
 Sets if the start task button must be visible.
void setStopButtonEnabled (bool enabled)
 Sets if the stop task button is enabled.
void setStopButtonVisible (bool is_visible)
 Sets if the stop task button must be visible.

Signals

void hiddenByStopButton ()
 Signal which is emitted when this single task widget is hidden or destroyed due to the user closing it using the stop button.

Public Member Functions

QToolButton * pauseButton () const
 Returns the pause button for customization purposes.
bool pauseButtonVisible () const
 Gets if the pause task button must be visible.
QProgressBar * progressBar ()
 Access to the progress bar shown.
void setShowLogButtonVisible (bool is_visible)
 Sets if the start task button must be visible.
QToolButton * showLogButton () const
 Returns the show log button for customization purposes.
bool showLogButtonVisible () const
 Gets if the start task button must be visible.
QToolButton * startButton () const
 Returns the start button for customization purposes.
bool startButtonVisible () const
 Gets if the start task button must be visible.
QToolButton * stopButton () const
 Returns the stop button for customization purposes.
bool stopButtonVisible () const
 Gets if the stop task button must be visible.
ITasktask () const
 Returns the task shown by this widget.

Detailed Description

A widget provides an overview of a single task.

Qtilities::CoreGui::SingleTaskWidget is the most basic tasking widget and it is used to represent a single task and can easily be constructed as follows:

Task* task = new Task("Timer Task");
OBJECT_MANAGER->registerObject(task);
SingleTaskWidget* task_widget = TaskManagerGui::instance()->singleTaskWidget(task->taskID());

The figure below shows a single task widget for an example task. Note that clicking on the green icon on the left of the progress bar allows you to view the log for the specific task. Also, the task widget will only show controls for the task according to the way the task was set up. In the QTimer example above we call setCanStop(true), thus the single task widget will provide the ability to stop the task. If it was set to false, the red stop button would have been disabled.

class_singletaskwidget_screenshot.jpg
Single Task Widget

The single task widget can be added anywhere in your application where you would like to display information about a task.

See the Tasking article for more information on tasking.

This class was added in Qtilities v1.0.


Member Function Documentation

void Qtilities::CoreGui::SingleTaskWidget::hiddenByStopButton ( )
signal

Signal which is emitted when this single task widget is hidden or destroyed due to the user closing it using the stop button.

This function was added in Qtilities v1.3.

QToolButton * Qtilities::CoreGui::SingleTaskWidget::pauseButton ( ) const

Returns the pause button for customization purposes.

This function was added in Qtilities v1.3.

void Qtilities::CoreGui::SingleTaskWidget::setPauseButtonEnabled ( bool  enabled)
slot

Sets if the pause task button is enabled.

By default this will depend on the canPause() result on the task being shown.

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::SingleTaskWidget::setPauseButtonVisible ( bool  is_visible)
slot

Sets if the pause task button must be visible.

By default this will depend on the canPause() result on the task being shown.

void Qtilities::CoreGui::SingleTaskWidget::setShowLogButtonVisible ( bool  is_visible)

Sets if the start task button must be visible.

By default this will depend on the canStart() result on the task being shown.

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::SingleTaskWidget::setStartButtonEnabled ( bool  enabled)
slot

Sets if the start task button is enabled.

By default this will depend on the canPause() result on the task being shown.

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::SingleTaskWidget::setStartButtonVisible ( bool  is_visible)
slot

Sets if the start task button must be visible.

By default this will depend on the canStart() result on the task being shown.

void Qtilities::CoreGui::SingleTaskWidget::setStopButtonEnabled ( bool  enabled)
slot

Sets if the stop task button is enabled.

By default this will depend on the canPause() result on the task being shown.

This function was added in Qtilities v1.1.

void Qtilities::CoreGui::SingleTaskWidget::setStopButtonVisible ( bool  is_visible)
slot

Sets if the stop task button must be visible.

By default this will depend on the canStop() result on the task being shown.

QToolButton * Qtilities::CoreGui::SingleTaskWidget::showLogButton ( ) const

Returns the show log button for customization purposes.

This function was added in Qtilities v1.3.

bool Qtilities::CoreGui::SingleTaskWidget::showLogButtonVisible ( ) const

Gets if the start task button must be visible.

This function was added in Qtilities v1.1.

QToolButton * Qtilities::CoreGui::SingleTaskWidget::startButton ( ) const

Returns the start button for customization purposes.

This function was added in Qtilities v1.3.

QToolButton * Qtilities::CoreGui::SingleTaskWidget::stopButton ( ) const

Returns the stop button for customization purposes.

This function was added in Qtilities v1.3.



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