- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes

# QFutureSynchronizer< T > Class Template Reference

Search for all occurrences

## Detailed Description

### template<typename T>
class QFutureSynchronizer< T >

Definition at line 55 of file qfuturesynchronizer.h.

`#include <qfuturesynchronizer.h>`

List of all members.

## Public Member Functions
| QFutureSynchronizer ()
| QFutureSynchronizer (const QFuture< T > &future)
| ~QFutureSynchronizer ()
void | setFuture (const QFuture< T > &future)
void | addFuture (const QFuture< T > &future)
void | waitForFinished ()
void | clearFutures ()
QList< QFuture< T > > | futures () const
void | setCancelOnWait (bool enabled)
bool | cancelOnWait () const
## Protected Attributes
QList< QFuture< T > > | m_futures
bool | m_cancelOnWait

## Constructor & Destructor Documentation

QFutureSynchronizer | ( |  | ) | `[inline]`

Definition at line 60 of file qfuturesynchronizer.h.

    : m_cancelOnWait(false) { }

QFutureSynchronizer | ( | const QFuture< T > & | future | ) | `[inline, explicit]`

Definition at line 61 of file qfuturesynchronizer.h.

            : m_cancelOnWait(false)
        { addFuture(future); }

~QFutureSynchronizer | ( |  | ) | `[inline]`

Definition at line 64 of file qfuturesynchronizer.h.

    { waitForFinished(); }

## Member Function Documentation

void setFuture | ( | const QFuture< T > & | future | ) | `[inline]`

Search for all occurrences

Definition at line 66 of file qfuturesynchronizer.h.

        {
            waitForFinished();
            m_futures.clear();
            addFuture(future);
        }

void addFuture | ( | const QFuture< T > & | future | ) | `[inline]`

Search for all occurrences

Definition at line 73 of file qfuturesynchronizer.h.

        {
            m_futures.append(future);
        }

void waitForFinished | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 78 of file qfuturesynchronizer.h.

        {
            if (m_cancelOnWait) {
                for (int i = 0; i < m_futures.count(); ++i) {
                     m_futures[i].cancel();
                }
            }

            for (int i = 0; i < m_futures.count(); ++i) {
                 m_futures[i].waitForFinished();
             }
        }

void clearFutures | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 91 of file qfuturesynchronizer.h.

        {
            m_futures.clear();
        }

QList<QFuture<T> > futures | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 96 of file qfuturesynchronizer.h.

        {
            return m_futures;
        }

void setCancelOnWait | ( | bool | enabled | ) | `[inline]`

Search for all occurrences

Definition at line 101 of file qfuturesynchronizer.h.

        {
            m_cancelOnWait = enabled;
        }

bool cancelOnWait | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 106 of file qfuturesynchronizer.h.

        {
            return m_cancelOnWait;
        }

## Member Data Documentation

QList<QFuture<T> > m_futures `[protected]`

Search for all occurrences

Definition at line 112 of file qfuturesynchronizer.h.

bool m_cancelOnWait `[protected]`

Search for all occurrences

Definition at line 113 of file qfuturesynchronizer.h.

The documentation for this class was generated from the following file:

- QtCore/qfuturesynchronizer.h