Hi,
my Problem is the other way round in comparisson to the most other users having kind of the same problem

My QFutureWacher tells me, that my Future is ready, when i am not even starting the Future... How can that be?

Qt Code:
  1. ResourceCreator::ResourceCreator(boost::shared_ptr<Resource> _Resource, boost::function<void (ipf_viewer::RESOURCE_CREATION_STATUS)> _FuncPointer) :
  2. m_CreationStatus(SCHEDULED),
  3. m_Resource(_Resource)
  4. {
  5. m_Listener.push_back(_FuncPointer);
  6. QObject::connect(&m_FutureWatcher, SIGNAL(finished()), &m_SignalMapper, SLOT(map()));
  7. m_SignalMapper.setMapping(&m_FutureWatcher, this);
  8. QObject::connect(&m_SignalMapper, SIGNAL(mapped(QObject*)), ResourceManager::getInstance(), SLOT(handleFinished(QObject*)));
  9.  
  10. //m_FutureResource = QtConcurrent::run(*m_Resource, &Resource::_create, this);
  11. m_FutureWatcher.setFuture(m_FutureResource);
  12. };
To copy to clipboard, switch view to plain text mode 

So my FutureWatcher tells me, that he is ready, but i dont use run() at all! Why does it happen?
Very Interesting: I just have that problem of finished() executed and my own "handleFinished()" Slot when i am copying a boost::shared_ptr<ResourceCreator> like there:

Qt Code:
  1. boost::shared_ptr<ResourceCreator> RC(new ResourceCreator(theResource, _FuncPointerRes));
  2. ResourceManagerData<T>::m_ScheduledCreators[_Filename] = RC;
To copy to clipboard, switch view to plain text mode 

Here is my ResourceCreator class:

Qt Code:
  1. enum RESOURCE_CREATION_STATUS { SCHEDULED, FINISHED, CANCELLED };
  2. class ResourceCreator : public QObject
  3. {
  4. Q_OBJECT
  5. public:
  6. ResourceCreator(boost::shared_ptr<Resource>, boost::function<void (ipf_viewer::RESOURCE_CREATION_STATUS)>);
  7. ~ResourceCreator();
  8. void run();
  9.  
  10. boost::shared_ptr<Resource> m_Resource;
  11. QFuture< boost::shared_ptr<Resource> > m_FutureResource;
  12. QFutureWatcher< void > m_FutureWatcher;
  13. QSignalMapper m_SignalMapper;
  14. RESOURCE_CREATION_STATUS m_CreationStatus;
  15. std::vector< boost::function<void (ipf_viewer::RESOURCE_CREATION_STATUS)> > m_Listener;
  16.  
  17. private:
  18. ResourceCreator(const ResourceCreator&);
  19. };
To copy to clipboard, switch view to plain text mode 

btw: It works, when i use the run() method! But it fails, through calling finished() immediately, when i dont use run()!