KJobWidgets 5.109.0
Signals | Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KAbstractWidgetJobTrackerabstract

The base class for widget based job trackers. More...

#include <KAbstractWidgetJobTracker>

Signals

void resume (KJob *job)
 Emitted when the user resumed the operation.
 
void stopped (KJob *job)
 Emitted when the user aborted the operation.
 
void suspend (KJob *job)
 Emitted when the user suspended the operation.
 

Public Slots

void registerJob (KJob *job) override
 Register a new job in this tracker.
 
void unregisterJob (KJob *job) override
 Unregister a job from this tracker.
 

Public Member Functions

 KAbstractWidgetJobTracker (QWidget *parent=nullptr)
 Creates a new KAbstractWidgetJobTracker.
 
 ~KAbstractWidgetJobTracker () override
 Destroys a KAbstractWidgetJobTracker.
 
bool autoDelete (KJob *job) const
 Checks whether the dialog should be deleted or cleaned.
 
void setAutoDelete (KJob *job, bool autoDelete)
 This controls whether the dialog should be deleted or only cleaned when the KJob is finished (or canceled).
 
void setStopOnClose (KJob *job, bool stopOnClose)
 This controls whether the job should be canceled if the dialog is closed.
 
bool stopOnClose (KJob *job) const
 Checks whether the job will be killed when the dialog is closed.
 
virtual QWidget * widget (KJob *job)=0
 The widget associated to this tracker.
 

Protected Slots

void finished (KJob *job) override
 Called when a job is finished, in any case.
 
virtual void slotClean (KJob *job)
 This method is called when the widget should be cleaned (after job is finished).
 
virtual void slotResume (KJob *job)
 This method should be called for pause/resume Connect this to the progress widgets buttons etc.
 
virtual void slotStop (KJob *job)
 This method should be called for correct cancellation of IO operation Connect this to the progress widgets buttons etc.
 
virtual void slotSuspend (KJob *job)
 This method should be called for pause/resume Connect this to the progress widgets buttons etc.
 

Protected Member Functions

 __attribute__ ((visibility("hidden"))) explicit KAbstractWidgetJobTracker(KAbstractWidgetJobTrackerPrivate &dd
 

Protected Attributes

std::unique_ptr< KAbstractWidgetJobTrackerPrivate > const d
 
QWidget * parent = nullptr)
 

Detailed Description

The base class for widget based job trackers.

Constructor & Destructor Documentation

◆ KAbstractWidgetJobTracker()

KAbstractWidgetJobTracker::KAbstractWidgetJobTracker ( QWidget *  parent = nullptr)
explicit

Creates a new KAbstractWidgetJobTracker.

Parameters
parentthe parent of this object and of the widget displaying the job progresses

◆ ~KAbstractWidgetJobTracker()

KAbstractWidgetJobTracker::~KAbstractWidgetJobTracker ( )
override

Member Function Documentation

◆ autoDelete()

bool KAbstractWidgetJobTracker::autoDelete ( KJob *  job) const

Checks whether the dialog should be deleted or cleaned.

Parameters
jobthe job's widget that will be auto-deleted
Returns
false if the dialog only calls slotClean, true if it will be deleted
See also
setAutoDelete()

◆ finished

void KAbstractWidgetJobTracker::finished ( KJob *  job)
overrideprotectedslot

Called when a job is finished, in any case.

It is used to notify that the job is terminated and that progress UI (if any) can be hidden.

Parameters
jobthe job that emitted this signal

◆ registerJob

void KAbstractWidgetJobTracker::registerJob ( KJob *  job)
overrideslot

Register a new job in this tracker.

Note that job trackers inheriting from this class can have only one job registered at a time.

Parameters
jobthe job to register

◆ resume

void KAbstractWidgetJobTracker::resume ( KJob *  job)
signal

Emitted when the user resumed the operation.

Parameters
jobThe job that has been resumed

◆ setAutoDelete()

void KAbstractWidgetJobTracker::setAutoDelete ( KJob *  job,
bool  autoDelete 
)

This controls whether the dialog should be deleted or only cleaned when the KJob is finished (or canceled).

If your dialog is an embedded widget and not a separate window, you should setAutoDelete(false) in the constructor of your custom dialog.

Parameters
jobthe job's widget that is going to be auto-deleted
autoDeleteIf false the dialog will only call method slotClean. If true the dialog will be deleted.
See also
autoDelete()

◆ setStopOnClose()

void KAbstractWidgetJobTracker::setStopOnClose ( KJob *  job,
bool  stopOnClose 
)

This controls whether the job should be canceled if the dialog is closed.

Parameters
jobthe job's widget that will be stopped when closing
stopOnCloseIf true the job will be stopped if the dialog is closed, otherwise the job will continue even on close.
See also
stopOnClose()

◆ slotClean

virtual void KAbstractWidgetJobTracker::slotClean ( KJob *  job)
protectedvirtualslot

This method is called when the widget should be cleaned (after job is finished).

redefine this for custom behavior.

Parameters
jobThe job that is being cleaned

◆ slotResume

virtual void KAbstractWidgetJobTracker::slotResume ( KJob *  job)
protectedvirtualslot

This method should be called for pause/resume Connect this to the progress widgets buttons etc.

Parameters
jobThe job that is being resumed

◆ slotStop

virtual void KAbstractWidgetJobTracker::slotStop ( KJob *  job)
protectedvirtualslot

This method should be called for correct cancellation of IO operation Connect this to the progress widgets buttons etc.

Parameters
jobThe job that is being stopped

◆ slotSuspend

virtual void KAbstractWidgetJobTracker::slotSuspend ( KJob *  job)
protectedvirtualslot

This method should be called for pause/resume Connect this to the progress widgets buttons etc.

Parameters
jobThe job that is being suspended

◆ stopOnClose()

bool KAbstractWidgetJobTracker::stopOnClose ( KJob *  job) const

Checks whether the job will be killed when the dialog is closed.

Parameters
jobthe job's widget that will be stopped when closing
Returns
true if the job is killed on close event, false otherwise.
See also
setStopOnClose()

◆ stopped

void KAbstractWidgetJobTracker::stopped ( KJob *  job)
signal

Emitted when the user aborted the operation.

Parameters
jobThe job that has been stopped

◆ suspend

void KAbstractWidgetJobTracker::suspend ( KJob *  job)
signal

Emitted when the user suspended the operation.

Parameters
jobThe job that has been suspended

◆ unregisterJob

void KAbstractWidgetJobTracker::unregisterJob ( KJob *  job)
overrideslot

Unregister a job from this tracker.

Parameters
jobthe job to unregister

◆ widget()

virtual QWidget * KAbstractWidgetJobTracker::widget ( KJob *  job)
pure virtual

The widget associated to this tracker.

Parameters
jobthe job that is assigned the widget we want to return
Returns
the widget displaying the job progresses

Implemented in KStatusBarJobTracker, and KWidgetJobTracker.