2010-08-02 16:00:43 +02:00
|
|
|
#ifndef MODELFUTUREWATCHER_H
|
|
|
|
#define MODELFUTUREWATCHER_H
|
|
|
|
|
|
|
|
#include <QFutureWatcher>
|
2010-08-02 16:07:34 +02:00
|
|
|
#include <QPersistentModelIndex>
|
2010-08-02 16:00:43 +02:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
class ModelFutureWatcher : public QFutureWatcher<T> {
|
|
|
|
public:
|
|
|
|
ModelFutureWatcher(const QModelIndex& index, QObject* parent = 0)
|
2014-02-07 16:34:20 +01:00
|
|
|
: QFutureWatcher<T>(parent), index_(index) {}
|
2010-08-02 16:00:43 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
~ModelFutureWatcher() {}
|
2010-08-02 16:00:43 +02:00
|
|
|
|
2010-08-02 16:07:34 +02:00
|
|
|
const QPersistentModelIndex& index() const { return index_; }
|
2010-08-02 16:00:43 +02:00
|
|
|
|
|
|
|
private:
|
2010-08-02 16:07:34 +02:00
|
|
|
QPersistentModelIndex index_;
|
2010-08-02 16:00:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|