-1

I am trying to use QTConcurrent class to launch some tasks asynchronously but I am getting some errors:

This is my code:

class A {
  public:
  void method1();
};
class B {
 std::unique_ptr<A> ptr;
 public:
  void method2() {
     QtConcurrent::run(&this->ptr, &A::method1);
  }
}

I get compilation error.

Could someone tell me what the correct syntax is?

Thanks in advance and regards

RuLoViC
  • 825
  • 7
  • 23
  • Class `B` doesn't have a member named `_xdmService`. The name `PttpXdmService` is not declared. No wonder you get compilation errors with this example. – Igor Tandetnik Mar 13 '18 at 13:04

1 Answers1

0

I finally was able to find working version:

class A {
 public:
 void method1();
};
class B {
  std::unique_ptr<A> ptr;
 public:
  void method2() {
    QtConcurrent::run(this->ptr.get(), &A::method1);
  }
}
RuLoViC
  • 825
  • 7
  • 23