forked from qt-creator/qt-creator
Core: Add "canceled" signal to class FutureProgress.
This allows clients to get notified that the operation has been canceled by the user without the need to create an additional QFutureWatcher themselves. Change-Id: I928f87eef98ce762d77dcc6962c082fe49f38f6e Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -129,6 +129,11 @@ FutureProgressPrivate::FutureProgressPrivate(FutureProgress *q) :
|
|||||||
progress indicator.
|
progress indicator.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void FutureProgress::canceled()
|
||||||
|
Connect to this signal to get informed when the operation is canceled.
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void FutureProgress::finished()
|
\fn void FutureProgress::finished()
|
||||||
Another way to get informed when the task has finished.
|
Another way to get informed when the task has finished.
|
||||||
@@ -157,6 +162,7 @@ FutureProgress::FutureProgress(QWidget *parent) :
|
|||||||
|
|
||||||
connect(&d->m_watcher, SIGNAL(started()), this, SLOT(setStarted()));
|
connect(&d->m_watcher, SIGNAL(started()), this, SLOT(setStarted()));
|
||||||
connect(&d->m_watcher, SIGNAL(finished()), this, SLOT(setFinished()));
|
connect(&d->m_watcher, SIGNAL(finished()), this, SLOT(setFinished()));
|
||||||
|
connect(&d->m_watcher, SIGNAL(canceled()), this, SIGNAL(canceled()));
|
||||||
connect(&d->m_watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int)));
|
connect(&d->m_watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int)));
|
||||||
connect(&d->m_watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int)));
|
connect(&d->m_watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int)));
|
||||||
connect(&d->m_watcher, SIGNAL(progressTextChanged(QString)),
|
connect(&d->m_watcher, SIGNAL(progressTextChanged(QString)),
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void clicked();
|
void clicked();
|
||||||
void finished();
|
void finished();
|
||||||
|
void canceled();
|
||||||
void removeMe();
|
void removeMe();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user