aboutsummaryrefslogtreecommitdiffstats
path: root/src/winextras/qwintaskbarprogress.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-08-29 12:27:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-04 10:07:20 +0200
commit870eed57e8a06f4e59da2d3889eb6856d0df97f3 (patch)
treed04e149ce06f905a6ffd40563a38250cc4e0d3ce /src/winextras/qwintaskbarprogress.cpp
parent3b533df1e46d509aaa0cda36e300b63272feb230 (diff)
Replace QWinTaskbarProgress::PausedState with a paused-property
Change-Id: I9560db69658113e93e1db9537cf71fb94c08c059 Reviewed-by: Ivan Vizir <define-true-false@yandex.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/winextras/qwintaskbarprogress.cpp')
-rw-r--r--src/winextras/qwintaskbarprogress.cpp44
1 files changed, 40 insertions, 4 deletions
diff --git a/src/winextras/qwintaskbarprogress.cpp b/src/winextras/qwintaskbarprogress.cpp
index 0225bf9..a2136f1 100644
--- a/src/winextras/qwintaskbarprogress.cpp
+++ b/src/winextras/qwintaskbarprogress.cpp
@@ -74,9 +74,6 @@ QT_BEGIN_NAMESPACE
\value NormalState
The progress indicator is green.
- \value PausedState
- The progress indicator turns yellow. Use this state to show that the
- operation has been paused, but it can be continued.
\value ErrorState
The progress indicator turns red.
*/
@@ -90,11 +87,12 @@ public:
int minimum;
int maximum;
bool visible;
+ bool paused;
QWinTaskbarProgress::ProgressState state;
};
QWinTaskbarProgressPrivate::QWinTaskbarProgressPrivate() :
- value(0), minimum(0), maximum(100), visible(false), state(QWinTaskbarProgress::NormalState)
+ value(0), minimum(0), maximum(100), visible(false), paused(false), state(QWinTaskbarProgress::NormalState)
{
}
@@ -258,4 +256,42 @@ void QWinTaskbarProgress::reset()
setState(NormalState);
}
+/*!
+ \property QWinTaskbarProgress::paused
+ \brief the progress indicator is paused.
+
+ The default value is \c false.
+ */
+bool QWinTaskbarProgress::isPaused() const
+{
+ Q_D(const QWinTaskbarProgress);
+ return d->paused;
+}
+
+void QWinTaskbarProgress::setPaused(bool paused)
+{
+ Q_D(QWinTaskbarProgress);
+ if (paused == d->paused)
+ return;
+
+ d->paused = paused;
+ emit pausedChanged(d->paused);
+}
+
+/*!
+ Pause the progress indicator.
+ */
+void QWinTaskbarProgress::pause()
+{
+ setPaused(true);
+}
+
+/*!
+ Resume the progress indicator.
+ */
+void QWinTaskbarProgress::resume()
+{
+ setPaused(false);
+}
+
QT_END_NAMESPACE