46 #include <QtCore/qcoreevent.h> 47 #include <QtCore/qcoreapplication.h> 48 #include <QtCore/qthread.h> 383 d->pendingCallOutEvents.append(callOutEvent->
clone());
388 && !
d->pendingCallOutEvents.isEmpty()) {
390 d->sendCallOutEvent(callOutEvent);
393 for (
int i = 0; i <
d->pendingCallOutEvents.count(); ++i)
394 d->sendCallOutEvent(
d->pendingCallOutEvents.at(i));
396 d->pendingCallOutEvents.clear();
398 d->sendCallOutEvent(callOutEvent);
408 d->maximumPendingResultsReady = limit;
415 d->resultAtConnected.ref();
421 qWarning(
"QFutureWatcher::connect: connecting after calling setFuture() is likely to produce race");
431 d->resultAtConnected.deref();
438 : maximumPendingResultsReady(
QThread::idealThreadCount() * 2),
447 futureInterface().d->connectOutputInterface(d_func());
455 if (pendingAssignment) {
457 d->pendingResultsReady = 0;
459 d->pendingCallOutEvents.clear();
463 futureInterface().d->disconnectOutputInterface(d_func());
472 q->futureInterface().d->internal_setThrottled(
true);
500 if (q->futureInterface().isCanceled())
505 if (q->futureInterface().isCanceled())
510 if (q->futureInterface().isCanceled())
514 q->futureInterface().setThrottled(
false);
516 const int beginIndex =
event->index1;
517 const int endIndex =
event->index2;
519 emit q->resultsReadyAt(beginIndex, endIndex);
524 for (
int i = beginIndex; i < endIndex; ++i)
525 emit q->resultReadyAt(i);
529 if (q->futureInterface().isCanceled())
534 q->progressTextChanged(event->
text);
700 #endif // QT_NO_QFUTURE
#define QT_END_NAMESPACE
This macro expands to.
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
int maximumPendingResultsReady
int progressMaximum() const
bool queryState(State state) const
void disconnectOutputInterface(bool pendingAssignment=false)
QString progressText() const
int progressValue() const
void connectNotify(const char *signal)
This virtual function is called when something has been connected to signal in this object...
QFutureCallOutEvent * clone() const
The QString class provides a Unicode character string.
QFutureWatcherBase(QObject *parent=0)
void callOutInterfaceDisconnected()
QAtomicInt resultAtConnected
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...
int progressValue() const
bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
#define QT_BEGIN_NAMESPACE
This macro expands to.
QFutureWatcherBasePrivate()
Q_CORE_EXPORT void qWarning(const char *,...)
void setPaused(bool paused)
void resultReadyAt(int resultIndex)
int fetchAndAddRelaxed(int valueToAdd)
Atomic fetch-and-add.
void setPendingResultsLimit(int limit)
bool isNull() const
Returns true if this string is null; otherwise returns false.
void setPaused(bool paused)
QString progressText() const
int progressMinimum() const
QAtomicInt pendingResultsReady
int progressMaximum() const
virtual const QFutureInterfaceBase & futureInterface() const =0
int qstrcmp(const QByteArray &str1, const char *str2)
removePostedEvents
Removes all events of the given eventType that were posted using postEvent() for receiver.
void postCallOutEvent(const QFutureCallOutEvent &callOutEvent)
void disconnectNotify(const char *signal)
This virtual function is called when something has been disconnected from signal in this object...
The QEvent class is the base class of all event classes.
void sendCallOutEvent(QFutureCallOutEvent *event)
Type type() const
Returns the event type.
The QThread class provides a platform-independent way to manage threads.
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
void connectOutputInterface()
int progressMinimum() const