42 #ifndef QFUTUREWATCHER_H 43 #define QFUTUREWATCHER_H 45 #include <QtCore/qfuture.h> 47 #include <QtCore/qobject.h> 70 int progressValue()
const;
71 int progressMinimum()
const;
72 int progressMaximum()
const;
75 bool isStarted()
const;
76 bool isFinished()
const;
77 bool isRunning()
const;
78 bool isCanceled()
const;
79 bool isPaused()
const;
81 void waitForFinished();
83 void setPendingResultsLimit(
int limit);
93 void resultReadyAt(
int resultIndex);
94 void resultsReadyAt(
int beginIndex,
int endIndex);
95 void progressRangeChanged(
int minimum,
int maximum);
96 void progressValueChanged(
int progressValue);
97 void progressTextChanged(
const QString &progressText);
101 void setPaused(
bool paused);
111 void connectOutputInterface();
112 void disconnectOutputInterface(
bool pendingAssignment =
false);
120 #ifndef QT_NO_QFUTURE 122 template <
typename T>
130 { disconnectOutputInterface(); }
136 T
result()
const {
return m_future.result(); }
140 int progressValue()
const;
141 int progressMinimum()
const;
142 int progressMaximum()
const;
145 bool isStarted()
const;
146 bool isFinished()
const;
147 bool isRunning()
const;
148 bool isCanceled()
const;
149 bool isPaused()
const;
151 void waitForFinished();
153 void setPendingResultsLimit(
int limit);
161 void resultReadyAt(
int resultIndex);
162 void resultsReadyAt(
int beginIndex,
int endIndex);
163 void progressRangeChanged(
int minimum,
int maximum);
164 void progressValueChanged(
int progressValue);
165 void progressTextChanged(
const QString &progressText);
169 void setPaused(
bool paused);
181 template <
typename T>
184 if (_future == m_future)
187 disconnectOutputInterface(
true);
189 connectOutputInterface();
200 { disconnectOutputInterface(); }
214 if (_future == m_future)
217 disconnectOutputInterface(
true);
219 connectOutputInterface();
222 #endif // QT_NO_QFUTURE 227 #endif // QFUTUREWATCHER_H
#define QT_END_NAMESPACE
This macro expands to.
QFuture< T > future() const
Returns the watched future.
~QFutureWatcher()
Destroys the QFutureWatcher.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
virtual void connectNotify(const char *signal)
This virtual function is called when something has been connected to signal in this object...
T resultAt(int index) const
Returns the result at index in the future().
#define QT_BEGIN_NAMESPACE
This macro expands to.
QFutureInterfaceBase & futureInterface()
#define Q_INLINE_TEMPLATE
The QFuture class represents the result of an asynchronous computation.
const QFutureInterfaceBase & futureInterface() const
virtual void disconnectNotify(const char *signal)
This virtual function is called when something has been disconnected from signal in this object...
T result() const
Returns the first result in the future().
#define Q_DECLARE_PRIVATE(Class)
void setFuture(const QFuture< T > &future)
Starts watching the given future.
The QEvent class is the base class of all event classes.
QFutureWatcher(QObject *_parent=0)
Constructs a new QFutureWatcher with the given parent.
The QFutureWatcher class allows monitoring a QFuture using signals and slots.