Wt C++ 프레임 워크를 사용하고 있으며 클래스 함수로 푸시 버튼을 연결해야합니다. 아래의 코드는 잘 작동하지만 동시에 다른 액션을 사용할 수 있도록 스레드의 doors_open_all 함수를 실행해야합니다. 라인을 따라boost :: bind with std :: thread (Wt C++에서)
Wt::WPushButton *open_doors_button = new Wt::WPushButton("open all");
container_box->addWidget(open_doors_button);
open_doors_button->clicked().connect(boost::bind(&Servicemode::doors_open_all, this));
뭔가가 필요합니다 :
open_doors_button->clicked().connect(boost::threaded_bind(&Servicemode::doors_open_all, this));
'Servicemode :: doors_open_all()'함수 내에서 새 스레드를 시작할 수 없습니까? – Galik
분명히 그런 식으로 비 정적 멤버 함수의 사용을 허용하지 않습니다. – Levi
'Servicemode :: doors_open_all()'안에는 필요한 경우 람다 함수를 제공하는 스레드를 실행하여 작업을 수행 할 수 있습니다. 그러나 실제로는 스레드에서 비 정적 멤버 함수를 실행할 수도 있습니다. – Galik